Skip to content

Commit 319eb3b

Browse files
committed
Remove unused fontsize argument from private mathtext _get_info.
1 parent a30b461 commit 319eb3b

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ def _get_offset(self, font, glyph, fontsize, dpi):
218218

219219
# The return value of _get_info is cached per-instance.
220220
def _get_info(self, fontname, font_class, sym, fontsize, dpi):
221-
font, num, slanted = self._get_glyph(
222-
fontname, font_class, sym, fontsize)
221+
font, num, slanted = self._get_glyph(fontname, font_class, sym)
223222
font.set_size(fontsize, dpi)
224223
glyph = font.load_char(
225224
num, flags=self.mathtext_backend.get_hinting_type())
@@ -307,7 +306,7 @@ def __init__(self, *args, **kwargs):
307306

308307
_slanted_symbols = set(r"\int \oint".split())
309308

310-
def _get_glyph(self, fontname, font_class, sym, fontsize):
309+
def _get_glyph(self, fontname, font_class, sym):
311310
font = None
312311
if fontname in self.fontmap and sym in latex_to_bakoma:
313312
basename, num = latex_to_bakoma[sym]
@@ -321,8 +320,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):
321320
if font is not None and font.get_char_index(num) != 0:
322321
return font, num, slanted
323322
else:
324-
return self._stix_fallback._get_glyph(
325-
fontname, font_class, sym, fontsize)
323+
return self._stix_fallback._get_glyph(fontname, font_class, sym)
326324

327325
# The Bakoma fonts contain many pre-sized alternatives for the
328326
# delimiters. The AutoSizedChar class will use these alternatives
@@ -435,7 +433,7 @@ def __init__(self, *args, **kwargs):
435433
def _map_virtual_font(self, fontname, font_class, uniindex):
436434
return fontname, uniindex
437435

438-
def _get_glyph(self, fontname, font_class, sym, fontsize):
436+
def _get_glyph(self, fontname, font_class, sym):
439437
try:
440438
uniindex = get_unicode_index(sym)
441439
found_symbol = True
@@ -477,8 +475,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):
477475
and isinstance(self._fallback_font, StixFonts)):
478476
fontname = 'rm'
479477

480-
g = self._fallback_font._get_glyph(fontname, font_class,
481-
sym, fontsize)
478+
g = self._fallback_font._get_glyph(fontname, font_class, sym)
482479
family = g[0].family_name
483480
if family in list(BakomaFonts._fontmap.values()):
484481
family = "Computer Modern"
@@ -488,7 +485,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):
488485
else:
489486
if (fontname in ('it', 'regular')
490487
and isinstance(self, StixFonts)):
491-
return self._get_glyph('rm', font_class, sym, fontsize)
488+
return self._get_glyph('rm', font_class, sym)
492489
_log.warning("Font {!r} does not have a glyph for {!a} "
493490
"[U+{:x}], substituting with a dummy "
494491
"symbol.".format(new_fontname, sym, uniindex))
@@ -529,20 +526,20 @@ def __init__(self, *args, **kwargs):
529526
self.fontmap[key] = fullpath
530527
self.fontmap[name] = fullpath
531528

532-
def _get_glyph(self, fontname, font_class, sym, fontsize):
529+
def _get_glyph(self, fontname, font_class, sym):
533530
# Override prime symbol to use Bakoma.
534531
if sym == r'\prime':
535-
return self.bakoma._get_glyph(fontname, font_class, sym, fontsize)
532+
return self.bakoma._get_glyph(fontname, font_class, sym)
536533
else:
537534
# check whether the glyph is available in the display font
538535
uniindex = get_unicode_index(sym)
539536
font = self._get_font('ex')
540537
if font is not None:
541538
glyphindex = font.get_char_index(uniindex)
542539
if glyphindex != 0:
543-
return super()._get_glyph('ex', font_class, sym, fontsize)
540+
return super()._get_glyph('ex', font_class, sym)
544541
# otherwise return regular glyph
545-
return super()._get_glyph(fontname, font_class, sym, fontsize)
542+
return super()._get_glyph(fontname, font_class, sym)
546543

547544

548545
class DejaVuSerifFonts(DejaVuFonts):

0 commit comments

Comments
 (0)