8000 Remove call to nonexistent FT2Font.get_fontsize. · matplotlib/matplotlib@3565822 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3565822

Browse files
committed
Remove call to nonexistent FT2Font.get_fontsize.
1 parent 4ed9996 commit 3565822

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -469,14 +469,9 @@ def ttfFontProperty(font):
469469
# Length value is an absolute font size, e.g., 12pt
470470
# Percentage values are in 'em's. Most robust specification.
471471

472-
# !!!! Incomplete
473-
if font.scalable:
474-
size = 'scalable'
475-
else:
476-
size = str(float(font.get_fontsize()))
477-
478-
# !!!! Incomplete
479-
size_adjust = None
472+
if not font.scalable:
473+
raise NotImplementedError("Non-scalable fonts are not supported")
474+
size = 'scalable'
480475

481476
return FontEntry(font.fname, name, style, variant, weight, stretch, size)
482477

@@ -538,9 +533,6 @@ def afmFontProperty(fontpath, font):
538533

539534
size = 'scalable'
540535

541-
# !!!! Incomplete
542-
size_adjust = None
543-
544536
return FontEntry(fontpath, name, style, variant, weight, stretch, size)
545537

546538

@@ -592,7 +584,7 @@ def createFontList(fontfiles, fontext='ttf'):
592584
continue
593585
try:
594586
prop = ttfFontProperty(font)
595-
except (KeyError, RuntimeError, ValueError):
587+
except (KeyError, RuntimeError, ValueError, NotImplementedError):
596588
continue
597589

598590
fontlist.append(prop)

0 commit comments

Comments
 (0)
0