Merge pull request #323 from blaiprat/fontMetricsData_js
Generate fontMetricsData as JavaScript
This commit is contained in:
commit
1da8c8938b
2
Makefile
2
Makefile
|
@ -83,7 +83,7 @@ PERL=perl
|
||||||
PYTHON=$(shell python2 --version >/dev/null 2>&1 && echo python2 || echo python)
|
PYTHON=$(shell python2 --version >/dev/null 2>&1 && echo python2 || echo python)
|
||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
cd metrics && $(PERL) ./mapping.pl | $(PYTHON) ./extract_tfms.py | $(PYTHON) ./extract_ttfs.py | $(PYTHON) ./format_json.py > ../src/fontMetricsData.json
|
cd metrics && $(PERL) ./mapping.pl | $(PYTHON) ./extract_tfms.py | $(PYTHON) ./extract_ttfs.py | $(PYTHON) ./format_json.py > ../src/fontMetricsData.js
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build/*
|
rm -rf build/*
|
||||||
|
|
|
@ -4,7 +4,7 @@ import sys
|
||||||
import json
|
import json
|
||||||
|
|
||||||
data = json.load(sys.stdin)
|
data = json.load(sys.stdin)
|
||||||
sep = "{\n"
|
sep = "module.exports = {\n"
|
||||||
for font in sorted(data):
|
for font in sorted(data):
|
||||||
sys.stdout.write(sep + json.dumps(font))
|
sys.stdout.write(sep + json.dumps(font))
|
||||||
sep = ": {\n "
|
sep = ": {\n "
|
||||||
|
@ -13,4 +13,4 @@ for font in sorted(data):
|
||||||
sys.stdout.write(json.dumps(data[font][glyph], sort_keys=True))
|
sys.stdout.write(json.dumps(data[font][glyph], sort_keys=True))
|
||||||
sep = ",\n "
|
sep = ",\n "
|
||||||
sep = "\n},\n"
|
sep = "\n},\n"
|
||||||
sys.stdout.write("\n}}\n");
|
sys.stdout.write("\n}};\n");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
module.exports = {
|
||||||
"AMS-Regular": {
|
"AMS-Regular": {
|
||||||
"65": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
"65": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
||||||
"66": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
"66": {"depth": 0.0, "height": 0.68889, "italic": 0.0, "skew": 0.0},
|
||||||
|
@ -1748,4 +1748,4 @@
|
||||||
"2018": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
"2018": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
||||||
"2019": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
"2019": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0},
|
||||||
"8242": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0}
|
"8242": {"depth": 0.0, "height": 0.61111, "italic": 0.0, "skew": 0.0}
|
||||||
}}
|
}};
|
Loading…
Reference in New Issue
Block a user