Skip to content

Commit

Permalink
Scripts order
Browse files Browse the repository at this point in the history
  • Loading branch information
juandelperal committed Aug 27, 2020
1 parent e4fcb38 commit bcec3fa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ done
echo
echo Fixing fonts
for VF in fonts/Piazzolla/variable/ttf/*.ttf; do
python tools/fixNameTable.py $VF
python tools/buildStat.py $VF
gftools fix-dsig -f $VF
gftools fix-nonhinting $VF "$VF.fix"
mv "$VF.fix" $VF
Expand All @@ -57,8 +59,6 @@ for VF in fonts/Piazzolla/variable/ttf/*.ttf; do
ttx $TTXFILE
rm fonts/Piazzolla/variable/ttf/$BASE.ttx
rm fonts/Piazzolla/variable/ttf/$BASE-backup-fonttools-prep-gasp.ttf
python tools/buildStat.py fonts/Piazzolla/variable/ttf/"$f"-VF.ttf
python tools/fixNameTable.py $VF
done

if $static; then
Expand Down
6 changes: 4 additions & 2 deletions tools/buildStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ def updateFvar(ttFont):

buildStatTable(ttFont, axes)
updateFvar(ttFont)

statTable = ttFont['STAT'].table

## Testing STAT version change
# statTable.Version = 0x00010001
# statTable.Version = 0x00010002

ttFont.save(file)

print()
print()
Expand All @@ -83,9 +85,9 @@ def updateFvar(ttFont):
(statTable.Version))

# Debug
print(dumpTable(ttFont, 'STAT'))
print(dumpTable(file, 'STAT'))
# print(dumpTable(ttFont, 'fvar'))
# print(dumpTable(ttFont, 'name'))


ttFont.save(file)

5 changes: 1 addition & 4 deletions tools/dumpTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
__author__ = 'juan@huertatipografica.com (Juan del Peral)'

import sys
from fontTools.ttLib import TTFont
from tools import dumpTable

if __name__ == "__main__":
Expand All @@ -16,6 +15,4 @@
"Example:\n"
"python dumpTable.py yourFont.ttf STAT\n"
)
file = sys.argv[1]
ttFont = TTFont(file)
print(dumpTable(ttFont, sys.argv[2]))
print(dumpTable(sys.argv[1], sys.argv[2]))
3 changes: 2 additions & 1 deletion tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def scaleFont(source, destination, factor):
font.save(destination)


def dumpTable(font:TTFont, table:str):
def dumpTable(path:str, table:str):
font = TTFont(path)
fontTable = font[table]
return "\n".join(getXML(fontTable.toXML, font))

0 comments on commit bcec3fa

Please sign in to comment.