googlefonts / ufo2ft

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

Avoid overwriting classDefs #705

Closed madig closed 1 year ago

madig commented 1 year ago

Ensure that we always reuse the name for class definitions for a given sequence of glyph names. This avoids duplicates and redefinitions. I validated the kerning on a body of Noto and proprietary font sources using https://github.com/daltonmaag/kerning-validator/tree/b2aafc740fbf33b503bac61a0a0237c7fab2aaf8.

The test case is extracted from a real font and pared down as much as I could.

Closes https://github.com/googlefonts/ufo2ft/issues/702

madig commented 1 year ago

Do I remember correctly that you want me to change the code back to returning classDefs, which we then insert manually, with an assert looking for duplicate names?

anthrotype commented 1 year ago

in general, I prefer when a function's inputs and outputs are clearly distinct instead of a mutable inout parameter.. whatever makes the code clearer