[cairo] Re: [Bug 410420] Supporting text layout that is the same at any scale

Behdad Esfahbod behdad at behdad.org
Thu Feb 22 20:19:06 PST 2007


> ------- Comment #4 from Damon Chaplin  2007-02-22 15:20 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

Ok, just committed and pushed:

3b168e45510e02caf54e4b3cd0df76df6420d304

This brought down the variance of x_advance in the attached test case
for a 10pt font from 50dpi to 200dpi from 12% down to less than 0.2%.  I
think that is as good as we can get with Pango's 22.10 fixed point.

Really good to see this bug finally pinned down and fixed.  Thanks Damon
for tracking it down.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759


-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 2267 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070222/cb73162c/main.c


More information about the cairo mailing list