forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_DejaVuDisplay.sh
executable file
·29 lines (22 loc) · 1.11 KB
/
create_DejaVuDisplay.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Subsetting DejaVu fonts to create a display-math-only font
# The DejaVu fonts include math display variants outside of the unicode range,
# and it is currently hard to access them from matploltib. The subset.py script
# in `tools` has been modified to move the math display variants found in DejaVu
# fonts into a new TTF font with these variants in the unicode range.
# This bash script calls the subset.py scripts with the appropriate options to
# generate the new font files `DejaVuSansDisplay.ttf` and
# `DejaVuSerifDisplay.ttf`:
mpldir=$(dirname $0)/../
# test that fontforge is installed
python -c 'import fontforge' 2> /dev/null
if [ $? != 0 ]; then
echo "The python installation at $(which python) does not have fontforge"
echo "installed. Please install it before using subset.py."
exit 1
fi
FONTDIR=$mpldir/lib/matplotlib/mpl-data/fonts/ttf/
python $mpldir/tools/subset.py --move-display --subset=dejavu-ext $FONTDIR/DejaVuSans.ttf \
$FONTDIR/DejaVuSansDisplay.ttf
python $mpldir/tools/subset.py --move-display --subset=dejavu-ext $FONTDIR/DejaVuSerif.ttf \
$FONTDIR/DejaVuSerifDisplay.ttf