File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change
1
+ Subsetting DejaVu fonts to create a display-math-only font
2
+ ----------------------------------------------------------
3
+
4
+ The DejaVu fonts include math display variants outside of the unicode range, and
5
+ it is currently hard to access them from matploltib. The subset.py script in
6
+ ` tools ` has been modified to move the math display variants found in DejaVu
7
+ fonts into a new TTF font with these variants in the unicode range.
8
+
9
+ To use it, you need to install the fontforge python bindings. The DejaVu fonts
10
+ are in the lib/matplotlib/mpl-data/fonts/ttf directory in the matplotlib tree.
11
+ From that directory, run the subset.py script as follows to generate the new
12
+ font files ` DejaVuSansDisplay.ttf ` and ` DejaVuSerifDisplay.ttf ` :
13
+
14
+ $ python ../../../../../tools/subset.py --move-display --subset=dejavu-ext DejaVuSans.ttf DejaVuSansDisplay.ttf
15
+ $ python ../../../../../tools/subset.py --move-display --subset=dejavu-ext DejaVuSerif.ttf DejaVuSerifDisplay.ttf
Original file line number Diff line number Diff line change @@ -377,17 +377,4 @@ def main(argv):
377
377
subset_font (font_in , font_out , subset , opts )
378
378
379
379
if __name__ == '__main__' :
380
- if len (sys .argv [1 :]) == 0 or sys .argv [1 ] == '-h' :
381
- print ('''A script for subsetting a TTF font.
382
-
383
- This version has been modified to move the math display variants found in DejaVu
384
- fonts into a new TTF font with these variants in the unicode range. In the
385
- matplotlib tree, these fonts are in lib/matplotlib/mpl-data/fonts/ttf. To
386
- generate these fonts, move into this directory, and run:
387
-
388
- $ python ../../../../../tools/subset.py --move-display --subset=dejavu-ext DejaVuSans.ttf DejaVuSansDisplay.ttf
389
- $ python ../../../../../tools/subset.py --move-display --subset=dejavu-ext DejaVuSerif.ttf DejaVuSerifDisplay.ttf
390
- ''' )
391
- sys .exit (1 )
392
-
393
380
main (sys .argv [1 :])
You can’t perform that action at this time.
0 commit comments