Patch for enhancement of PDF backend

"Nicolas Grilly" <nicolas.grilly@...475...> writes:

Have you had time to look at my patch regarding the PDF backend? :slight_smile:

A bit, and I couldn't quite get it to work. But what the heck, let's
put it in the repository so we can all hack on it. It is quite an
improvement to the backend, and it doesn't seem to break anything that
used to work. (I ran the examples using backend_driver.py on both agg
and pdf.) Your patch (slightly modified) is committed as of svn
revision 3027.

The problem I'm having is that if I set use14corefonts on, I have to
make sure that Helvetica (or whatever) is chosen as the text font.
I used to have the setting

font.sans-serif : Bitstream Vera Sans

because that font works, and some other fonts that mpl finds (on my
OS X system) don't; but then setting use14corefonts on caused the afm
header parser to be called on Vera.ttf, which it obviously couldn't
make any sense of. I'm not sure I quite understand the Matplotlib font
selection system, though.

Replacing the setting by

font.sans-serif : Helvetica, Bitstream Vera Sans

helps, but it would be nice to put in some sanity checks so that we
don't send the ttf file to the afm parser.

On another note, the dpi setting was used for images. Removing it does
make the code simpler, but then all images will be at a resolution of
72 dpi. Can you be more specific about the problems that the dpi
setting was causing? Anyway, perhaps we should find a better interface
for specifying image resolution for vectorial backends.

Regards,

路路路

--
Jouni K. Sepp锟絥en

> Have you had time to look at my patch regarding the PDF backend? :slight_smile:

A bit, and I couldn't quite get it to work. But what the heck, let's
put it in the repository so we can all hack on it. It is quite an
improvement to the backend, and it doesn't seem to break anything that
used to work. (I ran the examples using backend_driver.py on both agg
and pdf.) Your patch (slightly modified) is committed as of svn
revision 3027.

Thanks Jouni for committing this patch.

Now, I'm working on the two issues you've mentioned below. I'll
probably send a new patch fixing the font issue in the next few days.

路路路

On 2/21/07, Jouni K. Sepp盲nen <jks@...278...> wrote:

The problem I'm having is that if I set use14corefonts on, I have to
make sure that Helvetica (or whatever) is chosen as the text font.
I used to have the setting

font.sans-serif : Bitstream Vera Sans

because that font works, and some other fonts that mpl finds (on my
OS X system) don't; but then setting use14corefonts on caused the afm
header parser to be called on Vera.ttf, which it obviously couldn't
make any sense of. I'm not sure I quite understand the Matplotlib font
selection system, though.

Replacing the setting by

font.sans-serif : Helvetica, Bitstream Vera Sans

helps, but it would be nice to put in some sanity checks so that we
don't send the ttf file to the afm parser.

On another note, the dpi setting was used for images. Removing it does
make the code simpler, but then all images will be at a resolution of
72 dpi. Can you be more specific about the problems that the dpi
setting was causing? Anyway, perhaps we should find a better interface
for specifying image resolution for vectorial backends.