File tree 1 file changed +27
-0
lines changed
Filter options
1 file changed +27
-0
lines changed
Original file line number Diff line number Diff line change
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.
You can’t perform that action at this time.
0 commit comments