diff --git a/Lib/ufo2ft/featureWriters/markFeatureWriter.py b/Lib/ufo2ft/featureWriters/markFeatureWriter.py index 16df5b4d..1acf65d1 100644 --- a/Lib/ufo2ft/featureWriters/markFeatureWriter.py +++ b/Lib/ufo2ft/featureWriters/markFeatureWriter.py @@ -649,6 +649,9 @@ def _makeMarkToBaseAttachments(self): # skip '_1', '_2', etc. suffixed anchors for this lookup # type; these will be are added in the mark2liga lookup continue + if anchor.isContextual: + # skip contextual anchors. They are handled separately. + continue assert not anchor.isMark baseMarks.append(anchor) if not baseMarks: @@ -669,6 +672,9 @@ def _makeMarkToMarkAttachments(self): # skip anchors for which no mark class is defined if anchor.markClass is None or anchor.isMark: continue + if anchor.isContextual: + # skip contextual anchors. They are handled separately. + continue if anchor.number is not None: self.log.warning( "invalid ligature anchor '%s' in mark glyph '%s'; " "skipped", @@ -700,6 +706,9 @@ def _makeMarkToLigaAttachments(self): if number is None: # we handled these in the mark2base lookup continue + if anchor.isContextual: + # skip contextual anchors. They are handled separately. + continue # unnamed anchors with only a number suffix "_1", "_2", etc. # are understood as the ligature component having if not anchor.key: diff --git a/tests/featureWriters/markFeatureWriter_test.py b/tests/featureWriters/markFeatureWriter_test.py index 47c50920..a0566792 100644 --- a/tests/featureWriters/markFeatureWriter_test.py +++ b/tests/featureWriters/markFeatureWriter_test.py @@ -1818,7 +1818,6 @@ def test_contextual_anchors_no_mark_feature(self, testufo): lookup mark2base { pos base a - mark @MC_top mark @MC_top; } mark2base;