-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding VF extracting support #40
base: master
Are you sure you want to change the base?
Conversation
@@ -48,6 +67,20 @@ def extractFontFromOpenType( | |||
extractOpenTypeInfo(source, destination) | |||
if doGlyphs: | |||
extractOpenTypeGlyphs(source, destination) | |||
if isVarFont: | |||
''' | |||
Add Support for extracting Variable Instances as RLayer objects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better separate UFOs or layers? Not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be good to have the option to do either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 found
Extractor 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:)