Skip to content

Commit

Permalink
[anchor_propagation] fix adjusting mark component's named ligature an…
Browse files Browse the repository at this point in the history
…chor

Fixes the issue described in #975 (comment)
  • Loading branch information
anthrotype committed Jan 30, 2024
1 parent d4f7aeb commit d71ef26
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Lib/glyphsLib/builder/anchor_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,17 @@ def _adjust_anchors(anchor_data, ufo, parent, component):
t = Transform(*component.transformation)
_componentAnchor = _componentAnchorFromLib(parent, component)
for anchor in glyph.anchors:
if anchor.name.startswith("_"):
# only base anchors should get propagated
continue
# adjust either if component is attached to a specific named anchor
# (e.g. top_2 for a ligature glyph)
# rather than to the standard anchors (top/bottom)
if _componentAnchor and _componentAnchor in anchor_data:
if (
_componentAnchor is not None
and _componentAnchor.startswith(anchor.name + "_")
and _componentAnchor in anchor_data
):
anchor_data[_componentAnchor] = t.transformPoint((anchor.x, anchor.y))
# ... or this anchor has data and the component also contains
# the associated mark anchor (e.g. "_top" for "top") ...
Expand Down

0 comments on commit d71ef26

Please sign in to comment.