10000 Merge pull request #28217 from anntzer/dvilog · matplotlib/matplotlib@599a964 · GitHub
[go: up one dir, main page]

Skip to content

Commit 599a964

Browse files
authored
Merge pull request #28217 from anntzer/dvilog
Better group logging of font handling by texmanager.
2 parents 955432c + 444383e commit 599a964

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/matplotlib/texmanager.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,16 @@ def _get_font_preamble_and_command(cls):
134134
preambles[font_family] = cls._font_preambles[
135135
mpl.rcParams['font.family'][0].lower()]
136136
else:
137-
for font in mpl.rcParams['font.' + font_family]:
138-
if font.lower() in cls._font_preambles:
139-
preambles[font_family] = \
140-
cls._font_preambles[font.lower()]
137+
rcfonts = mpl.rcParams[f"font.{font_family}"]
138+
for i, font in enumerate(map(str.lower, rcfonts)):
139+
if font in cls._font_preambles:
140+
preambles[font_family] = cls._font_preambles[font]
141141
_log.debug(
142-
'family: %s, font: %s, info: %s',
143-
font_family, font,
144-
cls._font_preambles[font.lower()])
142+
'family: %s, package: %s, font: %s, skipped: %s',
143+
font_family, cls._font_preambles[font], rcfonts[i],
144+
', '.join(rcfonts[:i]),
145+
)
145146
break
146-
else:
147-
_log.debug('%s font is not compatible with usetex.',
148-
font)
149147
else:
150148
_log.info('No LaTeX-compatible font found for the %s font'
151149
'family in rcParams. Using default.',

0 commit comments

Comments
 (0)
0