After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692470 - Font sizes for printing are illegibly small
Font sizes for printing are illegibly small
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: win32
1.32.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
pango-maint
Depends on:
Blocks:
 
 
Reported: 2013-01-24 20:18 UTC by Michael Cronenworth
Modified: 2013-05-14 21:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Cronenworth 2013-01-24 20:18:32 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 );
Comment 1 Behdad Esfahbod 2013-01-30 01:46:14 UTC
Humm.  I have no idea how / why this may have regressed.
Comment 2 Behdad Esfahbod 2013-05-14 18:12:55 UTC
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.
Comment 3 Behdad Esfahbod 2013-05-14 18:14:56 UTC
*** Bug 519146 has been marked as a duplicate of this bug. ***
Comment 4 Michael Cronenworth 2013-05-14 21:31:15 UTC
I can verify that Pango 1.34 fixes the issue. Thanks!!