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

Add rules data to .designspace. #55

Closed
LettError opened this issue Oct 11, 2016 · 5 comments
Closed

Add rules data to .designspace. #55

LettError opened this issue Oct 11, 2016 · 5 comments

Comments

@LettError
Copy link
Owner

No description provided.

@LettError
Copy link
Owner Author

LettError commented Oct 29, 2016

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" minimum="250.000000" maximum="750.000000"/>
            <condition tag="wdth" minimum="100" maximum="120"/>
            <condition tag="opsz" minimum="10" maximum="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.
  • minimum attribute, required. Number.
  • maximum attribute, required. Number.

@readroberts
Copy link
Collaborator

readroberts commented Oct 29, 2016

Looks good to me. The one change is that a condition in OpenType sets a range in which the feature is applied, rather than gt or lt a threshold. How about just 'max' and 'min' instead of 'operator' and 'value'.

See "Condition Table" in https://www.microsoft.com/typography/otspec/chapter2.htm.

  • Read

@behdad
Copy link

behdad commented Nov 1, 2016

lgtm

@LettError
Copy link
Owner Author

I added rule support to designspaceDocument. More here

@LettError LettError reopened this Dec 19, 2016
@LettError
Copy link
Owner Author

All done in UFOProcessor and designspaceLib

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

3 participants