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

Skip to content

Commit 76a51fb

Browse files
committed
Fix a few bugs when mathtext.default is 'regular'
svn path=/trunk/matplotlib/; revision=6954
1 parent 906eaec commit 76a51fb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/matplotlib/mathtext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):
843843
return self.cm_fallback._get_glyph(
844844
fontname, 'it', sym, fontsize)
845845
else:
846-
if fontname == 'it' and isinstance(self, StixFonts):
846+
if fontname in ('it', 'regular') and isinstance(self, StixFonts):
847847
return self._get_glyph('rm', font_class, sym, fontsize)
848848
warn("Font '%s' does not have a glyph for '%s'" %
849849
(fontname, sym.encode('ascii', 'backslashreplace')),
@@ -916,7 +916,7 @@ def _map_virtual_font(self, fontname, font_class, uniindex):
916916

917917
if mapping is not None:
918918
if isinstance(mapping, dict):
919-
mapping = mapping[font_class]
919+
mapping = mapping.get(font_class, 'rm')
920920

921921
# Binary search for the source glyph
922922
lo = 0

0 commit comments

Comments
 (0)