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

Skip to content

Commit 0912fc0

Browse files
aitikguptatacaswell
authored andcommitted
Use Noto font to test fallback
1 parent 75caa48 commit 0912fc0

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/matplotlib/tests/test_agg.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,12 @@ def test_chunksize_toobig_chunks(chunk_limit_setup):
355355

356356
@image_comparison(["font_fallback.png"])
357357
def test_font_fallback():
358-
fp = fm.FontProperties(family=["WenQuanYi Zen Hei"])
359-
if pathlib.Path(fm.findfont(fp)).name != "wqy-zenhei.ttc":
360-
pytest.skip("Font may be missing")
358+
fp = fm.FontProperties(family=["Noto Sans CJK JP"])
359+
name = pathlib.Path(fm.findfont(fp)).name
360+
if name not in ("NotoSansCJKsc-Regular.otf", "NotoSansCJK-Regular.ttc"):
361+
pytest.skip(f"Noto Sans CJK JP font may be missing, found: {name}")
361362

362-
plt.rc('font', family=['DejaVu Sans', 'WenQuanYi Zen Hei'], size=15)
363+
plt.rc('font', family=['DejaVu Sans', 'Noto Sans CJK JP'], size=15)
363364

364365
fig, ax = plt.subplots()
365366
ax.text(0.25, 0.475, "There are 多个汉字 in between!")

0 commit comments

Comments
 (0)