mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-11 22:18:41 +00:00
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:
@@ -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!
|
||||
|
@@ -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']
|
||||
|
@@ -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
2
src/metrics/format_json.py
Normal file → Executable file
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
Reference in New Issue
Block a user