Re: The current state of rendering and overlap
Behdad Esfahbod <[email protected]> Tue, 19 Dec 2023 11:28:31 -0700
| Newsgroups | gmane.comp.fonts.freetype.devel |
|---|---|
| Message-ID | <CAF63+7V3_GaHTLfCoNOJomvAj0OsiGLOkCDmd7=09QG0HtphVg@mail.gmail.com> |
On Tue, Dec 19, 2023 at 11:25 AM Alexei Podtelezhnikov <[email protected]> wrote: > > 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.