Skip to content

Commit 1eb8013

Browse files
authored
Merge pull request #10197 from anntzer/mathtext-afm-warning
AFM fonts don't have .postscript_name, but .get_fontname().
2 parents 4f9458d + ac216a0 commit 1eb8013

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/matplotlib/mathtext.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ def _get_info (self, fontname, font_class, sym, fontsize, dpi, math=True):
11461146
num = ord(glyph)
11471147
found_symbol = True
11481148
else:
1149-
warn("No TeX to built-in Postscript mapping for '%s'" % sym,
1149+
warn("No TeX to built-in Postscript mapping for {!r}".format(sym),
11501150
MathTextWarning)
11511151

11521152
slanted = (fontname == 'it')
@@ -1156,9 +1156,8 @@ def _get_info (self, fontname, font_class, sym, fontsize, dpi, math=True):
11561156
try:
11571157
symbol_name = font.get_name_char(glyph)
11581158
except KeyError:
1159-
warn("No glyph in standard Postscript font '%s' for '%s'" %
1160-
(font.postscript_name, sym),
1161-
MathTextWarning)
1159+
warn("No glyph in standard Postscript font {!r} for {!r}"
1160+
.format(font.get_fontname(), sym), MathTextWarning)
11621161
found_symbol = False
11631162

11641163
if not found_symbol:

0 commit comments

Comments
 (0)