summaryrefslogtreecommitdiffstats
path: root/gfx/harfbuzz/src/addTable.py
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/harfbuzz/src/addTable.py')
-rw-r--r--gfx/harfbuzz/src/addTable.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/gfx/harfbuzz/src/addTable.py b/gfx/harfbuzz/src/addTable.py
new file mode 100644
index 0000000000..103f292dd6
--- /dev/null
+++ b/gfx/harfbuzz/src/addTable.py
@@ -0,0 +1,16 @@
+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])