Skip to content

Commit

Permalink
Check for existing swap by oldName instead of checking for the pair
Browse files Browse the repository at this point in the history
  • Loading branch information
yanone committed Sep 26, 2023
1 parent 10af377 commit fdc9643
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/fontmake/instantiator.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def process_rules_swaps(rules, location, glyphNames):
# I guess it should be, so that we can swap, and if it isn't,
# then it's better to error out later when we try to swap,
# instead of silently ignoring the rule here.
if oldName in glyphNames and (oldName, newName) not in swaps:
# Also checking for duplication of rules by oldName here:
if oldName in glyphNames and oldName not in [swap[0] for swap in swaps]:
swaps.append((oldName, newName))
return swaps

Expand Down

0 comments on commit fdc9643

Please sign in to comment.