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
Matplotlib is not able to load fonts.
I have tried to delete the cache following all possible procedures listed in #13139 , as for example removing ~/.cache/matplotlib/fontlist-v310.json , but none of them turned out succesfully. No idea of how to solve this.
Code for reproduction
from matplotlib import rcParams
import matplotlib.font_manager
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Tahoma']
import matplotlib.pyplot as plt
There's no real reason why we shouldn't also query them (especially if that's something that can be somewhat automated with e.g. kpsewhich). However the real problem is that these are Type1 (pfb) fonts, which we don't support (well, we support them for raster/png output but not for vector output because of the reliance on ttconv) and therefore it makes sense not to have them (for now) in the cache. To be revisited once ttconv is a thing of the past :)
Thanks for the clarification, might or might not be related to the OP though, but for me, I agree that it makes sense and I guess something changed with ubuntu and what fonts are included how.
Activity
anntzer commentedon Jun 6, 2020
Please indicate where Tahoma is installed in your system.
local-minimum commentedon Jul 2, 2020
I'm having the same issue after upgrading code to Python 3.8.2 / mpl v.3.2.1 running in an Ubuntu 20.04 docker image trying to use Utopia font.
I installed the utopia font via texlive so locations are:
This didn't produce warnings before upgrade of ubuntu and python.
tacaswell commentedon Jul 2, 2020
@local-minimum in what version did it used to work?
Can you removing everything in
~/.cache/matplotlib?QuLogic commentedon Jul 2, 2020
Those paths are for LaTeX; they are not standard paths in which fonts would be found.
anntzer commentedon Jul 2, 2020
There's no real reason why we shouldn't also query them (especially if that's something that can be somewhat automated with e.g. kpsewhich). However the real problem is that these are Type1 (pfb) fonts, which we don't support (well, we support them for raster/png output but not for vector output because of the reliance on ttconv) and therefore it makes sense not to have them (for now) in the cache. To be revisited once ttconv is a thing of the past :)
local-minimum commentedon Jul 3, 2020
Thanks for the clarification, might or might not be related to the OP though, but for me, I agree that it makes sense and I guess something changed with ubuntu and what fonts are included how.
sesise0307 commentedon Aug 18, 2020
It helped me. Thanks!
jklymak commentedon Sep 7, 2020
This looks to be resolved for the responsive commenters. If there is still an issue we can re-open if more info is provided...
matthewfeickert commentedon Jan 8, 2021
Removing the full cache has proven to be very helpful (for me) for debugging things like this. Is there a way to clean the full cache using the
matplotlibAPI similar to howrebuilds the full font-list cache at
~/.cache/matplotlib/fontlist-v330.json?