The matplotlib ebuild removes all the bakoma fonts (name starting with cm): # remove internal copies of fonts, pycxx, pyparsing rm -rf \ CXX \ lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \ lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \ lib/matplotlib/pyparsing.py \ || die "removed internal copies failed" ------------ the ebuild also depends on texcm-ttf to provide the fonts in question. Unfortunately texcm-ttf do not provide all the removed fonts. Matplotlib ships: -rw-r--r-- 1 francois users 25680 Aug 1 2009 cmb10.ttf -rw-r--r-- 1 francois users 21092 Aug 1 2009 cmex10.ttf -rw-r--r-- 1 francois users 32560 Aug 1 2009 cmmi10.ttf -rw-r--r-- 1 francois users 26348 Aug 1 2009 cmr10.ttf -rw-r--r-- 1 francois users 20376 Aug 1 2009 cmss10.ttf -rw-r--r-- 1 francois users 29396 Aug 1 2009 cmsy10.ttf -rw-r--r-- 1 francois users 28136 Aug 1 2009 cmtt10.ttf texcm-ttf ships: /usr/share/fonts/texcm-ttf/cmex10.ttf /usr/share/fonts/texcm-ttf/cmmi10.ttf /usr/share/fonts/texcm-ttf/cmr10.ttf /usr/share/fonts/texcm-ttf/cmsy10.ttf That's 3 fonts missing. They are used as revealed by the sage testsuite: http://github.com/cschwan/sage-on-gentoo/issues/#issue/18/comment/370590 They are all set in the matplotlib file mathtext.py. Possible work around: switching the default font in matplotlibrc from cm to stix works: #mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix', becomes: mathtext.fontset : stix # Should be 'cm' (Computer Modern), 'stix', Making change in matplotlib.conf doesn't appear to have an effect.
*** Bug 352605 has been marked as a duplicate of this bug. ***
Still true for mpl 1.0.1 btw.
Hopefully should be fixed in 1.0.1-r1. Re-open if not. Thanks.
Not fixed. Just installed matplotlib 1.0.1-r1 and fired up a script: /usr/lib64/python2.6/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) /usr/lib64/python2.6/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) /usr/lib64/python2.6/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) blub@repulsion $ equery l -i dev-python/matplotlib [ Searching for package 'matplotlib' in 'dev-python' among: ] * installed packages [I--] [ ~] dev-python/matplotlib-1.0.1-r1 (0) Cheers, Bjoern
Just in case - An example which reproduces the warning: -------------------------------------------------------------------------- #!/bin/env python # # import matplotlib as mpl X = range(0,100,1) Y = range(0,100,1) f = mpl.pyplot.figure() ax = f.add_subplot(111) PLT = ax.plot(X, Y, linestyle='-', linewidth="1") # mpl.pyplot.xlabel makes calls to font_manager which then throws a warning about the missing font mpl.pyplot.xlabel(r"$Time$ $(ps)$") # Same here... mpl.pyplot.ylabel(r'$Average$ $r^2C.O.M$') mpl.pyplot.tick_params(axis="x", direction="out") mpl.pyplot.ticklabel_format(axis="x", style="sci", scilimits=(0,0)) mpl.pyplot.savefig("test.png") ------------------------------------------------------------------------
Sorry, posted the wrong one... ------------------------------------------------------- #!/bin/env python # # from matplotlib.pyplot import figure, show, xlabel, ylabel, savefig from matplotlib.figure import Figure X = range(0,100,1) Y = range(0,100,1) f = figure() ax = f.add_subplot(111) PLT = ax.plot(X, Y, linestyle='-', linewidth="1") # mpl.pyplot.xlabel makes calls to font_manager which then throws a warning about the missing font xlabel(r"$Time$ $(ps)$") # Same here... ylabel(r'$Average$ $r^2C.O.M$') savefig("test.png") --------------------------------------------------------------------- Cheers, Bjoern
Bjoern, would switching to stix font instead of cm as default be satisfactory for you? It involves touching the default matplotlibrc file shipped to set mathtext.fonset to stix rather than the default cm. We would just just forget about the cm fonts. We would print a warning about it at post_install. How does that sounds?
(In reply to comment #7) > Bjoern, would switching to stix font instead of cm as default be satisfactory > for you? > Yes why not. But I dont't understand the underlying problem. Is ist matplotlib not shipping the cm font or is it tex not installing this font, or is the cm simply outdated. I installed the cm fontset in KDE but matplotlib seems to ignore this successfully. But anyway, I have no problems switching to stix and get rid of that nasty warning message. Cheers, Bjoern
It is shipping the cm fonts. When I filled the bug they were removed in favor of an incomplete font package. In the current ebuild we leave them but we seem to have a problem setting the path to find them. In theory stix is one of the future standard for math fonts, so it makes sense to use them. I'll make a patch in the morning.
(In reply to comment #9) > It is shipping the cm fonts. When I filled the bug they were removed in favor > of an incomplete font package. In the current ebuild we leave them but we seem > to have a problem setting the path to find them. In theory stix is one of the > future standard for math fonts, so it makes sense to use them. I'll make a > patch in the morning. > Any news on this? Cheers, Bjoern
Oh wait, my fault... the font cache was outdated now. deleting ~/.matplotlib fixed it. Sorry again. Cheers, Bjoern
I hadn't done that either! I am sorry I let it slip for so long, got a new baby just a few days after my last answer here. Anyway it is now fixed provided that the font cache is reset.