googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

TrueType outline compiler may change point indices #469

Closed jenskutilek closed 2 years ago

jenskutilek commented 3 years ago

The TrueType outline compiler changes the point indices in some cases.

https://github.com/googlefonts/ufo2ft/blob/master/Lib/ufo2ft/outlineCompiler.py#L1301-L1316

This is because it uses a segment-based pen, which rotates the points so each contour starts with an oncurve point.

This is a problem for instructed glyphs, as it makes the instructions invalid. Using a point-based pen could solve the problem, but it doesn't exist in fontTools.

anthrotype commented 3 years ago

Let's make a TTGlyphPointPen. Want to work on a PR?

jenskutilek commented 3 years ago

I'll have a shot at it.

anthrotype commented 3 years ago

@jenskutilek would you like to work on a PR to ufo2ft for using the new TTGlyphPointPen?

anthrotype commented 3 years ago

ah I forgot, you already made one 😅
https://github.com/googlefonts/ufo2ft/pull/478