From c168f357b300ac59ec4d6082ea1b34f8f5950517 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Mon, 15 Apr 2024 11:44:40 +0200 Subject: [PATCH] Clarify that findfont & _find_fonts_by_props return paths. Especially the previous wording for _find_fonts_by_props ("find font families") was somewhat confusing, as "font families" are strings. --- lib/matplotlib/font_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index 73da3c418dd7..312e8ee97246 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -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 ---------- @@ -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 ---------- @@ -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 -----