From c71420c2e3d10c7ffac91b07e357097b3edac96a Mon Sep 17 00:00:00 2001 From: deeenes Date: Sat, 9 Jul 2016 19:31:13 +0100 Subject: [PATCH] fixed font_manager.is_opentype_cff_font() `font_manager.is_opentype_cff_font()` gives false result because compares bytes to str. This won't cause trouble in Py2, but in Py3 results in calling `EmbedTTFType3`, and makes impossible to use CFF fonts. With setting the literal to type of bytes, it works fine. --- lib/matplotlib/font_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index e5a4f21dcfef..c2907cff6e9d 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -1352,7 +1352,7 @@ def is_opentype_cff_font(filename): if result is None: with open(filename, 'rb') as fd: tag = fd.read(4) - result = (tag == 'OTTO') + result = (tag == b'OTTO') _is_opentype_cff_font_cache[filename] = result return result return False