Skip to content

Commit eaf373f

Browse files
committed
Add multi-font tests for PDF backend
1 parent 742366b commit eaf373f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,21 @@ def test_glyphs_subset():
368368

369369
# since both objects are assigned same characters
370370
assert subfont.get_num_glyphs() == nosubfont.get_num_glyphs()
371+
372+
373+
@image_comparison(["multi_font_type3.pdf"])
374+
def test_multi_font_type3():
375+
plt.rc('font', family=['DejaVu Sans', 'WenQuanYi Zen Hei'], size=27)
376+
plt.rc('pdf', fonttype=3)
377+
378+
fig = plt.figure()
379+
fig.text(0.15, 0.475, "There are 多个汉字 in between!")
380+
381+
382+
@image_comparison(["multi_font_type42.pdf"])
383+
def test_multi_font_type42():
384+
plt.rc('font', family=['DejaVu Sans', 'WenQuanYi Zen Hei'], size=27)
385+
plt.rc('pdf', fonttype=42)
386+
387+
fig = plt.figure()
388+
fig.text(0.15, 0.475, "There are 多个汉字 in between!")

0 commit comments

Comments
 (0)