()
| 389 | |
| 390 | @pytest.mark.skipif(sys.platform == 'win32', reason='Linux or OS only') |
| 391 | def test_get_font_names(): |
| 392 | paths_mpl = [cbook._get_data_path('fonts', subdir) for subdir in ['ttf']] |
| 393 | fonts_mpl = findSystemFonts(paths_mpl, fontext='ttf') |
| 394 | fonts_system = findSystemFonts(fontext='ttf') |
| 395 | ttf_fonts = set() |
| 396 | for path in fonts_mpl + fonts_system: |
| 397 | try: |
| 398 | font = ft2font.FT2Font(path) |
| 399 | prop = ttfFontProperty(font) |
| 400 | ttf_fonts.add(prop.name) |
| 401 | for face_index in range(1, font.num_faces): |
| 402 | font = ft2font.FT2Font(path, face_index=face_index) |
| 403 | prop = ttfFontProperty(font) |
| 404 | ttf_fonts.add(prop.name) |
| 405 | except Exception: |
| 406 | pass |
| 407 | # fontManager may contain additional entries for alternative family names |
| 408 | # (e.g. typographic family, platform-specific Name ID 1) registered by |
| 409 | # addfont(), so primary names must be a subset of the manager's names. |
| 410 | assert ttf_fonts <= set(fontManager.get_font_names()) |
| 411 | |
| 412 | |
| 413 | def test_addfont_alternative_names(tmp_path): |
nothing calls this directly
no test coverage detected
searching dependent graphs…