GNOME Bugzilla – Bug 417707
Don't create new pango fontmaps
Last modified: 2007-05-23 03:18:52 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.
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.
Behdad, any update on the patch ?
Created attachment 87300 [details] [review] untested patch
Can someone who can test gtkprinting please test the patch?
Patch seems to work fine in my testing.
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)