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

Forbid empty classes (take 2) #2446

Merged
merged 4 commits into from
Nov 18, 2021

Conversation

simoncozens
Copy link
Collaborator

This follows on from #2445, and forbids the following FEA syntax:

markClass [] <anchor 150 -10> @TOPMARKS;

feature test {
    sub a by [];
    sub a by c [];
    sub a from [];
    sub f f [] by f;
    ignore sub a []';
    ignore sub [] a';
    sub a []' by b;
    sub [] a' by b;
    rsub [] by a;

    pos [] 120;
    pos a [] 120;
    enum pos a [] 120;
    pos cursive [] <anchor NULL> <anchor NULL>;
    pos base [] <anchor NULL> mark @TOPMARKS;
    pos mark [] <anchor NULL> mark @TOPMARKS;
    pos ligature [] <anchor NULL> mark @TOPMARKS;
    ignore pos a []';
    ignore pos [] a';

} test;

All of these rules were allowed before, and would fail with hard errors (i.e. non user-facing stuff, IndexErrors and the like) in the builder. Glyph deletion is still allowed with the explicit NULL glyph.

Copy link
Member

@anthrotype anthrotype left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simoncozens simoncozens merged commit af9dfc9 into fonttools:main Nov 18, 2021
@simoncozens simoncozens deleted the fealib-no-empty-classes-2 branch November 18, 2021 11:31
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

2 participants