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

Skip to content

Commit 314a0cf

Browse files
committed
Fixes a bug in font family lookup. Any font in the font alias
list (e.g. font.sans-serif) would be considered a perfect match whenever the selected font alias is the first in the font.family list. This broke the priority ordering of font names.
1 parent 84a8389 commit 314a0cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ def score_family(self, families, family2):
10711071
if family2 in options:
10721072
idx = options.index(family2)
10731073
return ((0.1 * (float(idx) / len(options))) *
1074-
(float(i) / float(len(families))))
1074+
(float(i + 1) / float(len(families))))
10751075
elif family1 == family2:
10761076
# The score should be weighted by where in the
10771077
# list the font was found.

0 commit comments

Comments
 (0)