Skip to content

Commit

Permalink
Add a comment and assertion to make intent explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Jan 22, 2024
1 parent 98cf47a commit 6091072
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Lib/ufo2ft/featureWriters/kernFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,12 +959,17 @@ def mergeScripts(kerningPerScript):
result.append(common)
sets = result

# Now that we have merged all common-script buckets, we need to re-assign
# the kerning pairs to the new buckets.
result = {tuple(sorted(scripts)): [] for scripts in sets}
for scripts, pairs in kerningPerScript.items():
for scripts2 in sets:
if scripts2 & set(scripts):
result[tuple(sorted(scripts2))].extend(pairs)
break
else:
# Shouldn't happen, but just in case.
raise AssertionError
return result


Expand Down

0 comments on commit 6091072

Please sign in to comment.