Closed
Description
Bug report
Bug summary
In 3.2.0rc1, fontManager.addfont
only accepts local paths. It'd be great to also accept urls, as to avoid requiring downloading a font file.
Code for reproduction
!pip install -U --pre matplotlib
import matplotlib as mpl
mpl.__version__ # 3.2.0rc1
mpl.font_manager.fontManager.addfont('https://github.com/MaxGhenis/random/raw/master/Roboto-Regular.ttf')
mpl.rc('font', family='Roboto')
mpl.pyplot.plot([1, 2])
Actual outcome
findfont: Font family ['Roboto'] not found. Falling back to DejaVu Sans.
Expected outcome
No warning. Chart with Roboto labels.
This occurs when I instead download the file:
!wget https://github.com/MaxGhenis/random/raw/master/Roboto-Regular.ttf
mpl.font_manager.fontManager.addfont('Roboto-Regular.ttf')
Matplotlib version
- Operating system: Linux (Google Colab)
- Matplotlib version: 3.2.0rc1
- Matplotlib backend (
print(matplotlib.get_backend())
): module://ipykernel.pylab.backend_inline - Python version: 3.6
- Jupyter version (if applicable):
jupyter core : 4.5.0 jupyter-notebook : 5.2.2
- Other libraries: