scribble-math/metrics
Kevin Barabash 1573e1eed6 Add a build step to generate extended metrics that additionally contain glyph widths
Summary:
The ability to use pre-determined character widths will benefit alternative
layout engines such as gagern's canvas layout engine.  I would also like to
experiment would using CSS transforms to absolutely position each glyph.  This
diff adds a new make rule, make extended_metrics, which generates metrics that
also containing glyph widths.

Test Plan:
- run `make extended_metrics`
- verify that fontMetricsData.js contains entries with 5 numbers instead of 4

Reviewers: emily alpert
2015-10-16 14:31:08 -07:00
..
extract_tfms.py Add a build step to generate extended metrics that additionally contain glyph widths 2015-10-16 14:31:08 -07:00
extract_ttfs.py Add a build step to generate extended metrics that additionally contain glyph widths 2015-10-16 14:31:08 -07:00
format_json.py Add a build step to generate extended metrics that additionally contain glyph widths 2015-10-16 14:31:08 -07:00
mapping.pl Adds font metrics to support font commands. 2015-07-10 21:50:04 -06:00
parse_tfm.py Adds font metrics to support font commands. 2015-07-10 21:50:04 -06:00
README.md Switch from fontforge to fonttools 2015-07-10 14:32:02 +02:00

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 like

    kpathsea version 6.2.0

  • You need the JSON module for perl. You can install this either from CPAN (possibly using the cpan command line tool) or with your package manager.

  • You need the python module fonttools. You can install this either from PyPi (using easy_install or pip) or with your package manager.

Once you have these things, run

make metrics

which should generate new metrics and place them into fontMetricsData.json. You're done!