Generate fontMetricsData as JavaScript
This commit is contained in:
parent
b2d2df9bef
commit
8cd71830c2
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 "
|
||||||
|
|
|
@ -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},
|
Loading…
Reference in New Issue
Block a user