Skip to content

Commit

Permalink
Merge pull request #722 from googlefonts/ttx-diff-no-stat
Browse files Browse the repository at this point in the history
[ttx_diff] skip STAT if it is missing
  • Loading branch information
anthrotype authored Feb 14, 2024
2 parents 88a7336 + 544b41c commit b5dfc98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions resources/scripts/ttx_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ def find_table(ttx, tag):

def select_one(container, xpath):
el = container.xpath(xpath)
assert len(el) == 1, f"Wanted 1 name element, got {len(el)}"
if len(el) != 1:
raise IndexError(f"Wanted 1 name element, got {len(el)}")
return el[0]


Expand All @@ -229,7 +230,10 @@ def erase_checksum(ttx):


def stat_like_fontmake(ttx):
el = find_table(ttx, "STAT")
try:
el = find_table(ttx, "STAT")
except IndexError:
return
ver = select_one(el, "Version")
if ver.attrib["value"] != "0x00010002":
# nop
Expand Down

0 comments on commit b5dfc98

Please sign in to comment.