freetype-devel
[Top][All Lists]
Advanced

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

Re: The current state of rendering and overlap


From: Behdad Esfahbod
Subject: Re: The current state of rendering and overlap
Date: Tue, 19 Dec 2023 11:28:31 -0700

On Tue, Dec 19, 2023 at 11:25 AM Alexei Podtelezhnikov <apodtele@gmail.com> 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.
 

reply via email to

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