Skip to content

Commit

Permalink
[ttx_diff] Only report size differences if fontc bigger
Browse files Browse the repository at this point in the history
This is not a very elegant way of expressing this but it works and
leaves the existing logic in place, in case at some point we decide we
_do_ care if fontc produces something significantly smaller.
  • Loading branch information
cmyr committed Nov 13, 2024
1 parent 56102a2 commit 26aa07e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/scripts/ttx_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ def check_sizes(fontmake_ttf: Path, fontc_ttf: Path):
for key in shared_keys:
fontmake_len = fontmake[key]
fontc_len = fontc[key]
if fontc_len < fontmake_len:
continue
len_ratio = min(fontc_len, fontmake_len) / max(fontc_len, fontmake_len)
if (1 - len_ratio) > THRESHOLD:
rel_len = fontc_len - fontmake_len
Expand Down

0 comments on commit 26aa07e

Please sign in to comment.