Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TrueType Fonts: Clockwise or Counter-Clockwise?

608 views
Skip to first unread message

Todd A. Prater

unread,
Mar 1, 1995, 1:53:02 AM3/1/95
to
What is the orientation (Clockwise or Counter-Clockwise) of the
outline of a single-contoured glyph (like 'c') in a TrueType font?
From reading the spec, it seems like it should be Clockwise, but
lately I have been running across fonts whose outermost contours are
Counter-Clockwise. Can I not assume that these outermost contours
_should_ be Clockwise? Need I even worry about this? MSWindoze seems
to be able to use fonts like this without incident. Any help?

Talk to ya later...
Todd.

----------------------------------------------------------------------
Todd A. Prater
Kansas State University

E-Mail: sq...@ksu.ksu.edu
----------------------------------------------------------------------

Josef Moellers

unread,
Mar 3, 1995, 3:12:07 AM3/3/95
to

>What is the orientation (Clockwise or Counter-Clockwise) of the
>outline of a single-contoured glyph (like 'c') in a TrueType font?
>From reading the spec, it seems like it should be Clockwise, but
>lately I have been running across fonts whose outermost contours are
>Counter-Clockwise. Can I not assume that these outermost contours
>_should_ be Clockwise? Need I even worry about this? MSWindoze seems
>to be able to use fonts like this without incident. Any help?

