mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 17:44:06 +01:00
[wasm-sample] Make addTable take args
This commit is contained in:
1 parent
551528a6e6
commit
5ab7f7a7d4
3 files changed
+9
-4
No files matched your search
@@ -12,7 +12,7 @@ all: test.wasm.ttf
|
||||
-o $@
|
||||
|
||||
%.wasm.ttf: %.ttf shape.so addTable.py
|
||||
python addTable.py
|
||||
python addTable.py $< $@ shape.so
|
||||
|
||||
clean:
|
||||
$(RM) test.wasm.ttf shape.so
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import sys
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.ttLib.tables.DefaultTable import DefaultTable
|
||||
|
||||
font = TTFont("test.ttf")
|
||||
if len(sys.argv) == 1:
|
||||
print("usage: python addTable.py input.ttf output.ttf Wasm.bin")
|
||||
sys.exit(1)
|
||||
|
||||
font = TTFont(sys.argv[1])
|
||||
|
||||
wasm_table = DefaultTable("Wasm")
|
||||
wasm_table.data = open("shape.so", "rb").read()
|
||||
wasm_table.data = open(sys.argv[3], "rb").read()
|
||||
|
||||
font["Wasm"] = wasm_table
|
||||
|
||||
font.save("test.wasm.ttf")
|
||||
font.save(sys.argv[2])
|
||||
Binary file not shown.
Reference in new issue
Block a user