Wrong Path Direction

When I try to generate a variable font from properly interpolating TT source, Glyphs 3 changes all path directions, they get a PS direction.

PS based fonts need to be reversed (and converted to quadratic curves of cause). But for paths that have only lines, it is not clear if they are meant to be cubic (CCW) or quadratic (CW). So if you have TrueType outlines in a .glyphs file, they need to be CCW, too. Then Glyphs can safely reverse all outlines. Opening a .ttf will automatically revert.

According to the specifications, TrueType paths have black on the right.
I opened an externally generated Glyphs file with proper path directions, and when I generate a font, all paths are wrong, I do not consider that “safely reversing”, but a serious export bug.

If it is because Glyphs would have difficulties figuring out if paths with straight lines are PostScript or TrueType then maybe Glyphs should not try to figure that out :slight_smile:

I have always worked with TrueType outlines that have the right direction, I do not want to work with wrong outlines.

The spec you mentioned is relevant for curves inside an OpenType font.

The spec for the .glyphs file format says that all path need to follow the PS direction.

About the “safely reversing”. What you expect to happen for a font that has only line segments and export as .otf (CFF) and as .ttf (glyf). One of the file will be wrong?

I expect black on the left for CFF and black on the right for TTF, both right :slight_smile:

But how should Glyphs know if you drew your paths the CFF way or the TT way? And what if some glyphs are TT and some are CFF (can easily happen if someone opens a TTF and adds some new glyphs/shapes).

Glyphs could check the directions of the outer paths to make an educated guess if the font is mostly TT or CFF. Other professional apps also don’t always get it right with the path direction, so it might be a yet unsolved challenge to come up with a watertight algorithm.
I like to get an export warning:
inconsistent path directions detected, adjust/don’t adjust.
and then I would like to see which glyphs were modified, to visually check them.

My system is very watertight. A very simple rule and always correct results for export in any direction (TT and PS outlines to both .ttf and .otf).

When Glyphs generates a variable TrueType font with PostScript path directions (no warning) I do not consider it a watertight system. Drawing with TrueType outlines whose direction is against the TrueType specification is confusing for users that read specifications.

Just came across the same case:

– Export to ttf.
– Open exported file back in Glyphs.
– Curves is quadratic with CCW direction (expected is CW).
– Open exported file in Fontlab.
– Curves is quadratic and direction is CW (so everything is correct with the file).

So looks like there is some automatic CW → CCW conversion that happens on the fly for any curve types when opening the file.

People may open their exported font files back in Glyphs to make sure that everything is exported correctly. And this conversion confuses in this case. I understand the reasons of Saving and Export formats, but then another questions arises – Should people just trust algorithms and not to check the files after export, or should they use third-party tools for this?

You need to be able to export OTFs and TTFs from the same source. So it is better to reverse directions at export for TTFs.

When you open an OTF in Glyphs, you are looking at a .glyphs file reverse-engineered from a compiled binary.

There are better tools for checking exports.

Thanks for confirm that behavior, I will keep that in mind.