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 417707 - Don't create new pango fontmaps
Don't create new pango fontmaps
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Behdad Esfahbod
Depends on:
Blocks:
 
 
Reported: 2007-03-13 01:07 UTC by Behdad Esfahbod
Modified: 2007-05-23 03:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
untested patch (2.42 KB, patch)
2007-05-01 02:59 UTC, Behdad Esfahbod
committed Details | Review

Description Behdad Esfahbod 2007-03-13 01:07:18 UTC
Currently _gtk_print_context_new() creates a new pangocairo fontmap and sets resolution on it in gtk_print_context_set_cairo_context().

It shouldn't.  It should simply use the default fontmap returned by pango_cairo_font_map_get_default(), and set the resolution on pango contexts it creates from it, in gtk_print_context_create_pango_context() using pango_cairo_context_set_resolution().

I'll try to cook a patch.
Comment 1 Behdad Esfahbod 2007-03-13 02:59:04 UTC
Note that after this change, we should make sure that gtk_print_context_set_cairo_context() is called before gtk_print_context_create_pango_context() all the time.  Even before this change, it's not clear what happens if you set fontmap resolution after having created contexts from it.  So, that's not really a limitation.  Just something we better enforce to avoid user confusion later.
Comment 2 Matthias Clasen 2007-04-30 03:48:06 UTC
Behdad, any update on the patch ?
Comment 3 Behdad Esfahbod 2007-05-01 02:59:26 UTC
Created attachment 87300 [details] [review]
untested patch
Comment 4 Behdad Esfahbod 2007-05-03 01:45:02 UTC
Can someone who can test gtkprinting please test the patch?
Comment 5 Matthias Clasen 2007-05-19 04:41:58 UTC
Patch seems to work fine in my testing.
Comment 6 Behdad Esfahbod 2007-05-23 03:18:52 UTC
2007-05-22  Behdad Esfahbod  <behdad@gnome.org>

        * gtk/gtkprintcontext.c (gtk_print_context_finalize),
        (_gtk_print_context_new), (_gtk_print_context_get_fontmap),
        (gtk_print_context_set_cairo_context),
        (gtk_print_context_get_pango_fontmap),
        (gtk_print_context_create_pango_context):
        Don't create new pango fontmaps.  Use the default pangocairo
        fontmap and set resolution on PangoContext instead. (#417707)