Files
KaTeX/dockers/MathJaxFonts/README.md
Emily Eisenberg ad97dab19c Update fonts from MathJax
Summary:
Also, rename all of our uses of fonts to use the uppercased versions. We want to
use the uppercase versions because it makes updating and modifying the fonts
much easier (since the font names inside the actual font files are uppercased).

Test Plan:
  - Make sure the huxley screenshots look good (You can compare a diff of them
    on github at
    f90d093361
    By my eye, it seems like some things have moved up ~1/2 pixel, and some of
    the fonts have maybe slightly changed shape, like the large `b` in
    SizingBaseline)

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D11979
2014-08-06 17:52:26 -07:00

2.0 KiB

How to generate MathJax fonts


It's really simple (now)! Just make a docker image from the included Dockerfile using a command like

sudo docker build --tag=mathjaxfonts .

from within this directory (note you need to have docker installed and running for this to work). This will build a docker image with the mathjaxfonts tag, which you can then use to run dockers based on them. Then, run a mathjaxfonts docker with

sudo docker run --interactive --tty mathjaxfonts --name mjf /bin/bash

We name this docker "mjf" so we can reference it later when we want to copy the files off. (If you get an error about the name being in use, perhaps because you are trying to create another docker, you can either delete the old docker with

sudo docker rm mjf

or use a different name.) This will get you into the docker in the root directory. From there, cd into the /MathJax-dev/fonts/OTF/TeX directory, and run

make ttf eot woff

to build all of the fonts that we need. Finally, leave the docker and copy all the files off with

docker cp mjf:/MathJax-dev/fonts/OTF/TeX/ttf ./ docker cp mjf:/MathJax-dev/fonts/OTF/TeX/eot ./ docker cp mjf:/MathJax-dev/fonts/OTF/TeX/woff ./

(note we're using mjf: to specify the name of the docker we created above) Compile the fonts into a single directory

mv {ttf,eot,woff}/* ./

Remove the WinIE6 and WinChrome fonts

rm KaTeX_Win*

And you're good to go! Don't forget to update the font metrics with the metric_parse.rb script once you're done.

General Docker Help


When you quit the docker, it will stop the docker from running. If you want to reattach to the docker, you can start it again with

sudo docker start mjf

and then attach with

sudo docker attach mjf

Alternatively, if you want to detach from the docker when you're done instead of quitting and stopping it, you can detach with C-p C-q, and then re-attach with

sudo docker attach mjf

To see a list of your current dockers, you can run

docker ps