afdko
afdko copied to clipboard
`sub G by NULL` prohibited by OpenType Specification.
Note: I'm of the opinion that the OpenType Specification should change, but it's worth noting here.
The AFDKO Feature File Specification suggests that using the reserved word NULL
as the replacement glyph in a Single Substitution rule, will remove the glyph from the input (example: sub X by NULL;
or the equivalent sub X;
).
This is implemented in the binary OTF file with a Multiple Substitution lookup (lookup type 2) that has a 0-length replacement sequence. The current version of the OpenType specification has this to say:
The use of multiple substitution for deletion of an input glyph is prohibited. The glyphCount value must always be greater than 0.
haha.
Since I assume this has been going on for years, i think the OpenType specification should be corrected.
[i have also submityed a suggested correction to the OpenType spec, see linked issue in the GitHub log below]
https://github.com/MicrosoftDocs/typography-issues/issues/673
Thanks. I'm now mostly up-to-date on this amusing little disconnect. sigh
Is it perhaps worth putting a note here in the AFDKO docs? Something like:
Technical note: using
by NULL
to delete a glyph is currently implemented by using a 0-length Multiple Substitution which the OpenType specification says is prohibited, but works in all good quality shaping engines and is already in use by many font files.
Is it perhaps worth putting a note here in the AFDKO docs?
Perhaps. I think most of us involved in the past discussions were assuming that the idea had enough momentum (and implementations) that the OT Spec would get updated, but that just kinda died out.