large ps files

As noted here previously, PS/EPS files are 25 times larger than they
need to be in many cases because we embed the entire freetype font
into them. I think this is a problem that needs to be addressed, so
I'm posting here in hopes to motivate Paul, Jochen, or anyonw else
wanting to kill an afternoon to look into it.

Last time Paul looked at this (when he implemented freetype fonts for
PS mathtext), he came to the conclusion that it was not possible to
extract individual glyphs fro ps file, and had to resort to dumping in
the entire file. I don't believe this is the case. See, eg
agg22/font_freetype/agg_font_freetype.cpp in the matplotlib src distro
and the routine decompose_ft_outline in which a freetype glyph outline
is converted to an agg path (at least that is my read of it). We
could port this code to ft2font, and use it to embed the individual
glyph information in postscript, me thinks (caveat, I know nothing
about postscript font embedding).

The other idea, which I think is worth doing independently of the
embedding issue, is to support an rc option so that postscript uses
postscript fonts (eg what matplotlib used to do before we started
embedding using the supplied afm files for metrics and the AFM class
to parse them). For scripts that don't use mathtext, this is a
perfectly viable solution which would produce the minimal files, since
nothing has to be embedded.

But I think the embedding problem is the top priority. We can see
where we are vis-a-vis file sizes after that.

Any takers?

JDH`

Hello John,

Last time Paul looked at this (when he implemented freetype fonts for
PS mathtext), he came to the conclusion that it was not possible to
extract individual glyphs fro ps file, and had to resort to dumping in
the entire file. I don't believe this is the case.

I agree, there is no reason why we should not be able to
create a font with only selected glyphs.

Any takers?

I always meant to take a look at that, but momentarily I am a little
bit short of time. So if anybody else could implement this, this
would be great! Otherwise I might be able to have a look during next
weekend.

All the best,
Jochen

ยทยทยท

On Sun, Feb 06, 2005 at 11:49:36AM -0600, John Hunter wrote:
--