cannot use some fonts on pdf, ps, eps backends

"Andrew Hawryluk" <HAWRYLA@...619...> writes:

When I use Arial Unicode MS within matplotlib, it cannot save to any
PostScript-based formats (pdf, eps, ps). Apparently, the font has no
glyph names:

[...]

    glyph_name = font.get_glyph_name(gind)
RuntimeError: Face has no glyph names

[...]

I know that these fonts can be included in PDFs, because I can do it
in other programs.

What version of Freetype do you have - does updating it help? The check
for glyph names is just a call to a Freetype macro:

  if (!FT_HAS_GLYPH_NAMES(face))
    throw Py::RuntimeError("Face has no glyph names");

Does it help if you set ps.fonttype and pdf.fonttype to 42 in
matplotlibrc? If not, could you send me (off-list) a sample of a PDF
file produced by another program using the font, preferably one that
displays the exact same string that causes this problem with matplotlib?

···

--
Jouni K. Sepp�nen
http://www.iki.fi/jks

From: Jouni K. Seppänen [mailto:jks@…278…]
Sent: 6 Apr 2009 1:20 PM
To: matplotlib-devel@lists.sourceforge.net
Subject: Re: [matplotlib-devel] cannot use some fonts on pdf, ps,eps
backends

"Andrew Hawryluk" <HAWRYLA@...619...> writes:

> When I use Arial Unicode MS within matplotlib, it cannot save to any
> PostScript-based formats (pdf, eps, ps). Apparently, the font has no
> glyph names:
[...]
> glyph_name = font.get_glyph_name(gind)
> RuntimeError: Face has no glyph names

What version of Freetype do you have - does updating it help? The check
for glyph names is just a call to a Freetype macro

I am using the most recent windows binary (0.98.5.2), so I'm guessing that my Freetype library came bundled inside it.

Does it help if you set ps.fonttype and pdf.fonttype to 42 in
matplotlibrc?

Yes, that works very well, thanks! However, it now embeds the entire font rather than a subset. This results in a PDF of 14.4 MB with this font. I ran it through ghostscript to get a PDF of 24.2 kB with subsetting, but I'm wondering if I can get subsetting of type 42 fonts directly from matplotlib?

Thanks again,

Andrew

···

-----Original Message-----