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

Skip to content

Commit 01df054

Browse files
committed
Add short circuit for font lookup
svn path=/trunk/matplotlib/; revision=6343
1 parent 5c7b8e3 commit 01df054

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,8 @@ def findfont(self, prop, fontext='ttf'):
12111211
if score < best_score:
12121212
best_score = score
12131213
best_font = font
1214+
if score == 0:
1215+
break
12141216

12151217
if best_font is None or best_score > 10.0:
12161218
verbose.report('findfont: Could not match %s. Returning %s' %

0 commit comments

Comments
 (0)