-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_json.py
More file actions
28 lines (24 loc) · 651 Bytes
/
build_json.py
File metadata and controls
28 lines (24 loc) · 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import subprocess
import glob
def dump_file(source):
out = source.replace(".otf", ".json")
subprocess.run([
"otfccdump",
source,
"--pretty", "--ignore-glyph-order", "--hex-cmap",
"-o", out
], check=True)
return out
def build_file(source):
out = source.replace(".json", ".otf")
subprocess.run([
"otfccbuild",
"-q", "--dummy-dsig", "--merge-features",
"--merge-lookups", "--subroutinize",
source, "-o", out
], check=True)
return out
if __name__ == "__main__":
for i in glob.glob("out/*.json"):
print(i, "=>")
print(build_file(i))