Skip to content

Commit

Permalink
propagate_anchors: propagate contextual anchors
Browse files Browse the repository at this point in the history
GlyphsApp does actually propagate them:
#1037 (comment)
  • Loading branch information
khaledhosny committed Oct 7, 2024
1 parent e5a9e7f commit 1832f83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions Lib/glyphsLib/builder/transformations/propagate_anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ def anchors_traversing_components(
component_transform = Transform(*component.transform)
xscale, yscale = get_xy_rotation(component_transform)
for anchor in anchors:
# skip contextual anchors
if anchor.name.startswith("*") and "GPOS_Context" in anchor.userData:
continue
new_has_underscore = anchor.name.startswith("_")
if (component_idx > 0 or has_underscore) and new_has_underscore:
continue
Expand Down
3 changes: 2 additions & 1 deletion tests/builder/transformations/propagate_anchors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ def test_contextual_anchors():
new_glyph.layers[0].anchors,
[
("bottom", (50, 0)),
("top", (35, 229)),
("*bottom", (95, 0), {"GPOS_Context": "* behDotless-ar.fina"}),
("top", (35, 229)),
],
)

Expand All @@ -665,6 +665,7 @@ def test_contextual_anchors():
new_glyph.layers[0].anchors,
[
("bottom", (50, 0)),
("*bottom", (95, 0), {"GPOS_Context": "* behDotless-ar.medi"}),
("top", (35, 229)),
],
)
Expand Down

0 comments on commit 1832f83

Please sign in to comment.