Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

"sub X by NULL" is (sadly) acceptable #246

Closed
simoncozens opened this issue Feb 13, 2024 · 6 comments · Fixed by googlefonts/fontc#718
Closed

"sub X by NULL" is (sadly) acceptable #246

simoncozens opened this issue Feb 13, 2024 · 6 comments · Fixed by googlefonts/fontc#718

Comments

@simoncozens
Copy link
Contributor

There's a terrible hack that's not in the FEA specification, but is used by a number of fonts. It's possible to use multiple substitution to delete a glyph; this is supported by the spec, in fonttools and makeotf.

Because you can do sub X by NULL you can also do sub a X' by NULL; but currently fea-rs pulls a face at this:

error: Expected glyph class features.fea at 4004:22
     |
4004 | sub @All.Medis r0' by NULL;
@cmyr
Copy link
Owner

cmyr commented Feb 13, 2024

okay I think this is just an oversight in the parsing of contextual lookups, we do support the sub X by NULL syntax in non-contextual... contexts. Will take a look. :)

@cmyr
Copy link
Owner

cmyr commented Feb 13, 2024

I guess this means we should also support,

sub @someclass a';

to be an implied by NULL?

@simoncozens
Copy link
Contributor Author

I don't think we need an implied one, no - the syntax for deleting is sub <single glyph> by NULL, nothing else. But we need both x by NULL; and <context> x' <context> by NULL;

@cmyr
Copy link
Owner

cmyr commented Feb 13, 2024

I was just thinking of how in various places the spec says, "Omitting the by clause is equivalent to adding by NULL".

@cmyr
Copy link
Owner

cmyr commented Feb 13, 2024

oh also: this repo has moved into fontc, I'll see about moving this issue over there.

@simoncozens
Copy link
Contributor Author

Maybe archive it, then?

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants