Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3855f6c

Browse filesBrowse files
committed
Small bugfix for _findfont_cached
1 parent 9901df1 commit 3855f6c
Copy full SHA for 3855f6c

File tree

1 file changed

+2
-4
lines changed
Filter options

1 file changed

+2
-4
lines changed

‎lib/matplotlib/font_manager.py

Copy file name to clipboardExpand all lines: lib/matplotlib/font_manager.py
+2-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.