Skip to content

Commit

Permalink
added locations to tools/buildStat.py
Browse files Browse the repository at this point in the history
  • Loading branch information
juandelperal committed Aug 20, 2020
1 parent 8236ea6 commit 60abcb0
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions tools/buildStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ttFont = TTFont(file)
isItalic = "Italic" in file

# Axes
axes = [
dict(
tag="opsz",
Expand All @@ -24,10 +25,10 @@
values=[
dict(value=100, name='Thin'),
dict(value=200, name='ExtraLight'),
dict(value=300, name='Light', linkedValue=700),
dict(value=300, name='Light', linkedValue=600),
dict(value=400, name='Regular', linkedValue=700, flags=0x2),
dict(value=500, name='Medium', linkedValue=800),
dict(value=600, name='SemiBold', linkedValue=900),
dict(value=600, name='SemiBold'),
dict(value=700, name='Bold'),
dict(value=800, name='ExtraBold'),
dict(value=900, name='Black'),
Expand All @@ -44,5 +45,32 @@
),
]

buildStatTable(ttFont, axes, None, 'Italic' if isItalic else 'Upright')
# Locations
if isItalic:
locations = [
dict(name='Thin Italic', location=dict(wght=100, opsz=30, ital=1)),
dict(name='ExtraLight Italic', location=dict(wght=200, opsz=30, ital=1)),
dict(name='Light Italic', location=dict(wght=300, opsz=30, ital=1)),
dict(name='Italic', location=dict(wght=400, opsz=30, ital=1)),
dict(name='Medium Italic', location=dict(wght=500, opsz=30, ital=1)),
dict(name='SemiBold Italic', location=dict(wght=600, opsz=30, ital=1)),
dict(name='Bold Italic', location=dict(wght=700, opsz=30, ital=1)),
dict(name='ExtraBold Italic', location=dict(wght=800, opsz=30, ital=1)),
dict(name='Black Italic', location=dict(wght=900, opsz=30, ital=1)),
]
else:
locations = [
dict(name='Thin', location=dict(wght=100, opsz=30, ital=0)),
dict(name='ExtraLight', location=dict(wght=200, opsz=30, ital=0)),
dict(name='Light', location=dict(wght=300, opsz=30, ital=0)),
dict(name='Regular', location=dict(wght=400, opsz=30, ital=0)),
dict(name='Medium', location=dict(wght=500, opsz=30, ital=0)),
dict(name='SemiBold', location=dict(wght=600, opsz=30, ital=0)),
dict(name='Bold', location=dict(wght=700, opsz=30, ital=0)),
dict(name='ExtraBold', location=dict(wght=800, opsz=30, ital=0)),
dict(name='Black', location=dict(wght=900, opsz=30, ital=0)),
]


buildStatTable(ttFont, axes, locations, 'Italic' if isItalic else 'Upright')
ttFont.save(file)

0 comments on commit 60abcb0

Please sign in to comment.