Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 30e47af

Browse filesBrowse files
committed
DOC: add whats new
1 parent b32cd4c commit 30e47af
Copy full SHA for 30e47af

File tree

1 file changed

+27
-0
lines changed
Filter options

1 file changed

+27
-0
lines changed
+27Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.