freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Autohint Outline Flag Bug


From: Allen Barnett
Subject: [Devel] Autohint Outline Flag Bug
Date: Fri, 29 Jun 2001 12:14:13 -0400

Hi,

I've been using your excellent FreeType2 library to to generate text for some 
OpenGL code I'm working on. One of the ways to render text is by extruding 
the outlines of vector fonts. In order to get lighting right, you need to 
compute the surface normals of the facets which are normal to the plane of 
the character face. (Is that as clear as mud? :-) By knowing the "sense" of 
the vector font contours with respect to the front of the glyph, you can 
compute the normals to each segment of the contours.

Depending on whether you've loaded a Type1 or a TrueType font, the sense of 
the contours are reversed, counter-clock-wise for Type1 and clockwise for 
TrueType. There's a provision for flagging this difference in the Outline 
structure. In FreeType 2.0.3, however, this flag does not appear to be 
preserved if autohinting is turned on.  I traced through ah_hinter_load and 
it seems that the original outline flag field is not copied through the 
creation of the hinted outlines in gloader. I put in a few statements in 
ah_hinter_load() to copy the outline.flags field from slot to the hinted 
gloader outlines so that the assignment back to slot->glyph.outline at the 
end of the routine restores the original flags.

I don't know if this is the right semantics, otherwise I'd send a patch. I 
think it's correct, though, because the outlines are still in the same order 
after autohinting, so I suspect that the outline flags for Type1 fonts should 
still have ft_outline_reverse_fill bit set even after autohinting.

Thanks for the great library!

Allen



reply via email to

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