Nicolas Grilly <nicolas.grilly@...475...> writes:
The PDF backend breaks when the setting pdf.use14corefonts=True is
used. You'll find a test case reproducing this bug in the attached
You're right. I committed your patch, but there is another bug that
makes this a little difficult to test: the font cache doesn't record
whether it was build with pdf.use14corefonts enabled or not, and the
font name "Helvetica" happens to match "Helvetica Narrow", whose metrics
are included with matplotlib, and using that afm file without including
the font itself breaks the output. I'm too busy with other things to fix
this now, but patches are welcome. As a workaround, deleting
~/.matplotlib/fontList.cache helps if anyone wants to alternate between
enabling and disabling use14corefonts.
This setting is very useful because it produces very lightweight PDF
files. The files are lightweight because they only use the 14 core
fonts built in every PDF viewers (like Helvetica and Times).
Unfortunately, this functionality is deprecated in the PDF standard as
of PDF 1.5, and many publishers require embedding all fonts in PDF
files. Apparently not all substitutes for the standard fonts are similar
enough. (The real fonts need to be licensed, so many Linux distributions
ship with free look-alike substitutes, and who knows what fonts are
installed on some publisher's systems.)
Thanks for the patch!
Jouni K. Sepp�nen