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

markFeatureWriter: Ignore contextual anchors #868

Closed
wants to merge 1 commit into from

Conversation

khaledhosny
Copy link
Collaborator

We don’t support contextual anchors in markFeatureWriter, but glyphsLib subclasses it and adds support for them. However, since we are unaware of contextual anchors, we end up with positioning statements with duplicated mark positions like this:

pos base beh-ar.init
    <anchor 91 -316> mark @MC_top
    <anchor 91 -226> mark @MC_top;

(one is the regular anchor, and the other is the contextual one). Which makes no sense (feaLib shouldn’t probably allow the same mark class to be used multiple times in the same statement).

This PR adds isContextual to NamedAnchor and ignores any such anchors when writing pose statements. It is already set by glyphsLib’s MarkFeatureWriter, but otherwise should not affect ufo2ft’s as it always sets it to False.

We don’t support contextual anchors in markFeatureWriter, but glyphsLib
subclasses it and adds support for them. However, since we are unaware
of contextual anchors, we end up with positioning statements with
duplicated mark positions like this:

    pos base beh-ar.init
        <anchor 91 -316> mark @MC_top
        <anchor 91 -226> mark @MC_top;

(one is the regular anchor, and the other is the contextual one). Which
makes no sense (feaLib shouldn’t probably allow the same mark class to
be used multiple times in the same statement).

This PR adds isContextual to NamedAnchor and ignores any such anchors
when writing pose statements. It is already set by glyphsLib’s
MarkFeatureWriter, but otherwise should not affect ufo2ft’s as it always
sets it to False.
@anthrotype
Copy link
Member

can't we just bring in the whole contextual mark feature writer? It wouldn't be the first time we add some Glyphs-specific feature to ufo2ft which may benefit the rest of the UFO workflows

@khaledhosny
Copy link
Collaborator Author

I wouldn't mind doing that. The current setup is not making things easy, but it wasn’t me who set it up this way.

@anthrotype
Copy link
Member

@simoncozens do you agree with moving the glyphsLib's custom mark writer to ufo2ft to reduce the complexity?

@simoncozens
Copy link
Contributor

Sure, it will make things easier now, and also in the future if we convince UFO to support contextual anchors.

@khaledhosny khaledhosny marked this pull request as draft September 4, 2024 13:06
@khaledhosny
Copy link
Collaborator Author

OK, I’ll work on that.

@khaledhosny
Copy link
Collaborator Author

Closing in favor of #869.

@khaledhosny khaledhosny closed this Sep 4, 2024
@khaledhosny khaledhosny deleted the ignore-contextual-anchors branch September 4, 2024 19:26
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

Successfully merging this pull request may close these issues.

3 participants