| 131 | |
| 132 | |
| 133 | def test_find_ttc(): |
| 134 | fp = FontProperties(family=["WenQuanYi Zen Hei"]) |
| 135 | fontpath = findfont(fp) |
| 136 | if Path(fontpath).name != "wqy-zenhei.ttc": |
| 137 | pytest.skip("Font wqy-zenhei.ttc may be missing") |
| 138 | # All fonts from this collection should have loaded as well. |
| 139 | for name in ["WenQuanYi Zen Hei Mono", "WenQuanYi Zen Hei Sharp"]: |
| 140 | subfontpath = findfont(FontProperties(family=[name]), fallback_to_default=False) |
| 141 | assert subfontpath.path == fontpath.path |
| 142 | assert subfontpath.face_index != fontpath.face_index |
| 143 | subfont = get_font(subfontpath) |
| 144 | assert subfont.fname == subfontpath.path |
| 145 | assert subfont.face_index == subfontpath.face_index |
| 146 | fig, ax = plt.subplots() |
| 147 | ax.text(.5, .5, "\N{KANGXI RADICAL DRAGON}", fontproperties=fp) |
| 148 | for fmt in ["raw", "svg", "pdf", "ps"]: |
| 149 | fig.savefig(BytesIO(), format=fmt) |
| 150 | |
| 151 | |
| 152 | def test_find_noto(): |