
Summary: Upon switching over from ttf metrics to TeX metrics, we lost metrics for a couple of the characters that are dynamically generated by TeX. Thus TeX doesn't have metrics for them, but our fonts do have the characters because the MathJax scripts also dynamically build them. This adds the ability to extract metrics from the generated font files so that we can use the generated characters correctly. A better solution would be to dynamically generate the characters ourselves, but that is much harder, and will be left to a future time. Test Plan: - Make sure typing "\neq \cong \text{ }" produces no warnings in the console. - Make sure huxley screenshots look the same Reviewers: alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D13107
710 B
710 B
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 JSON module for perl. You can install this either from CPAN or with your package manager.
-
You need the python fontforge module. This is probably either installed with fontforge or can be installed from your package manager.
Once you have these things, run
make metrics
which should generate new metrics and place them into fontMetrics.js
. You're
done!