On 04/09/2012 09:23 PM, Alexei Podtelezhnikov wrote:
>                                        In memory of Paul Alexi
> 
> As a way of ping, I going to throw in a much simpler
> FT_Outline_Get_Orientation patch. So the whole collection of three
> patches now looks like the attached. Comments, suggestions?

I like the area-based algorithm.  I had to implement outline orientation code
recently and I wish I had remembered that algorithm!

What I found in testing my implementation was that fonts don't have consistent
contour orientation.  From what I understand:

  - TrueType fonts have even-odd fill rule and fill-right orientation,

  - Type1 fonts have zero-winding fill rule and fill-left orientation.

Now *if* TrueType outlines are really fill-right, then even-odd and
zero-winding rules are the same.  But I've came across many fonts where
TrueType outlines are even-odd, not fill-right.  I'm guessing that you want to
return ORIENTATION_NONE in those cases.  But finding them is not easy with
your algorithm.

Maybe we don't care really.

What I ended up doing was implement both even-odd rule and winding rule and
compare the results.  I was doing this on arc splines though, not Beziers.

behdad

_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to