Skip to content

Commit 66dffff

Browse files
committed
fix missing fontmap entries
fix precommit warning
1 parent d47ddcf commit 66dffff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,13 @@ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlag
787787

788788
_slanted_symbols = set(r"\int \oint".split())
789789

790+
def _get_font(self, font: str | int) -> FT2Font:
791+
# work around, since we only populate 'mathfont' in the fontmap
792+
if font not in ('default', 'general'):
793+
font = 'mathfont'
794+
795+
return super()._get_font(font)
796+
790797
def _get_glyph(self, fontname: str, font_class: str,
791798
sym: str) -> tuple[FT2Font, int, bool]:
792799
# `fontname' is one of rm cal it tt sf bf bfit default bb frak scr regular

0 commit comments

Comments
 (0)