Skip to content

Commit 4a2a186

Browse files
committed
Merge pull request #5214 from zblz/dejavu-mathtext
Use DejaVu fonts as default for text and mathtext
1 parent bf51375 commit 4a2a186

File tree

650 files changed

+30203
-1360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

650 files changed

+30203
-1360
lines changed

doc/users/mathtext.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ in Donald Knuth's TeX, so the quality is quite good (matplotlib also
1313
provides a ``usetex`` option for those who do want to call out to TeX
1414
to generate their text (see :ref:`usetex-tutorial`).
1515

16-
Any text element can use math text. You should use raw strings
17-
(precede the quotes with an ``'r'``), and surround the math text with
18-
dollar signs ($), as in TeX. Regular text and mathtext can be
19-
interleaved within the same string. Mathtext can use the Computer
20-
Modern fonts (from (La)TeX), `STIX <http://www.aip.org/stixfonts/>`_
21-
fonts (with are designed to blend well with Times) or a Unicode font
22-
that you provide. The mathtext font can be selected with the
23-
customization variable ``mathtext.fontset`` (see
16+
Any text element can use math text. You should use raw strings (precede the
17+
quotes with an ``'r'``), and surround the math text with dollar signs ($), as in
18+
TeX. Regular text and mathtext can be interleaved within the same string.
19+
Mathtext can use DejaVu Sans (default), DejaVu Serif, the Computer Modern fonts
20+
(from (La)TeX), `STIX <http://www.aip.org/stixfonts/>`_ fonts (with are designed
21+
to blend well with Times), or a Unicode font that you provide. The mathtext
22+
font can be selected with the customization variable ``mathtext.fontset`` (see
2423
:ref:`customizing-matplotlib`)
2524

2625
.. note::

doc/users/plotting/colormaps/Lfunction.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@
1414

1515

1616
mpl.rcParams.update({'font.size': 12})
17-
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans, '
18-
'Lucida Grande, Verdana, Geneva, Lucid, '
19-
'Helvetica, Avant Garde, sans-serif')
20-
mpl.rcParams['mathtext.fontset'] = 'custom'
21-
mpl.rcParams['mathtext.cal'] = 'cursive'
22-
mpl.rcParams['mathtext.rm'] = 'sans'
23-
mpl.rcParams['mathtext.tt'] = 'monospace'
24-
mpl.rcParams['mathtext.it'] = 'sans:italic'
25-
mpl.rcParams['mathtext.bf'] = 'sans:bold'
26-
mpl.rcParams['mathtext.sf'] = 'sans'
27-
mpl.rcParams['mathtext.fallback_to_cm'] = 'True'
2817

2918

3019
### Red, original Albers plot

doc/users/plotting/colormaps/grayscale.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,6 @@
1616
import matplotlib as mpl
1717

1818
mpl.rcParams.update({'font.size': 14})
19-
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans, '
20-
'Lucida Grande, Verdana, Geneva, Lucid, '
21-
'Helvetica, Avant Garde, sans-serif')
22-
mpl.rcParams['mathtext.fontset'] = 'custom'
23-
mpl.rcParams['mathtext.cal'] = 'cursive'
24-
mpl.rcParams['mathtext.rm'] = 'sans'
25-
mpl.rcParams['mathtext.tt'] = 'monospace'
26-
mpl.rcParams['mathtext.it'] = 'sans:italic'
27-
mpl.rcParams['mathtext.bf'] = 'sans:bold'
28-
mpl.rcParams['mathtext.sf'] = 'sans'
29-
mpl.rcParams['mathtext.fallback_to_cm'] = 'True'
3019

3120

3221
# indices to step through colormap

doc/users/plotting/colormaps/lightness.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,6 @@
1616
import matplotlib as mpl
1717

