Skip to content

Backport PR #28078 on branch v3.9.x (Clarify that findfont & _find_fonts_by_props return paths.) #28081

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
Changes from all commits
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
6 changes: 3 additions & 3 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ def score_size(self, size1, size2):
def findfont(self, prop, fontext='ttf', directory=None,
fallback_to_default=True, rebuild_if_missing=True):
"""
Find a font that most closely matches the given font properties.
Find the path to the font file most closely matching the given font properties.

Parameters
----------
Expand Down Expand Up @@ -1305,7 +1305,7 @@ def get_font_names(self):
def _find_fonts_by_props(self, prop, fontext='ttf', directory=None,
fallback_to_default=True, rebuild_if_missing=True):
"""
Find font families that most closely match the given properties.
Find the paths to the font files most closely matching the given properties.

Parameters
----------
Expand Down Expand Up @@ -1335,7 +1335,7 @@ def _find_fonts_by_props(self, prop, fontext='ttf', directory=None,
Returns
-------
list[str]
The paths of the fonts found
The paths of the fonts found.

Notes
-----
Expand Down