-
Notifications
You must be signed in to change notification settings - Fork 51
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
Don't write special "Variable Font Setting" instances to designspace #786
Don't write special "Variable Font Setting" instances to designspace #786
Conversation
I don't know what '"Variable Font Setting" instance' mean, could you elaborate? Is there any link to documentation? |
designspace v5 has a new |
Exactly, those are what I mean. They can be used as a vehicle for custom parameters, filters, and other properties for a VF export. Programmatically, they can be differentiated by In the Glyphs tutorial: |
@property | ||
def type(self): | ||
if self._type == INSTANCETYPEVARIABLE: | ||
return "variable" # "variable" is stored in plist |
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.
it's weird this type
property returns either a constant string literal "variable" or a False bool value. What does Glyphs.app scripting API do in this case?
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.
It returns the constant, 0 or 1, but in the plist the value is stored as str "variable" or not at all.
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.
the plist the value is stored as str "variable" or not at all
then the conversion from 1
to "variable"
should be done inside _serialize_to_plist
method before writing the type
key
@jenskutilek I see this somehow conflicts/overlaps with @yanone's PR that we merged recently: #812 -- if there's anything from this PR that needs to be included, please rebase and adjust accordingly, otherwise we can close this |
I've added some leftovers of this to #815. |
Glyphs 3 stores export settings for variable fonts in special
GSInstance
instances.Those are currently not special-cased by glyphsLib, and are written as a normal instance into designspaces files, which leads to duplicate instances in the exported variable font.
This PR avoids exporting them to a designspace, but more work needs to be done to preserve them in roundtripping. Probably they should be written to the designspace lib and when going from DS to Glyphs, be reconstructed from there.