Blame SOURCES/Remove-call-to-nonexistent-FT2Font.get_fontsize.patch

6ae730
From 22a27a7921d4c74fada02ed807253b178fcd8e06 Mon Sep 17 00:00:00 2001
6ae730
From: Antony Lee <anntzer.lee@gmail.com>
6ae730
Date: Thu, 16 Nov 2017 19:57:33 -0800
6ae730
Subject: [PATCH 5/5] Remove call to nonexistent FT2Font.get_fontsize.
6ae730
6ae730
Signed-off-by: John Kacur <jkacur@redhat.com>
6ae730
---
6ae730
 lib/matplotlib/font_manager.py | 17 ++++-------------
6ae730
 1 file changed, 4 insertions(+), 13 deletions(-)
6ae730
6ae730
diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py
6ae730
index 168fa9f306e9..2cabc31090bc 100644
6ae730
--- a/lib/matplotlib/font_manager.py
6ae730
+++ b/lib/matplotlib/font_manager.py
6ae730
@@ -28,7 +28,6 @@ KNOWN ISSUES
6ae730
   - font variant is untested
6ae730
   - font stretch is incomplete
6ae730
   - font size is incomplete
6ae730
-  - font size_adjust is incomplete
6ae730
   - default font algorithm needs improvement and testing
6ae730
   - setWeights function needs improvement
6ae730
   - 'light' is an invalid weight value, remove it.
6ae730
@@ -457,14 +456,9 @@ def ttfFontProperty(font):
6ae730
     #  Length value is an absolute font size, e.g. 12pt
6ae730
     #  Percentage values are in 'em's.  Most robust specification.
6ae730
 
6ae730
-    #  !!!!  Incomplete
6ae730
-    if font.scalable:
6ae730
-        size = 'scalable'
6ae730
-    else:
6ae730
-        size = str(float(font.get_fontsize()))
6ae730
-
6ae730
-    #  !!!!  Incomplete
6ae730
-    size_adjust = None
6ae730
+    if not font.scalable:
6ae730
+        raise NotImplementedError("Non-scalable fonts are not supported")
6ae730
+    size = 'scalable'
6ae730
 
6ae730
     return FontEntry(font.fname, name, style, variant, weight, stretch, size)
6ae730
 
6ae730
@@ -530,9 +524,6 @@ def afmFontProperty(fontpath, font):
6ae730
 
6ae730
     size = 'scalable'
6ae730
 
6ae730
-    # !!!!  Incomplete
6ae730
-    size_adjust = None
6ae730
-
6ae730
     return FontEntry(fontpath, name, style, variant, weight, stretch, size)
6ae730
 
6ae730
 
6ae730
@@ -581,7 +572,7 @@ def createFontList(fontfiles, fontext='ttf'):
6ae730
                 continue
6ae730
             try:
6ae730
                 prop = ttfFontProperty(font)
6ae730
-            except (KeyError, RuntimeError, ValueError):
6ae730
+            except (KeyError, RuntimeError, ValueError, NotImplementedError):
6ae730
                 continue
6ae730
 
6ae730
         fontlist.append(prop)
6ae730
-- 
6ae730
2.20.1
6ae730