Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix glyph swap #1043

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
11 changes: 9 additions & 2 deletions Lib/fontmake/instantiator.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,15 @@ 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:
swaps.append((oldName, newName))
# Also checking for duplication of rules here:
pair = (oldName, newName)
swap_exists = pair in swaps
if swap_exists:
logging.warning(
"Duplicate rule for %s in location %s", pair, location
)
if oldName in glyphNames and not swap_exists:
swaps.append(pair)
return swaps


Expand Down
Loading