It is one of those things I never remember - winding rule of truetype and
postscript are different, one is even-odd, the other is non-zero. That concerns
the number of times a line joining an "interior" (inked) point going to
infinity, how many times it crosses the glyph contour.
Anyway, viewing from a small gap between two "inked" portion, the two contours
on either side must be running in opposite direction.
There is a simple case where two contours runs in the same direction: think of
a single connected contour that is like two circles except it crosses itself at
one point (just say, the top - ie. You draw anti-clockwise from 12, when you
get to 1, move inward to draw another circle, and move outward to 12 to join
original when you get to 1 a 2nd time).
I think the two winding rules means in either case, the region between the
inner/outer part is inked (viewing from that area locally, you see contours
running in parallel), because the contour goes around you "once". Whether the
inner circle is inked depends on whether you are talking postscript/cff or
truetype. One is inked, the other is not. (That region is enclosed by the
contour globally "twice" - hence difference in even-odd versus non-zero). So
this self-intersecting contour should either be drawn as mostly an 'o' shape,
or a solidly inked circle.
Granted, self-intersecting contours are rare, but they are legal. Anyway, a
small gap we have been discussing for which we want to preserve during hinting,
locally if you are sitting at that spot, you see contours running in opposite
directions around you. If you see contours running in the same direction, you
are possibly in a inked part instead, like between the self-intersecting
bi-circle I just told you.
On Saturday, 12 August 2023 at 06:43:14 BST, Craig White
<[email protected]> wrote:
I'm still missing something. Why would the direction of the contour matter
if, in either case, it's the same set of points?
On Fri, Aug 11, 2023 at 6:52 AM Werner LEMBERG <[email protected]> wrote:
> You said that for an i - like shape:
>> Both contours have the same direction.
>
> What kind of problems does this rule protect against?
Sorry, this was sloppily formulated. It's about the *local* direction
of contours, that is, whether a horizontal contour segment goes from
left to right or from right to left. For the 'i' stem and the 'i'
dot, both contours must have the same direction globally, but locally,
at the dividing space, the corresponding lower and upper segments must
have the opposite directions.
Werner