My guess is that it doesn't really matter.
The TTF spec (ftp'd from ftp.microsoft.com) says in the chapter "The
scan converter":

"A point is considered to be an interior point of a glyph if it has a
non/zero winding number. The winding number is itself determined by
drawing a ray from the point in question towards infinity. (...)
Starting with a count of zero, we subtract one each time a glyph contour
crosses the ray from rightr to left or bottom to top. Such a crossing is
termed an on transition. We add one each time a contour of the glyph
crosses the ray from left to right or top to bottom. Such a transition
is termed an off transition. If the final count is non-zero, the point
is an interior point.
The direction of a contour can be determined by looking at the point
numbers. The direction is always from lower point number toward higher
point number."

The accompanying illustration shows an at sign (@) where the outline is
clockwise. The "winding number" is +1 for an interior point and 0 for an
exterior point. However, if you exchange the directions the outcome will
just change in sign (-1 for an interior point and 0 for an exterior
point). The result will still be zero for exterior and non-zero for
interior points.
--
| Josef Moellers | c/o Siemens Nixdorf Informationssysteme AG |
| USA: molle...@sni-usa.com | Abt. SU MR PD 121 | Heinz-Nixdorf-Ring|
| !USA: molle...@sni.de | Phone: (+49) 5251 815124 | D-33106 Paderborn|

Todd A Prater

unread,
Mar 10, 1995, 12:40:09 AM3/10/95
to
Josef Moellers <molle...@sni.de> writes:

>>What is the orientation (Clockwise or Counter-Clockwise) of the
>>outline of a single-contoured glyph (like 'c') in a TrueType font?
>>From reading the spec, it seems like it should be Clockwise, but
>>lately I have been running across fonts whose outermost contours are
>>Counter-Clockwise. Can I not assume that these outermost contours
>>_should_ be Clockwise? Need I even worry about this? MSWindoze seems
>>to be able to use fonts like this without incident. Any help?

>My guess is that it doesn't really matter.
>The TTF spec (ftp'd from ftp.microsoft.com) says in the chapter "The
>scan converter":
>"A point is considered to be an interior point of a glyph if it has a
>non/zero winding number.

[Description of Winding Number removed...]

>--
>| Josef Moellers | c/o Siemens Nixdorf Informationssysteme AG |
>| USA: molle...@sni-usa.com | Abt. SU MR PD 121 | Heinz-Nixdorf-Ring|
>| !USA: molle...@sni.de | Phone: (+49) 5251 815124 | D-33106 Paderborn|

I agree that if the winding number is used to determine inside/outside
status, then it doesn't matter which way outlines are described. But,
if you look at the section 'Outlines' in chapter one of the TTF spec.,
part of it reads like the following (pg. 5):

"...The points that make up a curve must be numbered in consecutive
order. It makes a difference whether the order is increasing or
decreasing in determining the fill pattern of the shapes that
make up the glyph. The direction of the curves has to be such
that, if the curve is followed in the direction of increasing
point numbers, the black space (the filled area) will always be
to the right."

To me, this means that a clockwise contour will always define the outside
edge of a filled area, and a counter-clockwise contour will always define
the inside edge of a filled area. Does the scan converter just ignore
this rule, or is there something else I am missing?

Talk to ya later...
Todd.

__________________________________________________________________
| |
| ___ __ sq...@ksu.ksu.edu Ahhh... |
| | _ _| _| |_),_ _,,_ _ ,_ Kansas State University FREAK |
| |(_)(_|(_| | | (_||_(-'| Manhattan, Oz. OUT! |
|__________________________________________________________________|

D P Marshall

unread,
Mar 11, 1995, 12:41:08 PM3/11/95
to
In article <squid.7...@cygnus.cis.ksu.edu.cis.ksu.edu>,

Todd A. Prater <sq...@cis.ksu.edu> wrote:
>What is the orientation (Clockwise or Counter-Clockwise) of the
>outline of a single-contoured glyph (like 'c') in a TrueType font?

Quick, off the top of my head answer, not knowing if I'm right...
It doesn't REALLY matter which way they go as long as the inner and outer
contours go in opposite directions. I think.

Dave
--
"It is easy to imagine an epidemic of fontomania occurring, once people
realize how much fun it is to design their own characters, hence it may
be necessary to perform fontal lobotomies"
Donald Knuth, The METAFONTbook

Stewart Robert Hinsley

unread,
Mar 12, 1995, 3:30:01 AM3/12/95
to
In article <3joonp$i...@kitty.ksu.ksu.edu>

sq...@ksu.ksu.edu "Todd A Prater" writes:

> Josef Moellers <molle...@sni.de> writes:
>
> >In <squid.7...@cygnus.cis.ksu.edu.cis.ksu.edu> sq...@cis.ksu.edu (Todd A.
> Prater) writes:
>
> >>What is the orientation (Clockwise or Counter-Clockwise) of the
> >>outline of a single-contoured glyph (like 'c') in a TrueType font?
> >>From reading the spec, it seems like it should be Clockwise, but
> >>lately I have been running across fonts whose outermost contours are
> >>Counter-Clockwise. Can I not assume that these outermost contours
> >>_should_ be Clockwise? Need I even worry about this? MSWindoze seems
> >>to be able to use fonts like this without incident. Any help?
>
> >My guess is that it doesn't really matter.
> >The TTF spec (ftp'd from ftp.microsoft.com) says in the chapter "The
> >scan converter":
> >"A point is considered to be an interior point of a glyph if it has a
> >non/zero winding number.
>

I wouldn't be surprised to find some s/w tolerant as to whether the
outermost contour is clockwise or counter-clockwise (Mr. Prater says
the rasteriser in MS-Windows is quite happy). However there's no
guarantee that other software will work; I can quite readily imagine
an naive outlining filter (duplicate clockwise curves counter-clockwise
slightly shrunk; duplicate counterclockwise curves clockwise slightly
expanded) being confused. If all you want to do is use the fonts as is
in MS-Windows then you can probably safely shrug your shoulders.

As, according to this thread, the specification is interpretible on
this point, there may also be no guarantee that later releases of the
rasteriser will accept it.

It may be that something analogous has occured with Type 1. The book
advises you to avoid overlapping paths; however some fonts do have
overlapping paths. On the version of ATM I run the overlapped areas
come out with holes were the overlap is; I presume that this did not
happen on the systems were the fonts were developed.

Stewart Hinsley Managers are the servants of their staff

ste...@meden.demon.co.uk

0 new messages