8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7107cd commit e3e78beCopy full SHA for e3e78be
lib/matplotlib/afm.py
@@ -189,7 +189,9 @@ def _parse_char_metrics(fh):
189
ascii_d = {}
190
name_d = {}
191
for line in fh:
192
- line = line.rstrip().decode('ascii') # Convert from byte-literal
+ # We are defensively letting values be utf8. The spec requires
193
+ # ascii, but there are non-compliant fonts in circulation
194
+ line = _to_str(line.rstrip()) # Convert from byte-literal
195
if line.startswith('EndCharMetrics'):
196
return ascii_d, name_d
197
# Split the metric line into a dictionary, keyed by metric identifiers
@@ -392,7 +394,7 @@ def get_str_bbox_and_descent(self, s):
392
394
maxy = 0
393
395
left = 0
396
if not isinstance(s, six.text_type):
- s = s.decode('ascii')
397
+ s = _to_str(s)
398
for c in s:
399
if c == '\n':
400
continue
0 commit comments