mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-20 18:18:38 +00:00
* 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>
How to generate new metrics
There are several requirements for generating the metrics used by KaTeX.
-
You need to have an installation of TeX which supports kpathsea. You can check this by running
tex --version
, and seeing if it has a line that looks likekpathsea version 6.2.0
-
You need the Perl module
JSON
. You can install this either from CPAN (e.g. using thecpan
command line tool:cpan install JSON
) or with your package manager. -
You need the Python module
fonttools
. You can install this either from PyPI (usingeasy_install
orpip
:pip install fonttools
) or with your package manager.
Once you have these things, run the following command from the root directory:
sh ./dockers/fonts/buildMetrics.sh
which should generate new metrics and place them into fontMetricsData.json
.
You're done!