Skip to content

Commit

Permalink
Fix matplotlib#5998: Support fallback font correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Mar 21, 2016
1 parent c1aecd1 commit abe64db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
'rm', font_class, sym, fontsize)
else:
return self.cm_fallback._get_glyph(
fontname, 'it', sym, fontsize)
fontname, font_class, sym, fontsize)
else:
if fontname in ('it', 'regular') and isinstance(self, StixFonts):
return self._get_glyph('rm', font_class, sym, fontsize)
Expand Down Expand Up @@ -887,12 +887,12 @@ class DejaVuFonts(UnicodeFonts):

def __init__(self, *args, **kwargs):
# This must come first so the backend's owner is set correctly
TruetypeFonts.__init__(self, *args, **kwargs)
if isinstance(self, DejaVuSerifFonts):
self.cm_fallback = StixFonts(*args, **kwargs)
else:
self.cm_fallback = StixSansFonts(*args, **kwargs)
self.bakoma = BakomaFonts(*args, **kwargs)
TruetypeFonts.__init__(self, *args, **kwargs)
self.fontmap = {}
# Include Stix sized alternatives for glyphs
self._fontmap.update({
Expand Down

0 comments on commit abe64db

Please sign in to comment.