You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, the fonts are already installed in the machine, but matplotlib is unaware of the location and doesn't check it. In this case, the user download the fonts even if he doesn't need to.
We could add in the __init__ something like:
import matplotlib
from matplotlib import font_manager
# Check if the recommended fonts are installed in the texlive path and the matplotlib path
font_dirs = ["/usr/share/texlive/texmf-dist/fonts", matplotlib.__path__[0]]
for font_dir in font_dirs:
font_files = font_manager.findSystemFonts()
for font_file in font_files:
font_manager.fontManager.addfont(font_file)
but then will the fontManager (ref) still tries the default path if you don't tell where to look? I had problems providing explicitly None as a default parameters, some found fonts crashes the fontManager.addfont, so I'm a bit confused by how it proceeds to get the fonts.
The text was updated successfully, but these errors were encountered:
0ctagon
changed the title
Unnecessary font installation
Case of unnecessary font installation
Mar 28, 2024
Not yet. #158 only check if the fonts are already installed in ~/.fonts, it doesn't checks in all the system if they already are installed and then link it to matplotlib.
In some cases, the fonts are already installed in the machine, but matplotlib is unaware of the location and doesn't check it. In this case, the user download the fonts even if he doesn't need to.
We could add in the
__init__
something like:but then will the
fontManager
(ref) still tries the default path if you don't tell where to look? I had problems providing explicitlyNone
as a default parameters, some found fonts crashes thefontManager.addfont
, so I'm a bit confused by how it proceeds to get the fonts.The text was updated successfully, but these errors were encountered: