Open simoncozens opened 4 years ago
What tools enable creation of such a substitution lookup? I know VOLT has no way to specify a null output, and I presumed AFDKO feature code didn't either.
Side note: when opening issues pertaining to a specific part of the OT spec, it's really helpful if you use the link at the bottom of the page in question. Thanks.
(Makes me think, One could use a type 2 or even type 4 (ligature) lookup subtable to do a single substitution.)
So, Simon, you've made a observation, but you haven't suggested any change.
GSUB type 2 was designed to support one-to-many substitutions, and the spec states that the Sequence table must specify sequences with length > 0. However, in the current spec, it doesn't require that MultipleSubstFormat1.sequenceCount must be >0. So, a MultipleSubstFormat1 without any Sequence subtables would seem to provide a one-to-none substitution.
Microsoft's own fonts rely on this behaviour
I wouldn't necessarily take the Arial Unicode MS font, which is no longer distributed with any MS products, as a precedent for what the design should be. If ability to delete a glyph from a sequence using a type 2 lookup is useful and desirable, there should be a stronger case for that than "because of Arial Unicode MS".
Is the request that spec explicitly sanction type 2 being used for 1->0 substitution?
So, Simon, you've made a observation, but you haven't suggested any change.
I’ve filed a bug in a Microsoft product. Microsoft can decide how busy to fix it.
I’ll be adding support for zero-replacement substitutions in AFDKO and fontTools soon.
Here’s one use case for a deletion rule: https://lindenbergsoftware.com/en/notes/constructing-fonts-for-batak/index.html#Reordering
However, in the current spec, it doesn't require that MultipleSubstFormat1.sequenceCount must be >0. So, a MultipleSubstFormat1 without any Sequence subtables would seem to provide a one-to-none substitution.
That makes no sense to me whatsoever.
The spec also says "The Sequence table offsets are ordered by the Coverage index of the input glyphs", which I read as "for each glyph in the coverage, there is one item in the sequenceOffsets array". It isn't spelled out, but doesn't this imply that sequenceCount should be the number of glyphs in the coverage table? What would be a use case of that not being true?
Perhaps some glyphs needs (non-empty) substitutions, and some need empty substitutions.
I see no reason why glyphCount shouldn't be allowed to be zero.
What tools enable creation of such a substitution lookup? I know VOLT has no way to specify a null output, and I presumed AFDKO feature code didn't either.
FontCreator supports this since version 12.
I have proposed explicitly supporting this in FontForge's FEA implementation, as we already do so implicitly. (Fonts that have 0-length mult subs are understood.)
See fontforge/fontforge#4619
While the GSUB spec says:
all shapers currently support a substitution rule which deletes a glyph, and Microsoft's own fonts rely on this behaviour.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.