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

Instantiator: rule substitutions behave differently than for OT feature variations #852

Open
madig opened this issue Jun 11, 2024 · 0 comments

Comments

@madig
Copy link
Collaborator

madig commented Jun 11, 2024

Rules that work for variable fonts may not work for instances, because varLib/feature variations and the instantiator work differently.

  • Expectation: I can reuse the Designspace with the rules that I made work for variable fonts.
  • Actually: I have to make a copy and write different rules to implement the same logic for instance generation.

The reproducers are described in more detail on https://github.com/daltonmaag/designspace-rules-reproducers.

What I expect (from instance-ref-stacked-high.ttf, made from in instance-reference.designspace, with the test string "Aa"):

image

What actually happens (in instance-test-stacked-high.ttf, made from instance-test.designspace):

image

The "a" is the original glyph rather than "a.break".

The rub lies in the way substitutions work:

  1. In feature variations, the shaper is expected to find the first condition set that matches and then stop there.
  2. The instantiator will collect all rules where the condition set matches and then swap glyph contents. On rule boundaries (like HGHT=750 for instance-test-stacked-high.ttf), when rules contain duplicate substitutions and start and end points overlap, it may collect two or more rules. Any duplicate substitutions can then cause a swap back and forth, undoing substitutions.
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

No branches or pull requests

1 participant