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

Function test_otf_font_smoke

lib/matplotlib/tests/test_backend_pdf.py:440–450  ·  view source on GitHub ↗
(family_name, file_name)

Source from the content-addressed store, hash-verified

438 [("Noto Sans", "NotoSans-Regular.otf"),
439 ("FreeMono", "FreeMono.otf")])
440def test_otf_font_smoke(family_name, file_name):
441 # checks that there's no segfault
442 fp = fm.FontProperties(family=[family_name])
443 if Path(fm.findfont(fp)).name != file_name:
444 pytest.skip(f"Font {family_name} may be missing")
445
446 plt.rc('font', family=[family_name], size=27)
447
448 fig = plt.figure()
449 fig.text(0.15, 0.475, "Привет мир!")
450 fig.savefig(io.BytesIO(), format="pdf")
451
452
453@image_comparison(["truetype-conversion.pdf"], style='mpl20')

Callers

nothing calls this directly

Calls 5

PathClass · 0.85
findfontMethod · 0.80
figureMethod · 0.80
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…