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

Skip to content

Resolve mathtext.fontset at FontProperties creation time. #18862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,6 @@ def get_math_fontfamily(self):

The default font is :rc:`mathtext.fontset`.
"""
if self._math_fontfamily is None:
return rcParams['mathtext.fontset']
return self._math_fontfamily

def set_math_fontfamily(self, fontfamily):
Expand All @@ -921,13 +919,12 @@ def set_math_fontfamily(self, fontfamily):
.text.Text.get_math_fontfamily
"""
if fontfamily is None:
self._math_fontfamily = None
return

valid_fonts = _validators['mathtext.fontset'].valid.values()
# _check_in_list() Validates the parameter math_fontfamily as
# if it were passed to rcParams['mathtext.fontset']
_api.check_in_list(valid_fonts, math_fontfamily=fontfamily)
fontfamily = rcParams['mathtext.fontset']
else:
valid_fonts = _validators['mathtext.fontset'].valid.values()
# _check_in_list() Validates the parameter math_fontfamily as
# if it were passed to rcParams['mathtext.fontset']
_api.check_in_list(valid_fonts, math_fontfamily=fontfamily)
self._math_fontfamily = fontfamily

def copy(self):
Expand Down