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

Skip to content

Commit 8f3f410

Browse files
committed
Small bugfix for _findfont_cached
1 parent 778de1f commit 8f3f410

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,10 +1305,6 @@ def findfont(self, prop, fontext='ttf', directory=None,
13051305
rc_params = tuple(tuple(rcParams[key]) for key in [
13061306
"font.serif", "font.sans-serif", "font.cursive", "font.fantasy",
13071307
"font.monospace"])
1308-
1309-
if not isinstance(prop, FontProperties):
1310-
prop = FontProperties._from_any(prop)
1311-
13121308
return self._findfont_cached(
13131309
prop, fontext, directory, fallback_to_default, rebuild_if_missing,
13141310
rc_params)
@@ -1411,6 +1407,8 @@ def find_fontsprop(self, prop, fontext='ttf', directory=None,
14111407
def _findfont_cached(self, prop, fontext, directory, fallback_to_default,
14121408
rebuild_if_missing, rc_params):
14131409

1410+
prop = FontProperties._from_any(prop)
1411+
14141412
fname = prop.get_file()
14151413
if fname is not None:
14161414
return fname

0 commit comments

Comments
 (0)