Skip to content

Commit

Permalink
Merge pull request #666 from googlefonts/qa-otf
Browse files Browse the repository at this point in the history
fonts_from_zip: get otfs as well
  • Loading branch information
m4rc1e authored Mar 14, 2023
2 parents 8671c4b + 9c77364 commit 7538c4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Lib/gftools/scripts/check_vtt_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ def glyphs_points(font):
{'a': [(0,0), (10,10)], 'b': [(10,10, (20,20))]},
'''
res = {}
for glyph in font:
if hasattr(font[glyph], 'coordinates'):
font[glyph] = font[glyph].coordinates
res[glyph] = font[glyph].coordinates
elif font[glyph].isComposite():
font[glyph] = [c.glyphName for c in font[glyph]]
res[glyph] = [c.glyphName for c in font[glyph].components]
else:
font[glyph] = None
return font
res[glyph] = None
return res


def compare_glyph_count(font1, name1, name2):
Expand Down
2 changes: 1 addition & 1 deletion Lib/gftools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def fonts_from_zip(zipfile, dst=None):
"""Unzip fonts. If not dst is given unzip as BytesIO objects"""
fonts = []
for filename in zipfile.namelist():
if filename.endswith(".ttf"):
if filename.endswith((".ttf", ".otf")):
if dst:
target = os.path.join(dst, filename)
zipfile.extract(filename, dst)
Expand Down

0 comments on commit 7538c4c

Please sign in to comment.