-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move subset.py and add script to create DejaVuDisplay
- Loading branch information
Showing
4 changed files
with
31 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters