File: create_DejaVuDisplay.sh

package info (click to toggle)
matplotlib 3.10.1%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 78,352 kB
  • sloc: python: 147,118; cpp: 62,988; objc: 1,679; ansic: 1,426; javascript: 786; makefile: 104; sh: 53
file content (29 lines) | stat: -rwxr-xr-x 1,141 bytes parent folder | download | duplicates (2)
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 matplotlib. 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