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

Skip to content

Commit d8e84d2

Browse files
committed
per symbol
1 parent b7a3209 commit d8e84d2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/matplotlib/mathtext.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ def __init__(self, *args, **kwargs):
777777
else:
778778
fallback_rc = None
779779

780-
780+
781781
if fallback_rc == 'stix':
782782
self.cm_fallback = StixFonts(*args, **kwargs)
783783
elif fallback_rc == 'stixsans':
@@ -858,15 +858,17 @@ def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
858858

859859
if not found_symbol:
860860
if self.cm_fallback:
861-
_log.warning("Substituting with a symbol from {}".format(
862-
self.cm_fallback.name))
863-
864861
if (fontname in ('it', 'regular')
865862
and isinstance(self.cm_fallback, StixFonts)):
866863
fontname = 'rm'
867864

868-
return self.cm_fallback._get_glyph(
869-
fontname, font_class, sym, fontsize)
865+
g = self.cm_fallback._get_glyph(fontname, font_class, sym, fontsize)
866+
fname = g[0].family_name
867+
if fname.startswith("cm"):
868+
fname = "Computer Modern"
869+
_log.warning("Substituting with a {} from {}".format(sym, fname))
870+
# or .postscript_name
871+
return g
870872

871873
else:
872874
if (fontname in ('it', 'regular')

0 commit comments

Comments
 (0)