@@ -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