freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] [patch] emboldening rework v1


From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] [patch] emboldening rework v1
Date: Tue, 10 Apr 2012 14:45:48 -0400

On Tue, Apr 10, 2012 at 11:54 AM, Behdad Esfahbod <address@hidden> wrote:
> 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.

Really, there are *two* questions.
1. What is the orientation?
2. What is the appropriate fill rule?

The area based algorithm is more than sufficient to determine the
orientation. Freetype seem to separate the two concepts as well
(FT_OUTLINE_EVEN_ODD_FILL is not the same as FT_ORIENTATION_TRUETYPE),
but then mixes them up again in the function description by referring
to "fill orientation". I agree that there is a connection that some
fonts decided to ignore.

So what is the purpose of this function? Are we interested in the
orientation of the fill rule?

> Maybe we don't care really.

Surprisingly, FT_Oultine_Get_Orientation is not used to render the
outlines. The smooth rendered flips the negative sing and puts a
ceiling on the coverage above 1 without thinking twice. I do not even
know what filling rule that is.



reply via email to

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