Skip to content

Switch testing to pytest completely #7974

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 14 commits into from
Feb 3, 2017
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
Normalize path case before checking for fonts.
This is a problem on Windows where file paths are case-insensitive.
  • Loading branch information
QuLogic committed Feb 2, 2017
commit ca255dda3347495c725801a20eabafdc07ab3605
5 changes: 4 additions & 1 deletion lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,13 +1284,16 @@ def findfont(self, prop, fontext='ttf', directory=None,
cached = _lookup_cache[fontext].get(prop)
if cached is not None:
return cached
else:
directory = os.path.normcase(directory)

best_score = 1e64
best_font = None

for font in fontlist:
if (directory is not None and
os.path.commonprefix([font.fname, directory]) != directory):
os.path.commonprefix([os.path.normcase(font.fname),
directory]) != directory):
continue
# Matching family should have highest priority, so it is multiplied
# by 10.0
Expand Down