8000 Merge pull request #9806 from anntzer/get_fontsize · matplotlib/matplotlib@813d842 · GitHub
[go: up one dir, main page]

Skip to content

Commit 813d842

Browse files
authored
Merge pull request #9806 from anntzer/get_fontsize
Remove call to nonexistent FT2Font.get_fontsize.
2 parents ff31d67 + 3437759 commit 813d842

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
- font variant is untested
3333
- font stretch is incomplete
3434
- font size is incomplete
35-
- font size_adjust is incomplete
3635
- default font algorithm needs improvement and testing
3736
- setWeights function needs improvement
3837
- 'light' is an invalid weight value, remove it.
@@ -469,14 +468,9 @@ def ttfFontProperty(font):
469468
# Length value is an absolute font size, e.g., 12pt
470469
# Percentage values are in 'em's. Most robust specification.
471470

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
471+
if not font.scalable:
472+
raise NotImplementedError("Non-scalable fonts are not supported")
473+
size = 'scalable'
480474

481475
return FontEntry(font.fname, name, style, variant, weight, stretch, size)
482476

@@ -538,9 +532,6 @@ def afmFontProperty(fontpath, font):
538532

539533
size = 'scalable'
540534

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

546537

@@ -592,7 +583,7 @@ def createFontList(fontfiles, fontext='ttf'):
592583
continue
593584
try:
594585
prop = ttfFontProperty(font)
595-
except (KeyError, RuntimeError, ValueError):
586+
except (KeyError, RuntimeError, ValueError, NotImplementedError):
596587
continue
597588

598589
fontlist.append(prop)

0 commit comments

Comments
 (0)
0