markFeatureWriter: Ignore contextual anchors #868
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
(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.