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

Undocumented pair pos syntax? #1757

Open
cmyr opened this issue Oct 3, 2024 · 5 comments
Open

Undocumented pair pos syntax? #1757

cmyr opened this issue Oct 3, 2024 · 5 comments
Labels

Comments

@cmyr
Copy link

cmyr commented Oct 3, 2024

According to the spec (6.b.i. Specific and class pair kerning) GPOS pair positioning rules can be expressed as either,

# format A
position <glyph|glyphclass> <valuerecord> <glyph|glyphclass> <valuerecord>;

# or format B
position <glyph|glyphclass> <glyph|glyphclass> <valuerecord>;

but it looks like the compiler will also accept,

position <glyph|glyphclass> <valuerecord> <glyph|glyphclass>;

which compiles identically to format B.

Semantically this feels like "format A with an implicitly NULL second value record", and that's reasonable if redundant, but the docs should be updated to reflect that this is allowed, if it is supposed to be allowed?

@frankrolf
Copy link
Member

frankrolf commented Oct 3, 2024

The context of a GPOS pair can be more than two items – e.g. https://github.com/adobe-fonts/source-serif/blob/main/Roman/Instances/Text/Regular/kern_ctxt.fea

Maybe this makes more sense in that context?

@anthrotype
Copy link
Member

I don't think Colin is referring to contextual positioning. This is simple (non contextual) GPOS pair positioning in which the second valuerecord gets omitted (impliclitly NULL).

@frankrolf
Copy link
Member

FWIW, every kerning pair is contextual – unless you adjust a single glyph.

@cmyr
Copy link
Author

cmyr commented Oct 3, 2024

Yes this issue is not about the syntax for inline contexual rules, such as in your example; I'm referring specifically to the section of the spec dealing with GPOS Type 2 lookups. (I'll update the original issue to clarify this, thanks)

@frankrolf
Copy link
Member

Sorry, I didn’t want to seem disingenuous. My thinking is the usual notation

pos A A -100;

actually is a semantic exception, which stands for

pos A -100 A;

or

pos A' -100 A;

(the ' being unnecessary because the context is clear)

This concept can be easier understood in longer contexts, such as

pos H A' -100 A;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants