mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-10 13:38:39 +00:00
Summary: To complement pull request #142, add the ability to automatically generate the woff2 files from within the docker. Add a script for copying out the generated font files to make things easier. Remove the KaTeX_Greek font files as well as the KaTeX_Win ones, since we don't use them and they're oddly non-woff and non-eot specific? Test Plan: - Build a new docker from the new Dockerfile - Make sure the woff2_compress program compiles - Follow the instructions in the README to build the fonts - Make sure the fonts correctly build - Make sure the copy_fonts.sh script copies the fonts out Reviewers: alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D13637
35 lines
1.4 KiB
Docker
35 lines
1.4 KiB
Docker
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 python-fontforge ruby woff-tools || true
|
|
RUN gem install ttfunk --version 1.1.1
|
|
|
|
# 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 woff2_compress
|
|
RUN git clone "https://code.google.com/p/font-compression-reference/" woff2_compress
|
|
RUN make -C woff2_compress/woff2/
|
|
RUN mv woff2_compress/woff2/woff2_compress /usr/bin/
|
|
|
|
# Download and setup MathJax-dev
|
|
RUN git clone "https://github.com/khan/MathJax-dev.git"
|
|
RUN cp MathJax-dev/default.cfg MathJax-dev/custom.cfg
|
|
RUN make -C MathJax-dev custom.cfg.pl
|
|
|