dviread: usetex for the PDF backend

The usetex support in pdf is now a little better, so I am enabling it
now. At least it is more entertaining than NotImplementedError...

I have fixed some of the biggest problems (the broken font embedding
causing crashes of Preview.app, and the lack of virtual font support).
It still makes some assumptions about the TeX distribution: you need
kpsewhich and pdftex.map, so on TeX Live or (I presume) teTeX you are
fine, but I have no idea about Windows.

Transformations of Type-1 fonts are not implemented, so if you try to
use $\alpha$ with Times, TeX typesets an alpha from Symbol and slants
it, but you get the non-slanted version. Fixing this (and adding
subsetting support) probably requires a complete Type-1 parser.

There is support for baseline alignment, but it is based on finding the
baseline of the lowest character, so subscripts will throw it off. A
good solution will require some TeX magic.

Reports of bugs (or successes) are welcome.

···

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

Hi Jouni,

The usetex support in pdf is now a little better, so I am enabling it
now. At least it is more entertaining than NotImplementedError...

I have fixed some of the biggest problems (the broken font embedding
causing crashes of Preview.app, and the lack of virtual font support).
It still makes some assumptions about the TeX distribution: you need
kpsewhich and pdftex.map, so on TeX Live or (I presume) teTeX you are
fine, but I have no idea about Windows.

Transformations of Type-1 fonts are not implemented, so if you try to
use \\alpha with Times, TeX typesets an alpha from Symbol and slants
it, but you get the non-slanted version. Fixing this (and adding
subsetting support) probably requires a complete Type-1 parser.

There is support for baseline alignment, but it is based on finding the
baseline of the lowest character, so subscripts will throw it off. A
good solution will require some TeX magic.

Reports of bugs (or successes) are welcome.

I tried the following, with the latest svn checkout and usetex=True:

plot([1,2])
savefig('test.pdf')

and I get an error, the tail end is:

/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_pdf.py in
writeFonts(self)
    468 elif filename.endswith('.pfb') or
filename.endswith('.pfa'):
    469 # a Type 1 font; limited support for now
--> 470 fontdictObject = self.embedType1(filename,
self.fontInfo[Fx])
    471 else:
    472 realpath, stat_key = get_realpath_and_stat(filename)

/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_pdf.py in
embedType1(self, filename, fontinfo)
    501 fh.close()
    502
--> 503 fh = open(fontinfo.afmfile, 'rb')
    504 matplotlib.verbose.report(
    505 'Reading metrics from ' + fontinfo.afmfile, 'debug')

IOError: [Errno 2] No such file or directory: ''

Darren

···

On Thursday 13 September 2007 02:38:25 am Jouni K. Seppänen wrote: