font_manager unittest errors #1793

Closed
toddrjen opened this Issue Feb 27, 2013 · 4 comments

Comments

Projects
None yet
4 participants
Contributor

toddrjen commented Feb 27, 2013

When running unittests on my local git branch from master, I am getting the following errors during the unittest run:

/home/User/.local/lib/python2.7/site-packages/matplotlib/font_manager.py:1224: UserWarning: findfont: Font family ['sans-serif'] not found. Falling back to Bitstream Vera Sans  (prop.get_family(), self.defaultFamily[fontext]))
/home/User/.local/lib/python2.7/site-packages/matplotlib/font_manager.py:1234: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=14.0. Returning /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf  UserWarning)/home/User/.local/lib/python2.7/site-packages/matplotlib/font_manager.py:1234: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=bold:stretch=500:size=14.0. Returning /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf  UserWarning)
/home/User/.local/lib/python2.7/site-packages/matplotlib/font_manager.py:1224: UserWarning: findfont: Font family ['sans serif'] not found. Falling back to Bitstream Vera Sans  (prop.get_family(), self.defaultFamily[fontext]))
/home/User/.local/lib/python2.7/site-packages/matplotlib/font_manager.py:1234: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=italic:variant=normal:weight=750:stretch=500:size=14.0. Returning /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf  UserWarning)
/home/User/.local/lib/python2.7/site-packages/matplotlib/font_manager.py:1234: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=200:stretch=500:size=14.0. Returning /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf  UserWarning)
/home/User/.local/lib/python2.7/site-packages/matplotlib/font_manager.py:1234: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=500:stretch=100:size=14.0. Returning /usr/lib64/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf  UserWarning)

It seems that the Bitstream Vera fonts are present in:

/home/User/.local/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/

So I don't know why they aren't being found

mdboom was assigned Feb 27, 2013

Owner

mdboom commented Feb 27, 2013

Have you tried removing ~/.matplotlib/fontList.cache?

Contributor

toddrjen commented Feb 27, 2013

Thanks, that fixes it. Sorry for the noise.

toddrjen closed this Feb 27, 2013

imrek commented Aug 22, 2015

I have deleted the fontList.cache, and it didn't help. What is the next troubleshooting step?
The only way I can apply fonts is with matplotlib.font_manager.FontProperties(), linking to the path where the font file is located, .mplstyle or python code does not work.

Owner

jenshnielsen commented Aug 22, 2015

@imrek Any chance you are using a python3 version. AFAIK that uses a different cache file: fontList.py3k.cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment