-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix Path/str-discrepancy in FontManager.addpath and improve documentation #22591
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
Conversation
f56ea70
to
e22b3a6
Compare
9939784
to
22e3daf
Compare
6d5edf6
to
63eba3b
Compare
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.
This is good, only some stylistic comments.
|
||
- style: Either 'normal' (default), 'italic' or 'oblique'. | ||
- style: Either 'normal', 'italic' or 'oblique'. |
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.
Optional: Highlight the properties using italics (or alternatively literal format)
- style: Either 'normal', 'italic' or 'oblique'. | |
- *style*: Either 'normal', 'italic' or 'oblique'. |
This is also quite redundant with the setters. This is almost completely a data class. IMHO it would be reasonable to add properties and move all the documentation there, i.e. delete this list and the setter docstrings (setters may link to the property docs. But that's for a later time.
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.
That would make sense, but I think it is better to try to get the information from the setmethods at a later stage.
63eba3b
to
9e67574
Compare
I changed based on the comments. However, there is still the same issue as in #22556 (comment) Edit: I screwed up when editing and did just amend to the last commit rather than updating the correct one, so one may want to squash. |
9e67574
to
249f360
Compare
249f360
to
0525305
Compare
@@ -1,7 +1,7 @@ | |||
""" | |||
A module for finding, managing, and using fonts across platforms. | |||
|
|||
This module provides a single `FontManager` instance that can | |||
This module provides a single `FontManager` instance, ``fontManager``, that can |
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.
I did not manage to link to fontManager
when the definition is in font_manager_api.rst
.
0525305
to
7f21bca
Compare
Thank you all very much for the quick resolution! |
PR Summary
Closes #22582
Closes #22586
Always convert input to
str
first.Also update the documentation a bit.
Cannot really see how this can be tested as I do not know of any ttf-font locations on the CI... Edit: I found a ttf-font in the test data, so at least it should be possible to test passing a Path without errors. Edit 2: Test added.
Also added a validation function for
font.stretch
, so now rcParam-values can also be ints.Kept it as four separate commits, but can of course merge to a single.
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).