fix(fonts): update fonts dependencies (#2866)

* fix(fonts): update fonts dependencies

* chore(fonts): fix buildMetrics for Python 3

* fix(fonts): update fonts

* test: update screenshots

* docs: update reference to katex-fonts

* chore: use Python 3

* fix(fonts): update fonts

* test: update screenshots

* Use explicit path

* Command-line arguments aren't actually supported

* Small buildMetrics fixes

* Add build:{fonts,metrics} script

* Lock versions of font-related dependencies

* Install minimal texlive

* Install fontforge

Co-authored-by: Erik Demaine <edemaine@mit.edu>
This commit is contained in:
ylemkimon
2021-08-29 07:06:42 +09:00
committed by GitHub
parent 6fa1adb52e
commit ea409eaf1d
432 changed files with 40 additions and 77 deletions

View File

@@ -17,7 +17,7 @@ There are several requirements for generating the metrics used by KaTeX.
Once you have these things, run the following command from the root directory:
sh ./docker/fonts/buildMetrics.sh
sh ./dockers/fonts/buildMetrics.sh
which should generate new metrics and place them into `fontMetricsData.json`.
You're done!

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import collections
import json
@@ -74,8 +74,8 @@ def main():
families = collections.defaultdict(dict)
for family, chars in mapping.iteritems():
for char, char_data in chars.iteritems():
for family, chars in mapping.items():
for char, char_data in chars.items():
char_num = int(char)
font = char_data['font']

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from fontTools.ttLib import TTFont
import sys
@@ -76,7 +76,7 @@ def main():
chars[u"\u0020"] = None # space
chars[u"\u00a0"] = None # nbsp
for char, base_char in chars.iteritems():
for char, base_char in chars.items():
code = ord(char)
names = set(t.get(code) for t in cmap)
if not names:

2
src/metrics/format_json.py Normal file → Executable file
View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import json