10000 Better group logging of font handling by texmanager. by anntzer · Pull Request #28217 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Better group logging of font handling by texmanager. #28217

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
May 14, 2024
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
18 changes: 8 additions & 10 deletions lib/matplotlib/texmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,16 @@ def _get_font_preamble_and_command(cls):
preambles[font_family] = cls._font_preambles[
mpl.rcParams['font.family'][0].lower()]
else:
for font in mpl.rcParams['font.' + font_family]:
if font.lower() in cls._font_preambles:
preambles[font_family] = \
cls._font_preambles[font.lower()]
rcfonts = mpl.rcParams[f"font.{font_family}"]
for i, font in enumerate(map(str.lower, rcfonts)):
if font in cls._font_preambles:
preambles[font_family] = cls._font_preambles[font]
_log.debug(
'family: %s, font: %s, info: %s',
font_family, font,
cls._font_preambles[font.lower()])
'family: %s, package: %s, font: %s, skipped: %s',
font_family, cls._font_preambles[font], rcfonts[i],
', '.join(rcfonts[:i]),
)
break
else:
_log.debug('%s font is not compatible with usetex.',
font)
else:
_log.info('No LaTeX-compatible font found for the %s font'
'family in rcParams. Using default.',
Expand Down
Loading
0