| 438 | [("Noto Sans", "NotoSans-Regular.otf"), |
| 439 | ("FreeMono", "FreeMono.otf")]) |
| 440 | def 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') |