From 3437759b982d90f06fe59f71a54555ca90ba775e Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 16 Nov 2017 19:57:33 -0800 Subject: [PATCH] Remove call to nonexistent FT2Font.get_fontsize. --- lib/matplotlib/font_manager.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index 70044d692bfa..bb0a056d284e 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -32,7 +32,6 @@ - font variant is untested - font stretch is incomplete - font size is incomplete - - font size_adjust is incomplete - default font algorithm needs improvement and testing - setWeights function needs improvement - 'light' is an invalid weight value, remove it. @@ -469,14 +468,9 @@ def ttfFontProperty(font): # Length value is an absolute font size, e.g., 12pt # Percentage values are in 'em's. Most robust specification. - # !!!! Incomplete - if font.scalable: - size = 'scalable' - else: - size = str(float(font.get_fontsize())) - - # !!!! Incomplete - size_adjust = None + if not font.scalable: + raise NotImplementedError("Non-scalable fonts are not supported") + size = 'scalable' return FontEntry(font.fname, name, style, variant, weight, stretch, size) @@ -538,9 +532,6 @@ def afmFontProperty(fontpath, font): size = 'scalable' - # !!!! Incomplete - size_adjust = None - return FontEntry(fontpath, name, style, variant, weight, stretch, size) @@ -592,7 +583,7 @@ def createFontList(fontfiles, fontext='ttf'): continue try: prop = ttfFontProperty(font) - except (KeyError, RuntimeError, ValueError): + except (KeyError, RuntimeError, ValueError, NotImplementedError): continue fontlist.append(prop)