Andrew Jaffe wrote:
Michael Droettboom wrote:
I believe this bug was recently discussed on matplotlib-devel and is likely related to recent changes in the font manager cache.
I believe it's being looked into, but I haven't seen a resolution (unless I missed it).
Ah, sorry, this is indeed the same problem.
pdf.use14corefonts : True
to matplotlibrc does fix it, FWIW.
It solves the immediate problem for people who run into it, and it provides a clue about what the underlying problem is, but it does not fully identify or solve that problem.
To make real progress on it, we need an OSX user who understands something about font matters--or maybe only enough about OSX to do some exploration.
In font_manager.py, in the FontManager class, is the following:
# Load only the 14 PDF core fonts. These fonts do not need to be
# embedded; every PDF viewing application is required to have them:
# Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique,
# Courier, Courier-Bold, Courier-Oblique, Courier-BoldOblique,
# Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic, Symbol,
afmpath = os.path.join(rcParams['datapath'],'fonts','pdfcorefonts')
afmfiles = findSystemFonts(afmpath, fontext='afm')
self.afmdict = createFontDict(afmfiles, fontext='afm')
self.afmfiles = findSystemFonts(paths, fontext='afm') + \
self.afmdict = createFontDict(self.afmfiles, fontext='afm')
I think that the problem is occurring in the last line. This remains to be verified. It looks like *.afm files are being found, but when createFontDict tries to parse them it doesn't find what it expects.
My guess is that this problem has been lurking all along, but was only triggered when I changed font_manager to look for *all* system fonts instead of only truetype, so that it could generate a complete cache and then never have to search again unless the cache (actually a pickle of the FontManager instance) is deleted.
Andrew Jaffe wrote:
I've got Intel OSX 10.4.10 with SVN versions of numpy, scipy and matplotlib.
The latest matplotlib seems to fail on "import pylab" or "ipython -pylab" with very many lines of the form
"Found an unknown keyword in AFM header (was"
followed either by a legit character or lots of junk.
For what it's worth, I tend to install eggs rather than simple setup.py install; moving back to r3421 which I had prevviously seems to work fine.