Adding VF extracting support#40
Conversation
| extractOpenTypeGlyphs(source, destination) | ||
| if isVarFont: | ||
| ''' | ||
| Add Support for extracting Variable Instances as RLayer objects |
There was a problem hiding this comment.
Better separate UFOs or layers? Not sure.
There was a problem hiding this comment.
Oh good point, I had imagined a layer-based import just because I thought containing everything in one file was more "UFO-esque" but multiple files could be a better solution.
There was a problem hiding this comment.
May be good to have the option to do either
There was a problem hiding this comment.
Extractor works by providing a dest font object and a source binary file.
ufo = defcon.Font()
extractor.extractUFO("/path/to/MyFont.ttf", ufo)Returning a list of ufo's is a big change. Adding arguments is also a big change.
Im thinking that extracting variable fonts should be implicit, and maybe directly into a designspace object: extract axis, ranges, the relationships between sources, store font objects as sources in the designspace document object:
extractVariableFont("path/to/varfont.ttf", designspaceDocumentObject)
# raise error when no fvar table is foundExtractor is not build to round trip from binary to ufo and back, so parts can lost during extracting. But is would be cool to get as much data as possible back into scriptable objects.
Hey there, first PR here! I understand if this is out of scope but I have had this in the back of my head for a while so I decided to write it:)