[cairo] Cairo, pango and Win32.. incorrect font rendering
pcjc2 at cam.ac.uk
Mon Jan 18 14:44:43 PST 2010
On Mon, 2010-01-18 at 16:01 -0500, Behdad Esfahbod wrote:
> > I believe (although this is unconfirmed) that my colleagues with the
> > issue are in locales where "," is the decimal point separator.
> > What if my code is asking for:
> > Arial 10,400000
> > E.g. 10.4 point font?
> Yes, that sounds like the bug!
> You can totally avoid using a font string and use
> pango_font_description_set_family and set_size() directly.
Your suggestion fixed the bug - superb!
Now, I'll just have to figure out if the Pango backend, or gEDA is being
naught about mixing "," or ".", as I think we override some LOCALE
I wonder why this has never manifested as an issue on Linux before (IE.
With freetype). Perhaps if it "decides" to take the "10" part of the
"10.400000" the effect would be too small for people to notice and
grumble about. Perhaps it parses the font-string correctly.
I trust it is OK just to do this:
desc = pango_font_description_new ();
pango_font_description_set_family_static (desc, FONT_NAME);
pango_font_description_set_size (desc, (int)((double)PANGO_SCALE * font_size_pt));
//(Yes - my rounding is naughty - but I doubt anyone will ever notice)
And not call any other of the pango_font_description_set_* () routines?
More information about the cairo