-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Py3fy font_manager. #10522
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
Py3fy font_manager. #10522
Conversation
Looks correct to me. Did you test the changed code on Windows? The codecov output seems to indicate a lack of automated test coverage. On the other hand, a lot of the time the codecov results look just completely wrong. |
Can't easily test on Windows right now, sorry. |
stretch = 'semi-condensed' | ||
elif fontname.find('wide') >= 0 or fontname.find('expanded') >= 0: | ||
elif 'narrow' in fontname or 'cond' in fontname: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have these if statements swapped order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the search for "demi cond" has to go before the search for "cond" (otherwise the latter always happens before the former...).
@@ -568,7 +544,7 @@ def createFontList(fontfiles, fontext='ttf'): | |||
except UnicodeError: | |||
_log.info("Cannot handle unicode filenames") | |||
continue | |||
except IOError: | |||
except OSError: | |||
_log.info("IO error - cannot open font file %s", fpath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If its now an OSError
should this message be changed, or is it obvious enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, from the POV of the user it is indeed an input/output error... (and IOError == OSError anyways on Py3)
PR Summary
(orthogonal to #10435)
PR Checklist