[Bug]: FontManager.addfont doesn't accept pathlib.Path of TTF font #22582
Labels
Difficulty: Easy
https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Good first issue
Open a pull request against these issues if there are no active ones!
status: has patch
patch suggested, PR still needed
topic: text/fonts
Milestone
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 raisesTypeError
Code for reproduction
Actual outcome
Expected outcome
Additional information
It looks like the simplest fix would be to convert path-likes to
str
sinceFT2Font
is 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
The text was updated successfully, but these errors were encountered: