LettError/MutatorMath

Designspace needs to store information about rules

Closed this issue · 1 comments

This is a proposal for some xml to record conditional glyph substitutions in designspace.

  • I'm not sure if this covers all the conditions allowed by OpenType 1.8
  • this is not proposal for feature language.
  • just covers single glyphs, not groups.
  • does not cover GPOS-like things.
<!-- optional: list of substitution rules -->
    <rules>
        <rule name="vertical bars" enabled="true">
            <sub name="cent" byname="cent.alt"/>
            <sub name="dollar" byname="dollar.alt"/>
            <condition tag="wght" operator="&gt;" value="250.000000"/>
            <condition tag="wdth" operator="&lt;" value="100"/>
            <condition tag="opsz" operator="&gt;" value="40"/>
        </rule>
    </rules>

rules

rules element: groups all the rules. Contains one or more rule elements

rule

rule element: a single rule. Contains one or more sub elements, and one or more condition elements. All conditions must evaluate to true for the rule to be

  • name: attribute, optional. String. Descriptive name for this rule.
  • enabled: attribute, optional. Bool. If this rule should be evaluated or not.

sub

sub element: a single glyph to glyph substitution.

  • name attribute, required. Name of the source glyph.
  • byname attribute, required. Name of the replacement glyph.

condition

condition element: a single condition that has to evaluate to true for this rule to be valid.

  • tag element: attribute, required. OpenType axis tag.
  • operator attribute, required. Can be either < or >
  • value attribute, required. Number.

Duplicate of #55, moved post there.