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

[spec] Empty named glyph classes #971

Open
khaledhosny opened this issue Sep 25, 2019 · 3 comments
Open

[spec] Empty named glyph classes #971

khaledhosny opened this issue Sep 25, 2019 · 3 comments
Assignees

Comments

@khaledhosny
Copy link
Collaborator

khaledhosny commented Sep 25, 2019

The following feature file causes an error with makeotf but is accepted by feaLib:

@group4 = [];

makeotf error:

syntax error at "]" [test.fea 1]

The spec does not seem to explicitly disallow empty glyph classes.

@khaledhosny
Copy link
Collaborator Author

FontTools has a test that uses such empty glyph classes that was added in fonttools/fonttools#1318 (by me, though I have no recollection if having ever written this code and has no idea whatsoever what real world issue I was trying to fix).

@readroberts readroberts self-assigned this Oct 1, 2019
@readroberts
Copy link
Contributor

I can't find anywhere in the feature file spec that currently says glyph classes should not be empty. Can you point me to this? I would normally have a mild preference for disallowing this, as it seems like something that could be done by accident, and it is useful to let users know that something odd is in the file. However, I do see that allowing an empty glyph class allows developers create at least one useful test case. In fonttools/fonttools#1318, Khaled used this feature to create a class kern pair subtable with a null Coverage offset, which is useful in testing that the feaLib code weeds this out in order to avoid an error in OTS. This seems useful enough to me to justify the functionality. I vote allow to allow empty glyph classes in the feature file, with a note that this is supported in order to allow building test cases, and that any implementation needs to suppress any resulting empty Coverage tables, and suggesting that a warning be issued.

@khaledhosny
Copy link
Collaborator Author

The spec is silent on this AFAICT, but makeotf gives a syntax error, so it will need to be fixed as well.

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

No branches or pull requests

4 participants