freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] discussion of truetype glyph loading code


From: George Williams
Subject: Re: [ft-devel] discussion of truetype glyph loading code
Date: 09 Aug 2005 07:22:55 -0700

On Mon, 2005-08-08 at 22:50, Werner LEMBERG wrote:
> > This snippet is in deciding the mac scale of component offsets.  It
> > is commented out because the result is bad.  But in this page
> > http://developer.apple.com/fonts/TTRefMan/RM06/Chap6glyf.html, the
> > algorithm described is slightly different (typo?) from what we use
> > here.
> 
> I have no idea whether this makes any difference.  George?
The algorithm in the freetype code is one I determined empirically after
watching what apple's rasterizer actually did. I performed my tests some
years ago so the memory has somewhat faded.

If you look at what Apple documents you will note that at angles very
close to 45° the scale factor should suddenly double. I never observed
this to happen.

> -              if ( a - b <= 33 && a - b >= -33 )
> +              if ( a - c <= 33 && a - c >= -33 )
This is another case where I believed the apple docs to be in error.
What is documented does not make sense and is not congruent to the code
around it. m is defined in terms of a and b. n is defined in terms of c
and d. n is scaled in terms of c and d. It seems unlikely to me that m
should be scaled in terms of a and c.

But since I never observed the doubling of the scale factor at any
orientation I gave up on the whole concept.

If anyone wants to play with this again I've included a patch (to
fontforge) which will make ff generate composite glyphs with the scaled
bit set (it only sets the bit, it does not recalculate the offsets to
match the bit). Create a glyph containing a rotated and offset reference
to some other glyph and see how it is rasterized.

Attachment: ff-scaledcomponents.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]