8000 fixed font_manager.is_opentype_cff_font() · matplotlib/matplotlib@c71420c · GitHub
[go: up one dir, main page]

Skip to content

Commit c71420c

Browse files
authored
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.
1 parent 1572a7e commit c71420c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ def is_opentype_cff_font(filename):
13521352
if result is None:
13531353
with open(filename, 'rb') as fd:
13541354
tag = fd.read(4)
1355-
result = (tag == 'OTTO')
1355+
result = (tag == b'OTTO')
13561356
_is_opentype_cff_font_cache[filename] = result
13571357
return result
13581358
return False

0 commit comments

Comments
 (0)
0