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

Skip to content

Commit 30e47af

Browse files
committed
DOC: add whats new
1 parent b32cd4c commit 30e47af

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Font Fallback in Agg
2+
--------------------
3+
4+
It is now possible to specify a list of fonts families and the Agg renderer
5+
well try them in order to locate a required glyph.
6+
7+
.. plot::
8+
:caption: Demonstration of mixed English and Chinese text with font fallback.
9+
:alt: The phrase "There are 几个汉字 in between!" rendered in various fonts.
10+
:include-source: True
11+
12+
import matplotlib.pyplot as plt
13+
14+
text = "There are 几个汉字 in between!"
15+
16+
plt.rcParams["font.size"] = 20
17+
fig = plt.figure(figsize=(4.75, 1.85))
18+
fig.text(0.05, 0.85, text, family=["WenQuanYi Zen Hei"])
19+
fig.text(0.05, 0.65, text, family=["Noto Sans CJK JP"])
20+
fig.text(0.05, 0.45, text, family=["DejaVu Sans", "Noto Sans CJK JP"])
21+
fig.text(0.05, 0.25, text, family=["DejaVu Sans", "WenQuanYi Zen Hei"])
22+
23+
plt.show()
24+
25+
26+
This currently only works with the Agg backend, but support for the vector
27+
backends is planned for mpl3.7.

0 commit comments

Comments
 (0)