mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-12 22:48:41 +00:00
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
This commit is contained in:
44
dockers/MathJaxFonts/Dockerfile
Normal file
44
dockers/MathJaxFonts/Dockerfile
Normal file
@@ -0,0 +1,44 @@
|
||||
FROM ubuntu:14.04
|
||||
MAINTAINER xymostech <xymostech@gmail.com>
|
||||
|
||||
# Install things
|
||||
RUN apt-get -qq update
|
||||
RUN apt-get -qqy install git dvipng default-jre default-jdk texlive wget fontforge mftrace fonttools optipng advancecomp man-db build-essential unzip zlib1g-dev || true
|
||||
|
||||
# Download yuicompressor
|
||||
RUN mkdir /usr/share/yui-compressor/
|
||||
RUN wget "https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar" -O /usr/share/yui-compressor/yui-compressor.jar
|
||||
|
||||
# Download batik-ttf2svg.jar
|
||||
RUN wget "http://supergsego.com/apache/xmlgraphics/batik/batik-1.7.zip"
|
||||
RUN unzip -qq batik-1.7.zip
|
||||
RUN mv batik-1.7/batik-ttf2svg.jar /usr/share/java/
|
||||
|
||||
# Download and compile ttf2eof (note we add a patch to make it compile)
|
||||
RUN wget "https://ttf2eot.googlecode.com/files/ttf2eot-0.0.2-2.tar.gz"
|
||||
RUN tar -xzf ttf2eot-0.0.2-2.tar.gz
|
||||
RUN sed -i "1s/^/#include <cstddef>/" ttf2eot-0.0.2-2/OpenTypeUtilities.h
|
||||
RUN make -C ttf2eot-0.0.2-2/
|
||||
RUN mv ttf2eot-0.0.2-2/ttf2eot /usr/bin/
|
||||
|
||||
# Download and compile sfnt2woff
|
||||
RUN wget "http://people.mozilla.org/~jkew/woff/woff-code-latest.zip"
|
||||
RUN unzip -d sfnt2woff woff-code-latest.zip
|
||||
RUN make -C sfnt2woff
|
||||
RUN mv sfnt2woff/sfnt2woff /usr/bin/
|
||||
|
||||
# Add a symlink so MathJax can find the TeX fonts
|
||||
RUN ln -s /usr/share/texlive/texmf-dist /usr/share/
|
||||
|
||||
# Download and setup MathJax-dev
|
||||
RUN git clone "https://github.com/mathjax/MathJax-dev.git"
|
||||
RUN cp MathJax-dev/default.cfg MathJax-dev/custom.cfg
|
||||
RUN make -C MathJax-dev custom.cfg.pl
|
||||
|
||||
# Fix for a new version of ttx
|
||||
RUN sed -i "s/Space.otf/Space.ttf/" MathJax-dev/fonts/OTF/TeX/makeFF
|
||||
|
||||
# Change the names of the generated fonts and font files to KaTeX
|
||||
RUN sed -i "s/MathJax/KaTeX/g" MathJax-dev/fonts/OTF/TeX/makeFF
|
||||
RUN sed -i "s/MathJax/KaTeX/g" MathJax-dev/fonts/OTF/TeX/Makefile
|
||||
|
Reference in New Issue
Block a user