GNOME Bugzilla – Bug 410420
Supporting text layout that is the same at any scale
Last modified: 2007-02-23 04:38:38 UTC
If I use CAIRO_HINT_METRICS_OFF and CAIRO_HINT_STYLE_NONE I expect the resulting text layout to be the same whatever I pass to cairo_scale(). But the layout changes at different scales. I thought this might be related to bug 341481 but I tried to turn off kerning (by just returning immediately in pango_fc_font_kern_glyphs) and the problem was still there. (apply_gpos_* isn't being called either.) I'll attach a test app in a minute. I'm trying to track down the bug but I don't really understand Pango font stuff too well.
Created attachment 83045 [details] test app
This seems to be a dupe of bug 392475. I'll try to find some time debugging that.
Created attachment 83085 [details] freetype test app The problem seems to be due to calculation errors in freetype. I've attached a little test app that shows the problem. I'm not sure if it is fixable. I'll look at the freetype code tomorrow.
I asked about the problem on the freetype list. Here's what David Turner said: the returned 26.6 advance is always rounded, even with FT_LOAD_NO_HINTING. You can however retrieve the linearly scaled value as a 16.16 fixed float number through face->glyph->linearHoriAdvance. This works even with hinted glyphs. just shift it 10 bits to the right to get the equivalent FT_F26Dot6
Created attachment 83117 [details] [review] partial fix This patch makes it much better, though text layouts can still change at small sizes (probably due to accumulated rounding errors). But I'm not sure the patch is correct, as I'm not familiar with this code.
Ah, didn't see your patch. I fixed it similarly. *** This bug has been marked as a duplicate of 392475 ***