Skip to content

Commit

Permalink
Log merging of kerning lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Jan 22, 2024
1 parent 6091072 commit 327e760
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Lib/ufo2ft/featureWriters/kernFeatureWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,12 @@ def splitKerning(pairs, glyphScripts):

kerningPerScript = mergeScripts(kerningPerScript)

for pairs in kerningPerScript.values():
for scripts, pairs in kerningPerScript.items():
if len(scripts) > 1:
LOGGER.info(
"Merging kerning lookups from the following scripts: %s",
", ".join(scripts),
)
pairs.sort()

return kerningPerScript
Expand Down
8 changes: 4 additions & 4 deletions tests/featureWriters/kernFeatureWriter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,10 +1535,10 @@ def test_kern_split_and_drop(FontClass, caplog):
"""
)

msgs = sorted(msg[-31:] for msg in caplog.messages)
assert msgs == [
"with mixed direction (LTR, RTL)",
"with mixed direction (RTL, LTR)",
assert caplog.messages == [
"Skipping kerning pair <('a', 'a-orya', 'alpha') ('a-cy', 'alef-ar', 'period') 20> with mixed direction (LTR, RTL)",
"Skipping kerning pair <('a-cy', 'alef-ar', 'period') ('a', 'a-orya', 'alpha') 20> with mixed direction (RTL, LTR)",
"Merging kerning lookups from the following scripts: Cyrl, Grek, Latn, Orya",
]


Expand Down

0 comments on commit 327e760

Please sign in to comment.