Humm. The docs say: /* FT_OUTLINE_EVEN_ODD_FILL :: */ /* By default, outlines are filled using the non-zero winding rule. */ /* If set to 1, the outline will be filled using the even-odd fill */ /* rule (only works with the smooth rasterizer). */
This sounds wrong to me. I'm fairly sure that FreeType by default does EVEN_ODD, not WINDING. /* */ /* FT_OUTLINE_REVERSE_FILL :: */ /* By default, outside contours of an outline are oriented in */ /* clock-wise direction, as defined in the TrueType specification. */ /* This flag is set if the outline uses the opposite direction */ /* (typically for Type~1 fonts). This flag is ignored by the scan */ /* converter. */ This is consistent with EVEN_ODD being the case, not WINDING. behdad On 04/10/2012 02:45 PM, Alexei Podtelezhnikov wrote: > On Tue, Apr 10, 2012 at 11:54 AM, Behdad Esfahbod <beh...@behdad.org> 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. > _______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel