-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[Bug]: FontManager.addfont doesn't accept pathlib.Path of TTF font #22582
Copy link
Copy link
Closed
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!status: has patchpatch suggested, PR still neededpatch suggested, PR still neededtopic: text/fonts
Milestone
Metadata
Metadata
Assignees
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!status: has patchpatch suggested, PR still neededpatch suggested, PR still neededtopic: text/fonts
Bug summary
The
FontManager.addfont()method is documented as accepting a path-like, but if a path-like for a .ttf font file is passed it raisesTypeErrorCode for reproduction
Actual outcome
Expected outcome
Additional information
It looks like the simplest fix would be to convert path-likes to
strsinceFT2Fontis implemented in C++.Operating system
Ubuntu 20.04
Matplotlib Version
3.5.1
Matplotlib Backend
TkAgg
Python version
3.9.5
Jupyter version
N/A
Installation
pip