1818
mpl.rcParams.update({'font.size': 12})
19-
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans, '
20-
'Lucida Grande, Verdana, Geneva, Lucid, '
21-
'Helvetica, Avant Garde, sans-serif')
22-
mpl.rcParams['mathtext.fontset'] = 'custom'
23-
mpl.rcParams['mathtext.cal'] = 'cursive'
24-
mpl.rcParams['mathtext.rm'] = 'sans'
25-
mpl.rcParams['mathtext.tt'] = 'monospace'
26-
mpl.rcParams['mathtext.it'] = 'sans:italic'
27-
mpl.rcParams['mathtext.bf'] = 'sans:bold'
28-
mpl.rcParams['mathtext.sf'] = 'sans'
29-
mpl.rcParams['mathtext.fallback_to_cm'] = 'True'
3019

3120
# indices to step through colormap
3221
x = np.linspace(0.0, 1.0, 100)

doc/users/screenshots.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ Mathtext_examples
253253
Below is a sampling of the many TeX expressions now supported by matplotlib's
254254
internal mathtext engine. The mathtext module provides TeX style mathematical
255255
expressions using `FreeType <http://www.freetype.org/>`_
256-
and the BaKoMa computer modern or `STIX <http://www.stixfonts.org>`_ fonts.
257-
See the :mod:`matplotlib.mathtext` module for additional details.
256+
and the DejaVu, BaKoMa computer modern, or `STIX <http://www.stixfonts.org>`_
257+
fonts. See the :mod:`matplotlib.mathtext` module for additional details.
258258

259259
.. plot:: mpl_examples/pylab_examples/mathtext_examples.py
260260

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Change in default font
2+
----------------------
3+
4+
The default font used by matplotlib in text has been changed to DejaVu Sans and
5+
DejaVu Serif for the sans-serif and serif families, respectively. The DejaVu
6+
font family is based on the previous matplotlib default --Bitstream Vera-- but
7+
includes a much wider range of characters.
8+
9+
The default mathtext font has been changed from Computer Modern to the DejaVu
10+
family to maintain consistency with regular text. Two new options for the
11+
``mathtext.fontset`` configuration parameter have been added: ``dejavusans``
12+
(default) and ``dejavuserif``. Both of these options use DejaVu glyphs whenever
13+
possible and fall back to STIX symbols when a glyph is not found in DejaVu. To
14+
return to the previous behavior, set the rcParam ``mathtext.fontset`` to ``cm``.

examples/api/font_family_rc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
and for the font.family you set a list of font styles to try to find
1212
in order::
1313
14-
rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans',
14+
rcParams['font.sans-serif'] = ['Tahoma', 'DejaVu Sans',
1515
'Lucida Grande', 'Verdana']
1616
1717
"""

examples/misc/font_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
#fname = '/usr/share/fonts/sfd/FreeSans.ttf'
12-
fname = matplotlib.get_data_path() + '/fonts/ttf/Vera.ttf'
12+
fname = matplotlib.get_data_path() + '/fonts/ttf/DejaVuSans.ttf'
1313
font = FT2Font(fname)
1414
font.set_charmap(0)
1515

examples/misc/ftface_props.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
#fname = '/usr/local/share/matplotlib/VeraIt.ttf'
15-
fname = matplotlib.get_data_path() + '/fonts/ttf/VeraIt.ttf'
15+
fname = matplotlib.get_data_path() + '/fonts/ttf/DejaVuSans-Oblique.ttf'
1616
#fname = '/usr/local/share/matplotlib/cmr10.ttf'
1717

1818
font = ft.FT2Font(fname)

examples/pylab_examples/font_table_ttf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
fontname = sys.argv[1]
3030
else:
3131
fontname = os.path.join(matplotlib.get_data_path(),
32-
'fonts', 'ttf', 'Vera.ttf')
32+
'fonts', 'ttf', 'DejaVuSans.ttf')
3333

3434
font = FT2Font(fontname)
3535
codes = list(font.get_charmap().items())

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy