Skip to content

Commit

Permalink
Accept fonts w/o glyph names
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed May 13, 2017
1 parent 4ca0a57 commit ddfa078
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/collect_chars.py
Expand Up @@ -116,7 +116,11 @@ def font_support_table(fontfile: str) -> pd.DataFrame:
Runs otfinfo -u on the fontfile to get a table describing the fonts' char support
"""
def charinfo(line):
codepoint_str, glyphno, glyphname = line.split()
try:
codepoint_str, glyphno, glyphname = line.split()
except ValueError:
codepoint_str, glyphno = line.split()
glyphname = "[" + codepoint_str + "]"
codepoint = int(codepoint_str[3:], base=16)
return "{:>04X}".format(codepoint), chr(codepoint), glyphno, glyphname
otfinfo = check_output(['otfinfo', '-u', fontfile], universal_newlines=True)
Expand Down

0 comments on commit ddfa078

Please sign in to comment.