Re: The current state of rendering and overlap
Alexei Podtelezhnikov <[email protected]> Tue, 19 Dec 2023 13:39:16 -0500
| Newsgroups | gmane.comp.fonts.freetype.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Behdad >> >>> Note that freetype does not use the overlap flags to determine the path fill rule (winding vs even-odd), it always uses winding for TT or CFF2 variable fonts, as the spec mandates; the discussion here is about freetype using the (TT glyf only) overlap flags to enable what Alexei calls "4x4 bilevel oversampling" in order to mitigate the effects of increased pixel coverage where paths overlap inside a glyph. I'm just summarizing the above linked fonttools issue, but I don't fully understand the technical details of this rendering technique. >>> CFF2 doesn't have an equivalent mechanism to say "this glyph may contain overlaps", which prompted this specific email thread. >> >>>> CFF was even-odd. CFF2 is non-zero winding. >>>> >> This is about the coverage calculation rather than the fill rule. Suppose two contours cover half-pixel each. The integral coverage depends on how they overlap over that pixel. The only way to reasonably deal with it is oversampling. > > I might be wrong, but I think cairo simplifies the shape, merging the overlaps. I think some font tools do that then saving static instances from variable fonts. It is a not easy on the fly.