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

feature description for 'kern' seems to contradict GPOS spec #557

Closed
PeterCon opened this issue Aug 21, 2020 · 3 comments
Closed

feature description for 'kern' seems to contradict GPOS spec #557

PeterCon opened this issue Aug 21, 2020 · 3 comments

Comments

@PeterCon
Copy link
Collaborator

The feature description for 'kern' has the following:

Application interface: The application passes a sequence of GIDs to the 'kern' table, and gets back adjusted positions (XPlacement, XAdvance, YPlacement and YAdvance) for those GIDs. When using the type 2 lookup on a run of glyphs, it’s critical to remember to not consume the last glyph, but to keep it available as the first glyph in a subsequent run (this is a departure from normal lookup behavior).

This seems to be indicating that applications for implement feature-specific processing for the 'kern' feature, and that, moreover, contradicts this guidance from the Lookup spec:

During text processing, a client applies a lookup to each glyph in the string before moving to the next lookup. A lookup is finished for a glyph after the client makes the substitution/positioning operation. To move to the “next” glyph, the client will typically skip all the glyphs that participated in the lookup operation: glyphs that were substituted/positioned as well as any other glyphs that formed a context for the operation. However, in the case of pair positioning operations (i.e., kerning), the “next” glyph in a sequence may be the second glyph of the positioned pair (see pair positioning lookup for details).

That spec allows for special behaviour for GPOS type 2 lookups, but that is contingent on the lookup data. The feature description doesn't mention the lookup data as a contingent condition for the behaviour.

Neither MS or Apple implementations do any feature-specific processing of lookups.

It appears the actual intent was not guidance for applications but rather guidance for font developers: make sure in 'kern' type 2 lookups to have valueFormat2 set to 0 so that the second glyph is not adjusted and consumed.

Thus, the 'kern' feature description should be revised to correct the currently misleading guidance.

This same issue also affects 'vkrn', 'chws' and 'vchw' feature descriptions.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@PeterCon PeterCon self-assigned this Aug 21, 2020
@simoncozens
Copy link

The first sentence is also strangely written. Tables are data, not functions; you can’t pass anything to them and they can’t return anything.

@PeterCon
Copy link
Collaborator Author

PeterCon commented Aug 22, 2020

Ah, yes, That! There are a bazillion feature descriptions using this wording, as though it actually made sense. In TTO, the feature descriptions didn't have this; but it was there by OT 1.25.

I'll work on better wording for these four feature descriptions. Cleaning up all occurrences would be a much longer task.

@PeterCon
Copy link
Collaborator Author

The first sentence is also strangely written.

Actually, please open a separate issue for that. I've already fixed the issue this was opened for while adding 'chws' and 'vchw' features.

Cf. #535, #536, #538

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

2 participants