8000 Small bugfix for _findfont_cached · matplotlib/matplotlib@06913db · GitHub
[go: up one dir, main page]

Skip to content

Commit 06913db

Browse files
committed
Small bugfix for _findfont_cached
1 parent 9901df1 commit 06913db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,6 @@ def findfont(self, prop, fontext='ttf', directory=None,
13061306
"font.serif", "font.sans-serif", "font.cursive", "font.fantasy",
13071307
"font.monospace"])
13081308

1309-
if not isinstance(prop, FontProperties):
1310-
prop = FontProperties._from_any(prop)
1311-
13121309
return self._findfont_cached(
13131310
prop, fontext, directory, fallback_to_default, rebuild_if_missing,
13141311
rc_params)
@@ -1411,6 +1408,9 @@ def find_fontsprop(self, prop, fontext='ttf', directory=None,
14111408
def _findfont_cached(self, prop, fontext, directory, fallback_to_default,
14121409
rebuild_if_missing, rc_params):
14131410

1411+
if not isinstance(prop, FontProperties):
1412+
prop = FontProperties._from_any(prop)
1413+
14141414
fname = prop.get_file()
14151415
if fname is not None:
14161416
return fname

0 commit comments

Comments
 (0)
0