GNOME Bugzilla – Bug 692470
Font sizes for printing are illegibly small
Last modified: 2013-05-14 21:31:15 UTC
Pango 1.30 printed fonts at the correct and expected size on Linux and Windows. Pango 1.32 prints fonts fine on Linux, but on Windows they are always printed extremely small (I'd say 0.1pt size) to where they look like Morse Code dots. I have tried gtk_print_operation_set_unit( op, GTK_UNIT_POINTS ) and gtk_print_operation_set_unit( op, GTK_UNIT_MM ) but both print the same output. Example code: layout = gtk_print_context_create_pango_layout( context ); wdth = gtk_print_context_get_width( context ); desc = pango_font_description_from_string( "Arial 10" ); pango_layout_set_font_description( layout, desc ); pango_font_description_free( desc ); pango_layout_set_markup( layout, "A test string", -1 ); pango_layout_set_width( layout, wdth * PANGO_SCALE ); pango_layout_set_alignment( layout, PANGO_ALIGN_LEFT ); pango_layout_get_size( layout, NULL, &layoutHght ); txtHght = ( gdouble ) layoutHght / PANGO_SCALE; cairo_move_to( cr, wdth / 2 - ( 100 - x ), ( y - txtHght ) / 2 ); pango_cairo_show_layout( cr, layout ); g_object_unref( layout );
Humm. I have no idea how / why this may have regressed.
Should be fixed in 1.34.0 already. commit 25ad29b488d3e2ae10e4fee25602409fa39207f1 Author: Behdad Esfahbod <behdad@behdad.org> Date: Mon Mar 4 17:45:03 2013 -0500 Revert "Fix Win32 and CoreText cairo backends to take cairo CTM into account" This reverts commit b359bb484bc7d27a835cfd6d9ffcaed582ebf2ae. Bug 694918 - Pango layout is rendered in wrong size if we have non-identity cairo transformation matrix I was wrong blindly copying this logic from pangocairo-fc into pangocairo-win32 and pangocairo-quartz. The reason we need the it in pangofc is because the fontsize we get back from fontconfig is multiplied by the ctm scale factor, so we undo it when loading the font. The same is NOT true about the non-fc backends, so the copying was totally wrong.
*** Bug 519146 has been marked as a duplicate of this bug. ***
I can verify that Pango 1.34 fixes the issue. Thanks!!