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

MultipleSubst may have zero replacement glyphs #673

Open
simoncozens opened this issue Oct 28, 2020 · 9 comments
Open

MultipleSubst may have zero replacement glyphs #673

simoncozens opened this issue Oct 28, 2020 · 9 comments

Comments

@simoncozens
Copy link

simoncozens commented Oct 28, 2020

While the GSUB spec says:

A Multiple Substitution (MultipleSubst) subtable replaces a single glyph with more than one glyph

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.

@tiroj
Copy link

tiroj commented Oct 28, 2020

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.

@PeterCon
Copy link
Collaborator

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.

@PeterCon
Copy link
Collaborator

(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?

@simoncozens
Copy link
Author

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.

@simoncozens
Copy link
Author

I’ll be adding support for zero-replacement substitutions in AFDKO and fontTools soon.

@NorbertLindenberg
Copy link

@justvanrossum
Copy link

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.

@ErwinDenissen
Copy link

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.

@ctrlcctrlv
Copy link

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

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

7 participants