Skip to content

Commit f712a99

Browse files
authored
Merge pull request #18862 from anntzer/eagermath
Resolve mathtext.fontset at FontProperties creation time.
2 parents 61aec6e + 38003c0 commit f712a99

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

lib/matplotlib/font_manager.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,6 @@ def get_math_fontfamily(self):
891891
892892
The default font is :rc:`mathtext.fontset`.
893893
"""
894-
if self._math_fontfamily is None:
895-
return rcParams['mathtext.fontset']
896894
return self._math_fontfamily
897895

898896
def set_math_fontfamily(self, fontfamily):
@@ -915,13 +913,12 @@ def set_math_fontfamily(self, fontfamily):
915913
.text.Text.get_math_fontfamily
916914
"""
917915
if fontfamily is None:
918-
self._math_fontfamily = None
919-
return
920-
921-
valid_fonts = _validators['mathtext.fontset'].valid.values()
922-
# _check_in_list() Validates the parameter math_fontfamily as
923-
# if it were passed to rcParams['mathtext.fontset']
924-
_api.check_in_list(valid_fonts, math_fontfamily=fontfamily)
916+
fontfamily = rcParams['mathtext.fontset']
917+
else:
918+
valid_fonts = _validators['mathtext.fontset'].valid.values()
919+
# _check_in_list() Validates the parameter math_fontfamily as
920+
# if it were passed to rcParams['mathtext.fontset']
921+
_api.check_in_list(valid_fonts, math_fontfamily=fontfamily)
925922
self._math_fontfamily = fontfamily
926923

927924
def copy(self):

0 commit comments

Comments
 (0)