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

Multiple chained lookups per position #1119

Closed
simoncozens opened this issue Apr 27, 2020 · 9 comments
Closed

Multiple chained lookups per position #1119

simoncozens opened this issue Apr 27, 2020 · 9 comments

Comments

@simoncozens
Copy link
Collaborator

The feature file spec (5.f.i) says:

For each glyph or glyph class in the input sequence, the contextual rule may specify one lookup (§4.e) to be applied at that position.

However, the OpenType spec allows more than one lookup per position. ("multiple substitutions may occur in a given context", Substitution Lookup Record)

Syntactically it should not be a problem to extend the feature file spec to multiple lookups and allow e.g.

sub a' b lookup l1 lookup l2;

(unless someone has a glyph called lookup in which case they get what they deserve).

@josh-hadley
Copy link
Collaborator

Yes, I believe Monotype's source format supports something like this. It would be useful to extend the feature file specification to enable this as well.

@anthrotype
Copy link
Member

unless someone has a glyph called lookup in which case they get what they deserve

that's a valid glyph name, I wouldn't want to have the compiler check if "lookup" in glyphSet to determine whether it's actually a glyph name or a lookup reference token (we do similar check for ambiguous glyph ranges and it's not ideal).

Maybe lookup can be followed by a comma separated list of lookup names, e.g. lookup l1, l2

@khaledhosny
Copy link
Collaborator

Glyph names conflicting with keywords must be escaped, and lookup is a keyword already.

@simoncozens
Copy link
Collaborator Author

I suspect someone already gets what they deserve if they have a glyph called lookup and they try to use chained contextuals...

@anthrotype
Copy link
Member

Glyph names conflicting with keywords must be escaped, and lookup is a keyword already.

right. Ok then

@punchcutter
Copy link
Contributor

This should also work for GPOS. I use this feature a lot in Monotype format for substitution and positioning.

@simoncozens
Copy link
Collaborator Author

Yes, should work, we just need a test for it. I was confused by the existing pos code which seemed to have more than one lookup anyway...

@punchcutter
Copy link
Contributor

I can make some tests. I have situations with about 5 lookups referenced. Maybe more.

@simoncozens
Copy link
Collaborator Author

I've added a test for multiple lookups per position in the pull request (#1132). It didn't work, so I fixed it. :)

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

5 participants