Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Summary
The following code takes 10-12 seconds to run on my machine:
importmatplotlib.font_managerasfont_managerfonts=font_manager.findSystemFonts(fontext="ttf")
For reference, I have 360 fonts installed according to Font Book.
Proposed fix
I fixed this issue inarcadia-pycolor #58 by just searching within the font directories myself:
def_find_macos_arcadia_fonts()->list[str]:""" Search for Arcadia fonts in the standard macOS font directories. """font_paths= []fordirpathinMACOS_FONT_DIRECTORIES:ifnotPath(dirpath).exists():continuepaths= [str(font_path)forfont_pathinPath(dirpath).glob("*.ttf")ifFONT_FILTER.lower()infont_path.name.lower() ]font_paths.extend(paths)returnfont_paths