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

Skip to content

Commit abe64db

Browse files
committed
Fix #5998: Support fallback font correctly
1 parent c1aecd1 commit abe64db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/mathtext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
855855
'rm', font_class, sym, fontsize)
856856
else:
857857
return self.cm_fallback._get_glyph(
858-
fontname, 'it', sym, fontsize)
858+
fontname, font_class, sym, fontsize)
859859
else:
860860
if fontname in ('it', 'regular') and isinstance(self, StixFonts):
861861
return self._get_glyph('rm', font_class, sym, fontsize)
@@ -887,12 +887,12 @@ class DejaVuFonts(UnicodeFonts):
887887

888888
def __init__(self, *args, **kwargs):
889889
# This must come first so the backend's owner is set correctly
890+
TruetypeFonts.__init__(self, *args, **kwargs)
890891
if isinstance(self, DejaVuSerifFonts):
891892
self.cm_fallback = StixFonts(*args, **kwargs)
892893
else:
893894
self.cm_fallback = StixSansFonts(*args, **kwargs)
894895
self.bakoma = BakomaFonts(*args, **kwargs)
895-
TruetypeFonts.__init__(self, *args, **kwargs)
896896
self.fontmap = {}
897897
# Include Stix sized alternatives for glyphs
898898
self._fontmap.update({

0 commit comments

Comments
 (0)