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