Files
KaTeX/dockers/MathJaxFonts/copy_fonts.sh
Emily Eisenberg 10e9b4ec12 Add the ability to add woff2 files to the docker
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
2014-10-05 22:52:40 -07:00

48 lines
1002 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [ -z "$1" ]; then
echo "Usage: $(basename $0) <docker name>"
echo " If you followed the README, the docker name would be 'mjf'"
exit 1
else
DOCKER_NAME="$1"
fi
mkdir fonts
used_fonts=(
KaTeX_AMS-Regular
KaTeX_Caligraphic-Bold
KaTeX_Caligraphic-Regular
KaTeX_Fraktur-Bold
KaTeX_Fraktur-Regular
KaTeX_Main-Bold
KaTeX_Main-Italic
KaTeX_Main-Regular
KaTeX_Math-BoldItalic
KaTeX_Math-Italic
KaTeX_Math-Regular
KaTeX_SansSerif-Bold
KaTeX_SansSerif-Italic
KaTeX_SansSerif-Regular
KaTeX_Script-Regular
KaTeX_Size1-Regular
KaTeX_Size2-Regular
KaTeX_Size3-Regular
KaTeX_Size4-Regular
KaTeX_Typewriter-Regular
)
for filetype in ttf eot woff woff2; do
echo "Copying $filetype"
docker cp "$DOCKER_NAME":/MathJax-dev/fonts/OTF/TeX/"$filetype" fonts
for font in ${used_fonts[*]}; do
mv fonts/"$filetype"/"$font"* fonts/
done
rm -rf fonts/"$filetype"
done