|
9 | 9 |
|
10 | 10 |
|
11 | 11 | from matplotlib import ( |
12 | | - collections, path, pyplot as plt, transforms as mtransforms, rcParams, |
13 | | - font_manager as fm |
14 | | -) |
| 12 | + collections, path, pyplot as plt, transforms as mtransforms, rcParams) |
| 13 | +from matplotlib.backends.backend_agg import RendererAgg |
15 | 14 | from matplotlib.image import imread |
16 | 15 | from matplotlib.figure import Figure |
17 | 16 | from matplotlib.testing.decorators import image_comparison |
@@ -255,19 +254,3 @@ def test_draw_path_collection_error_handling(): |
255 | 254 | ax.scatter([1], [1]).set_paths(path.Path([(0, 1), (2, 3)])) |
256 | 255 | with pytest.raises(TypeError): |
257 | 256 | fig.canvas.draw() |
258 | | - |
259 | | - |
260 | | -@image_comparison(["font_fallback.png"]) |
261 | | -def test_font_fallback(): |
262 | | - fp = fm.FontProperties(family=["Noto Sans CJK JP"]) |
263 | | - name = Path(fm.findfont(fp)).name |
264 | | - if name != "NotoSansCJK-Regular.ttc": |
265 | | - pytest.skip(f"Noto Sans CJK JP font may be missing, found: {name}") |
266 | | - |
267 | | - plt.rc('font', family=['DejaVu Sans', 'Noto Sans CJK JP'], size=15) |
268 | | - |
269 | | - with warnings.catch_warnings(): |
270 | | - warnings.filterwarnings('ignore', 'findfont: Font family.*not found') |
271 | | - fig, ax = plt.subplots() |
272 | | - ax.text(0.25, 0.475, "There are 多个汉字 in between!") |
273 | | - fig.canvas.draw() |
0 commit comments