mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
Format font metrix data to have one row for each glyph
This will make reviewing modifications easier, since the affected glyphs will be more readily visible in the diff. The formatting tool was applied to the existing data, instead of regenerating the data, so the semantic content should be unmodified.
This commit is contained in:
16
metrics/format_json.py
Normal file
16
metrics/format_json.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
||||
data = json.load(sys.stdin)
|
||||
sep = "{\n"
|
||||
for font in sorted(data):
|
||||
sys.stdout.write(sep + json.dumps(font))
|
||||
sep = ": {\n "
|
||||
for glyph in sorted(data[font], key=int):
|
||||
sys.stdout.write(sep + json.dumps(glyph) + ": ")
|
||||
sys.stdout.write(json.dumps(data[font][glyph], sort_keys=True))
|
||||
sep = ",\n "
|
||||
sep = "\n},\n"
|
||||
sys.stdout.write("\n}}\n");
|
Reference in New Issue
Block a user