Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3b6c4e

Browse files
authored
Merge pull request #6898 from zblz/afm-bytes
Fix read mode when loading cached AFM fonts
2 parents 0e1c687 + c766846 commit f3b6c4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/mathtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ def _get_font(self, font):
11191119
cached_font = self.fonts.get(basename)
11201120
if cached_font is None:
11211121
fname = os.path.join(self.basepath, basename + ".afm")
1122-
with open(fname, 'r') as fd:
1122+
with open(fname, 'rb') as fd:
11231123
cached_font = AFM(fd)
11241124
cached_font.fname = fname
11251125
self.fonts[basename] = cached_font

0 commit comments

Comments
 (0)