8000 move usage to readme · matplotlib/matplotlib@c0dbdd2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c0dbdd2

Browse files
committed
move usage to readme
1 parent ed1b854 commit c0dbdd2

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

tools/README_subset.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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

tools/subset.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,4 @@ def main(argv):
377377
subset_font(font_in, font_out, subset, opts)
378378

379379
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-
393380
main(sys.argv[1:])

0 commit comments

Comments
 (0)
0