googlefonts / glyphsLib

A bridge from Glyphs source files (.glyphs) to UFOs
Apache License 2.0
178 stars 51 forks source link

Store shape indices #908

Closed simoncozens closed 1 year ago

simoncozens commented 1 year ago

This fixes #895. We do this by:

1) Providing a .shapes accessor on the GSLayer object, similar to Glyphs 3 API. 2) Storing a "shapes signature" in the UFO lib for mixed path/component glyphs. For example, if the shape order is "path 1, component 1, path 2, path 3, component 2", a signature will be stored in the layer's lib dictionary with the value "PCPPC". 3) Using this signature to re-arrange the .shapes array when loading UFOs back into Glyphs objects. 4) When processing a corner component, mapping the "shape index" (stored in the hints array) to the "path index" using the signature.

simoncozens commented 1 year ago

Regression tests are expected to fail as this changes the UFO output.