Skip to content

Commit 78d80c0

Browse files
committed
fix slanted detection for cm fonts
1 parent 29c63c2 commit 78d80c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,13 @@ def _get_glyph(self, fontname: str, font_class: str,
488488
slanted = (basename in ("cmmi10", "cmti10")) or sym in self._slanted_symbols
489489
font = self._get_font(basename)
490490
elif len(sym) == 1:
491+
slanted = (fontname in ("it", "normal"))
491492
if fontname == "normal" and sym.isdigit():
492493
# use digits from cmr (roman alphabet) instead of cmm (math alphabet),
493494
# same as LaTeX does.
494495
# This was previously mapped via `latex_to_bakoma`.
495496
fontname = "rm"
496-
slanted = (fontname == "it")
497+
slanted = False
497498
font = self._get_font(fontname)
498499
if font is not None:
499500
num = ord(sym)

0 commit comments

Comments
 (0)