GNOME Bugzilla – Bug 123602
PangoFT2FontMap doesn't initialize resolution
Last modified: 2004-12-22 21:47:04 UTC
The PangoFT2FontMap object doesn't initialize it's resolution and leaves it up to the user of the library to do that. If it is omitted, the uninitialized values for dpi_x and dpi_y are used leading to inpredictable results. IMO the resolution should be set to a sane default, for example 72.0 dpi.
Created attachment 20396 [details] [review] proposed fix
This seems like an obvious bug with a straight-forward fix. Any reasons I should not commit this to HEAD (and probably 1.2 branch as well) ?
It looks like this change was accidentally applied on Nov 18 with a changelog entry corresponding to bug 101856. Should figure out how to clean that up (maybe do nothing??). Is there any point discussing 72dpi vs some other value?
Damned, I committed the wrong file. So actually the fix for bug 101856 wasn't committed and this change was committed instead. I will fix this immidiately.
2003-11-20 Sven Neumann <sven@gimp.org> * pango/pangoft2-fontmap.c: reverted the patch for bug #123602 since I only applied it accidentally. I still believe the patch should go in though. * pango/pangoft2.c: really applied the fix for #101856 as described below.
So, we are now back to the state where it should be discussed if the patch can be applied as is and if it should go into the 1.2 branch as well. Since there's a chance that uninitialized values are used, I think it should go into both branches. The only thing that might need discussion is the default value. Although 72 dpi doesn't fit today's monitor resolutions very well, it is the typical default value for resolutions since it makes makes points sizes be equal to pixels sizes.
Should be fine, with the dpi of 72, for both pango-1-2 and HAED
The code is quite different between both branches but I am confident that I did the right thing (TM) this time... 2003-12-05 Sven Neumann <sven@gimp.org> * pango/pangoft2-fontmap.c: initialize the fontmap's resolution to some sane default values. Fixes bug #123602. 2003-12-05 Sven Neumann <sven@gimp.org> * pango/pangoft2-fontmap.c (pango_ft2_font_map_new): merged fix for bug #123602 from HEAD branch (initialize fontmap resolution).