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 410420 - Supporting text layout that is the same at any scale
Supporting text layout that is the same at any scale
Status: RESOLVED DUPLICATE of bug 392475
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2007-02-21 15:34 UTC by Damon Chaplin
Modified: 2007-02-23 04:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test app (2.61 KB, text/plain)
2007-02-21 15:36 UTC, Damon Chaplin
  Details
freetype test app (1.54 KB, text/plain)
2007-02-22 02:29 UTC, Damon Chaplin
  Details
partial fix (762 bytes, patch)
2007-02-22 17:44 UTC, Damon Chaplin
none Details | Review

Description Damon Chaplin 2007-02-21 15:34:53 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.
Comment 1 Damon Chaplin 2007-02-21 15:36:23 UTC
Created attachment 83045 [details]
test app
Comment 2 Behdad Esfahbod 2007-02-21 17:17:01 UTC
This seems to be a dupe of bug 392475.
I'll try to find some time debugging that.
Comment 3 Damon Chaplin 2007-02-22 02:29:55 UTC
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.
Comment 4 Damon Chaplin 2007-02-22 15:20:53 UTC
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
Comment 5 Damon Chaplin 2007-02-22 17:44:11 UTC
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.
Comment 6 Behdad Esfahbod 2007-02-23 04:38:38 UTC
Ah, didn't see your patch.  I fixed it similarly.

*** This bug has been marked as a duplicate of 392475 ***