robotools / extractor

Tools for extracting data from font binaries into UFO objects.
MIT License
51 stars 15 forks source link

Fix that space glyph's unicodes could be empty #45

Closed derwind closed 2 years ago

derwind commented 2 years ago

Applying extractUFO to a TTF with vmtx, such as a CJK font, may result in an empty list of unicodes for the space glyph. According to the OpenType specification, VORG is a CFF OpenType specific table, so the path for measuring the bounding box using ControlBoundsPen will be performed in extractOpenTypeGlyphs. In the case of the space glyph, the bounding box is None, so we have to continue before setting the unicodes. However, this does not seem to be the correct behavior.

To reproduce the problem you can use for example the following font: https://github.com/fontworks-fonts/Reggae/blob/master/fonts/ttf/ReggaeOne-Regular.ttf