unified-font-object / ufoLib

A low-level UFO reader and writer.
Other
37 stars 19 forks source link

kerning groups conversion #82

Open typemytype opened 7 years ago

typemytype commented 7 years ago

Converting UFO2 to UFO3 goes fine. When save it back to UFO2 the new (UFO3)groups are there and cause issues while reopening/reconverting the UFO back to UFO3, cause both old and new groups are available. This should not happen, a simple check on the glyphList should be enough to determine if the group should have an additional prefix number.

"The glyph \"%s\" occurs in too many kerning groups."

https://github.com/unified-font-object/ufoLib/blob/master/Lib/ufoLib/converters.py#L37

anthrotype commented 6 years ago

i'm not sure what to do with this. @typemytype please send a patch when you get to it, thanks.

anthrotype commented 6 years ago

When save it back to UFO2 the new (UFO3)groups are there

hm that's strange. If you set formatVersion=2, and call the writer.setKerningGroupConversionRenameMaps method with the same conversion mapping that you got from the reader.getKerningGroupConversionRenameMaps, then the writer should restore the old kerning group names, unless I'm missing something. There's even a test for that: https://github.com/unified-font-object/ufoLib/blob/b84eb25a50ef86e2236568f7941a8c5f11e40c56/tests/test_UFOConversion.py#L240-L347