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

[merge] Merge names #3414

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[merge] Merge names #3414

wants to merge 1 commit into from

Conversation

miloush
Copy link
Contributor

@miloush miloush commented Jan 10, 2024

This adds infrastructure for merging name tables. A stylistic set feature params are newly merged as a result (the feature names are joined into one name).

The way this is currently designed:

  1. During pre-merge, a name record visitor reads the name strings and stores them onto the respective objects
  2. During post-merge, another name record visitor reads the strings, merges them, adds the merged string to the name table, sets the resulting nameID on the object and deletes the stored strings from objects
  3. If enabled using --merge-names switch, the system names (ID < 256) are merged during name table merging.

Is this approach reasonable? The name record visitor seems to take quite time for some fonts. The whole pre- and post-merge could be made opt-in behind the new switch, however, the layout merging would need to have access to the options during mergeFeature to know not to create any feature params. Alternatively, the name strings could be stored somewhere else and not on the objects where they are referred from.

The usage is demonstrated on mergeFeatureParams, however currently implemented for ss features only, not the others.

(also the original NameRecordVisitor was fixed to mark all names indicated by FirstParamUILabelNameID and NumNamedParameters as seen, not just the first name ID)

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.

None yet

1 participant