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

Skip to content

Commit 9cb35ac

Browse files
aitikguptatacaswell
authored andcommitted
Try with a single fontfile
1 parent b878d2b commit 9cb35ac

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

lib/matplotlib/tests/test_agg.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,15 @@ def test_chunksize_toobig_chunks(chunk_limit_setup):
356356

357357
@image_comparison(["font_fallback.png"])
358358
def test_font_fallback():
359-
fp = fm.FontProperties(family=["Noto Sans CJK SC", "Noto Sans CJK JP"])
359+
fp = fm.FontProperties(family=["Noto Sans CJK JP"])
360360
name = pathlib.Path(fm.findfont(fp)).name
361-
if name not in ("NotoSansCJKsc-Regular.otf", "NotoSansCJK-Regular.ttc"):
362-
pytest.skip(f"Noto Sans CJK SC font may be missing, found: {name}")
361+
if name != "NotoSansCJK-Regular.ttc":
362+
pytest.skip(f"Noto Sans CJK JP font may be missing, found: {name}")
363363

364-
plt.rc('font', family=[
365-
'DejaVu Sans', 'Noto Sans CJK JP', 'Noto Sans CJK SC'
366-
], size=15)
367-
368-
fig, ax = plt.subplots()
369-
ax.text(0.25, 0.475, "There are 多个汉字 in between!")
364+
plt.rc('font', family=['DejaVu Sans', 'Noto Sans CJK JP'], size=15)
370365

371366
with warnings.catch_warnings():
372367
warnings.filterwarnings('ignore', 'findfont: Font family.*not found')
368+
fig, ax = plt.subplots()
369+
ax.text(0.25, 0.475, "There are 多个汉字 in between!")
373370
fig.canvas.draw()

0 commit comments

Comments
 (0)