Typophile

Why have different contour directions?

bobdigi

What is the purpose of the differing contour direction standards for different font formats?

Also is there a way to check my fontlab file to make sure all the black bodies have consistent directions?

A. One word: lawyers.

B. Select All > Contours > Set __ Direction

"A. One word: lawyers."

How?

Are you referring to curve direction?

How lawyers? Adobe patents on Postscript is how.

And sadly that applies to everything now. When I asked the guy why he had to install the sprinkler valves sticking up friggin' two feet off the ground, lawyers had something to do with that too... There's a very good reason why bashing lawyers doesn't go out of fashion. On the other hand, although (most) lawyers are in effect ambulance-chasers, the problem goes much deeper than a single career choice.

hhp

If you are referring to curve direction, if they were all the same direction the counters wouldn't work. They would be there but they would be solid like the rest of the letter and thus, invisible.

Ryan, the inside/outside rule takes care of that.

"How lawyers? Adobe patents on Postscript is how."

Hmmm. Where does Adobe claim a patent on winding direction?

It is my understanding that the question is about the different rules used by Postscript and TrueType; here is something relevant from the fontforge documentation http://fontforge.sourceforge.net/editexample2.html#non-zero

Both PostScript and TrueType require that the outer boundary of a glyph be drawn in a certain direction (they happen to be opposite from each other, which is a mild annoyance)

I was not aware of that difference.

Outer contours clockwise, inner ones anti — Altsys FreeHand 1.0, Adobe Illustrator 88. (I am that old. Shoot me!)

Not aware of this inside outside rule, but I do know that if the outside curve is clockwise, and the inside curve is clockwise, the counters will not show up in Fontlab.

Hmmm. Where does Adobe claim a patent on winding direction?

When it comes to patents and lawyers, better safe than sorry.

And the original Fontographer was written by... Altsys! :-)

Nick: And sometimes that's not even good enough! :-/
When a lawyer army decides to go after a little guy, the game is already over.

hhp

"When it comes to patents and lawyers, better safe than sorry."

True, but when it comes to Typophile it's better to tell the truth.

See? You got Hrant all lathered up over lawyers for no reason.

@Ryan - re: How FontLab displays nested contours -

That's a function of how the rendering agent interprets the curves. Same is true of any other font print or display. All you have are a lot of bits in a file - to get them to look like something, there's a program that interprets what the bits mean. Different programs can interpret differently and give different results. And they do.

- Herb

My mnemonic was closed counters are counter-clockwise, but it doesn't work for Postscript fonts.

Ryan, does the same happen when the outside and inside counters both run in the opposite direction? And when they run in the same direction? I.e., is FontLab aware you are "drawing" a TrueType font or a Type 1 font, the moment you draw a closed object?

If the clockwise/counterclockwise rule is enforced, then a single counterclockwise object logically would show nothing in one font type and something in the other (I can't be bothered to look up – literally – which one does what ;)). Does it really work that way?

TdJ - Fontlab doesn't know whether you're going to generate a TT or T1 font; it will set the contour directions as you instruct it, and will render the glyphs properly regardless. So if you draw a circle, it will appear solid regardless of its direction. If you draw two circles and drag so they overlap (like a Venn diagram) the overlap will be black if the two circles are in the same direction and white if they're opposite. Doesn't matter if they're defined as PS or TT direction (Fontlab's terminology).

Hey, who turned off the water?!

As an aside, a renderer might forgive an incorrect contour direction, but it might render the glyph slightly too dark/light as a result.

hhp

Fontlab doesn't know whether you're going to generate a TT or T1 font; it will set the contour directions as you instruct it, and will render the glyphs properly regardless.

Note that you need to be careful with FontLab's auto PS/TT path direction tools if you have made a glyph in which a bounded white space is intersected by a line and you have not yet merged the paths. So, for example, if you have made a Cyrillic Ө and the bar is not yet merged with the O shape the auto path direction tools will tend to get confused and you end up with this sort of thing:


______

As to why the PS and TT formats use opposite path direction rules, I reckon when Apple developed TT they simply set out to do as many things differently from Adobe as possible. Hence quadratic rather than cubic beziers, and hence the different path directions. I don't know if actual lawyers were involved, or if Sampo and his colleagues simply decided to play it safe.

Captured from web.archive.org on 19 Oct 2013. view this capture