Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

connordavenport
Copy link

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:)

Lib/extractor/formats/opentype.py Outdated Show resolved Hide resolved
@@ -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
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants