From bcec3fa213ce6dd2a42b39b11e93bbdaa7fbc1e0 Mon Sep 17 00:00:00 2001 From: juandelperal Date: Thu, 27 Aug 2020 10:44:27 +0200 Subject: [PATCH] Scripts order --- build.sh | 4 ++-- tools/buildStat.py | 6 ++++-- tools/dumpTable.py | 5 +---- tools/tools.py | 3 ++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 519827f..267fbec 100755 --- a/build.sh +++ b/build.sh @@ -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 @@ -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 diff --git a/tools/buildStat.py b/tools/buildStat.py index 72c2377..a7f58f5 100644 --- a/tools/buildStat.py +++ b/tools/buildStat.py @@ -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() @@ -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) + diff --git a/tools/dumpTable.py b/tools/dumpTable.py index 7f9f4b4..8d6ebd2 100644 --- a/tools/dumpTable.py +++ b/tools/dumpTable.py @@ -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__": @@ -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])) diff --git a/tools/tools.py b/tools/tools.py index 87b8105..c940581 100644 --- a/tools/tools.py +++ b/tools/tools.py @@ -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)) \ No newline at end of file