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

Skip to content

texmanager doesn't handle list of names for font.family #2012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 15, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make weighting by position in the list less magical
  • Loading branch information
mdboom committed May 15, 2013
commit d129186c880c38c8e13448c7bc290dcd5a8bed6b
7 changes: 5 additions & 2 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,9 +1066,12 @@ def score_family(self, families, family2):
options = [x.lower() for x in options]
if family2 in options:
idx = options.index(family2)
return 0.1 * ((float(idx) / len(options)) + float(i))
return ((0.1 * (float(idx) / len(options))) *
(float(i) / float(len(families))))
elif family1 == family2:
return 0.1 * float(i)
# The score should be weighted by where in the
# list the font was found.
return float(i) / float(len(families))
return 1.0

def score_style(self, style1, style2):
Expand Down