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

Is the behavior of named anchors in the context of MarkFeatureWriter documented? #330

Closed
justvanrossum opened this issue May 3, 2019 · 6 comments

Comments

@justvanrossum
Copy link
Contributor

Or is this behavior based on Glyphs and if so, do they have it documented?

We would love to add a section about this to the UFO spec if possible, as it's a good precedent for possible future use of anchors-with-naming-convention. (Right now we're discussing using anchors to define ligature caret positions.)

@anthrotype
Copy link
Member

yes, it's based on Glyphs.

Basically, base and mark anchors are paired by their names. Mark anchors have the same name as the respective base anchors, but prefixed with an _ (e.g. "a" has a "top" anchor, "acutecomb" has a "_top" anchor, etc.).

Ligature glyphs may contain base anchors with an _1, _2, etc. suffix. The number identifies the ligature component that they are associated with (in logical order, starts from 1). If there are gaps in the list of anchor index suffixes (e.g. it goes from top_1 to top_3, without a top_2), these will be filled with <anchor NULL> in the pos liga rule.

The writer also considers any GDEF GlyphClassDefinitions in features.fea to classify base, marks and ligature glyphs. Otherwise, it treats any glyph containing an underscore-prefixed anchor as a mark glyph, and any glyph with those number suffixed anchors as a "ligature" for the sake of mark feature (probably too greedy).

For supported Indic scripts, the writer also generates abvm and blwm features using hard-coded list of anchor names for above and below anchor names.

To go in more details I'd spend two hours writing one of those "epic explanations" :)
But I can't right now.

@justvanrossum
Copy link
Contributor Author

Thanks.

Seems there's some precedence in Adobe's https://github.com/adobe-type-tools/python-modules/blob/master/WriteFeaturesMarkFDK.py

@justvanrossum
Copy link
Contributor Author

My question so far has been answered, I'll close this.

(Feel free to reopen if you think it's useful as a reminder to maybe someday document this somewhere.)

@brawer
Copy link
Contributor

brawer commented May 3, 2019

By the way, as far as I can remember, there's also some anchor naming convention for defining ligature caret positions.

@justvanrossum
Copy link
Contributor Author

By the way, as far as I can remember, there's also some anchor naming convention for defining ligature caret positions.

I can't find anything about that in ufo2ft, but apparently Glyphs does indeed do (something like) that.

@anthrotype
Copy link
Member

Yes, it’s currently only handled by GlyphsLib, see #329

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

No branches or pull requests

3 participants