Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3f8755

Browse files
committed
change other mentions to default font to DejaVu
1 parent 66f80d9 commit b3f8755

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ def findfont(self, prop, fontext='ttf', directory=None,
12451245
font is given a similarity score to the target font
12461246
properties. The first font with the highest score is
12471247
returned. If no matches below a certain threshold are found,
1248-
the default font (usually Vera Sans) is returned.
1248+
the default font (usually DejaVu Sans) is returned.
12491249
12501250
`directory`, is specified, will only return fonts from the
12511251
given directory (or subdirectory of that directory).
@@ -1254,7 +1254,7 @@ def findfont(self, prop, fontext='ttf', directory=None,
12541254
perform the O(n) nearest neighbor search.
12551255
12561256
If `fallback_to_default` is True, will fallback to the default
1257-
font family (usually "Bitstream Vera Sans" or "Helvetica") if
1257+
font family (usually "DejaVu Sans" or "Helvetica") if
12581258
the first lookup hard-fails.
12591259
12601260
See the `W3C Cascading Style Sheet, Level 1

lib/matplotlib/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def setup():
4545
# tests and are not necessarily the default values as specified in
4646
# rcsetup.py
4747
rcdefaults() # Start with all defaults
48-
rcParams['font.family'] = 'Bitstream Vera Sans'
48+
rcParams['font.family'] = 'DejaVu Sans'
4949
rcParams['text.hinting'] = False
5050
rcParams['text.hinting_factor'] = 8
5151

lib/matplotlib/tests/test_mathtext.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,19 @@ def single_test():
177177
make_set('mathtext', 'cm', math_tests)
178178
make_set('mathtext', 'stix', math_tests)
179179
make_set('mathtext', 'stixsans', math_tests)
180+
make_set('mathtext', 'dejavusans', math_tests)
181+
make_set('mathtext', 'dejavuserif', math_tests)
180182

181183
make_set('mathfont', 'cm', font_tests, ['png'])
182184
make_set('mathfont', 'stix', font_tests, ['png'])
183185
make_set('mathfont', 'stixsans', font_tests, ['png'])
186+
make_set('mathfont', 'dejavusans', font_tests, ['png'])
187+
make_set('mathfont', 'dejavuserif', font_tests, ['png'])
184188

185189
def test_fontinfo():
186190
import matplotlib.font_manager as font_manager
187191
import matplotlib.ft2font as ft2font
188-
fontpath = font_manager.findfont("Bitstream Vera Sans")
192+
fontpath = font_manager.findfont("DejaVu Sans")
189193
font = ft2font.FT2Font(fontpath)
190194
table = font.get_sfnt_table("head")
191195
assert table['version'] == (1, 0)

matplotlibrc.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ backend : %(backend)s
149149
# relative to font.size, using the following values: xx-small, x-small,
150150
# small, medium, large, x-large, xx-large, larger, or smaller
151151
#font.size : 12.0
152-
#font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
153-
#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
152+
#font.serif : DejaVu Serif, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
153+
#font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
154154
#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
155155
#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, Humor Sans, fantasy
156-
#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
156+
#font.monospace : DejaVu Sans Mono, Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
157157

158158
### TEXT
159159
# text properties used by text.Text. See

0 commit comments

Comments
 (0)