|
8 | 8 | import matplotlib as mpl |
9 | 9 | from matplotlib import ft2font |
10 | 10 | from matplotlib.testing import _gen_multi_font_text |
11 | | -from matplotlib.testing.decorators import check_figures_equal |
12 | 11 | import matplotlib.font_manager as fm |
13 | 12 | import matplotlib.path as mpath |
14 | 13 | import matplotlib.pyplot as plt |
@@ -864,30 +863,6 @@ def test_fallback_smoke(fmt): |
864 | 863 | fig.savefig(io.BytesIO(), format=fmt) |
865 | 864 |
|
866 | 865 |
|
867 | | -@pytest.mark.parametrize('family_name, file_name', |
868 | | - [("WenQuanYi Zen Hei", "wqy-zenhei"), |
869 | | - ("Noto Sans CJK JP", "NotoSansCJK"), |
870 | | - ("Noto Sans TC", "NotoSansTC-Regular.otf")] |
871 | | - ) |
872 | | -@check_figures_equal(extensions=["png", "pdf", "eps", "svg"]) |
873 | | -def test_font_fallback_chinese(fig_test, fig_ref, family_name, file_name): |
874 | | - fp = fm.FontProperties(family=[family_name]) |
875 | | - if file_name not in Path(fm.findfont(fp)).name: |
876 | | - pytest.skip(f"Font {family_name} ({file_name}) is missing") |
877 | | - |
878 | | - text = ["There are", "几个汉字", "in between!"] |
879 | | - |
880 | | - plt.rcParams["font.size"] = 20 |
881 | | - test_fonts = [["DejaVu Sans", family_name]] * 3 |
882 | | - ref_fonts = [["DejaVu Sans"], [family_name], ["DejaVu Sans"]] |
883 | | - |
884 | | - for j, (txt, test_font, ref_font) in enumerate( |
885 | | - zip(text, test_fonts, ref_fonts) |
886 | | - ): |
887 | | - fig_ref.text(0.05, .85 - 0.15*j, txt, family=ref_font) |
888 | | - fig_test.text(0.05, .85 - 0.15*j, txt, family=test_font) |
889 | | - |
890 | | - |
891 | 866 | @pytest.mark.parametrize("font_list", |
892 | 867 | [['DejaVu Serif', 'DejaVu Sans'], |
893 | 868 | ['DejaVu Sans Mono']], |
|
0 commit comments