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

Support "meta Table" custom parameter #808

Merged
merged 4 commits into from
Sep 15, 2022
Merged

Support "meta Table" custom parameter #808

merged 4 commits into from
Sep 15, 2022

Conversation

simoncozens
Copy link
Collaborator

Closes #693.

  • Convert "meta Table" to public.openTypeMeta
  • Tests for meta table implementation

Copy link
Member

@anthrotype anthrotype left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! (see comment about duplicate meta keys)

def to_ufo_meta_table(value):
meta = {}
# In: {data = "de-Latn"; tag = dlng; }, {data = "sr-Cyrl"; tag = slng; }
# Out: { "dlng": [ "de-Latn" ], "slng": [ "sr-Cyrl" ] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fonttools and UFO spec currently store meta data as a dictionary thus disallowing entries with duplicate keys, whereas Glyphs.app follows OT spec and allows that:

fonttools/fonttools#2345
unified-font-object/ufo-spec#187

Maybe that will change if somebody bothers to change that, but for now that's how it is, I suggest you log a warning in the case of duplicate keys. Right now you are taking the last, either that or taking first is fine, both are equally "wrong" anyway.

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.

support for meta table needed
2 participants