MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_find_ttc

Function test_find_ttc

lib/matplotlib/tests/test_font_manager.py:133–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131
132
133def 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
152def test_find_noto():

Callers

nothing calls this directly

Calls 6

FontPropertiesClass · 0.90
get_fontFunction · 0.90
PathClass · 0.85
subplotsMethod · 0.45
textMethod · 0.45
savefigMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…