font problems with eps on OS X (MPL 0.90.0)

J Oishi <joishi@...1600...> writes:

I have an interesting problem using fonts in matplotlib on OS X 10.4.
When I use a font other than the Bitstream Vera provided with MPL
0.90.0, I cannot create readable eps files.

FWIW, I have the same problem: eps files produced on OS X are huge,
and somehow broken. My guess is that the fonts that come with OS X
have some advanced features, which should somehow be stripped out when
embedding into an eps file.

Perhaps one way to address the problem would be to use fonttools� to
read the font file, prune the resulting data structure to include just
the characters needed, and again use fonttools to output the structure
into the eps file.

http://sourceforge.net/projects/fonttools/

···

--
Jouni K. Sepp�nen

Yes, this is the problem. matplotlib needs straight truetype fonts
(ttf) , not the more sophisticated opentype fonts and font suitcases
that come with macosX.

Most fonts in standard Apple places:
/Users/agn/Library/Fonts/
/Library/Fonts/
/System/Library/Fonts/

are .dfont or .otf etc... these don't work.

Except e.g. sans serif InaiMathi
                     fantasy Chalkboard

which are straight .ttf, so do work.

If you have e.g. Gerben Wierda's latex installation gwtex, or probably
also the mactex distribution, this comes wilth various ttf versions of
the system fonts.
E.g I have the old gwtex based on tetex which comes with

gillsans [in light heavy etc..],hoefler ( a very nice serif
font),helveticaneue,lucidagrande,optima,verdana,didot and futura.

In my distribution these fonts are in
/usr/local/teTeX/share/texmf.gwtex/fonts/truetype/gtamacfont

if you want to use fonts like this, you either have to modify the
search path in font_manager.py to include the directories *directly*
containiong the .ttf files, or symlink the .ttf files into the
matplotlib directory holding vera.ttf etc...
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf

I believe you can make your own .ttf files from any standard Mac .otf
or .dfont using Fondu
[ http://fondu.sourceforge.net/\] -- again included in Wierda's teX
installations.

HTH. George Nurser.

···

On 12/05/07, Jouni K. Seppänen <jks@...397...> wrote:

J Oishi <joishi@...1600...> writes:

> I have an interesting problem using fonts in matplotlib on OS X 10.4.
> When I use a font other than the Bitstream Vera provided with MPL
> 0.90.0, I cannot create readable eps files.

FWIW, I have the same problem: eps files produced on OS X are huge,
and somehow broken. My guess is that the fonts that come with OS X
have some advanced features, which should somehow be stripped out when
embedding into an eps file.