Skip to content

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

Open
@madig

Description

@madig

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions