mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
19 lines
403 B
Python
Executable File
19 lines
403 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
from fontTools.ttLib import TTFont
|
|
from fontTools.ttLib.tables.DefaultTable import DefaultTable
|
|
|
|
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(sys.argv[3], "rb").read()
|
|
|
|
font["Wasm"] = wasm_table
|
|
|
|
font.save(sys.argv[2])
|