[reportlab-users] Type 1 fonts and renderPM on Windows

Leighton Pritchard reportlab-users@reportlab.com
Fri, 29 Aug 2003 09:11:15 +0100


Hi Robin,

It's (practically) all fixed, now, but for the record I'll tell you what I 
did, and about a wee error that cropped up...

At 03:52 29/08/2003 -0400, you wrote:

>..... weird.
>Does the renderPM.py file run as a main script? We produce png in that.

No. It wrote renderPM0.gif, renderPM0.tif then crashed Python without an 
error message. The invasive properties of WindowsXP asked me if I'd like to 
tell Microsoft about it, though. For once it was useful, as it gave some 
error data:

AppName: python.exe     AppVer: 0.0.0.0 ModName: _imaging.pyd
ModVer: 0.0.0.0 Offset: 0001d9c5

>Do you know which version of PIL you're using?

PIL 1.1.4 - and it looked from the above error report that it was at fault. 
I'm running the Enthought distribution of Python2.2 (ISTR it came with PIL 
pre-built), so I installed a new copy from SecretLabs, and python 
renderPM.py then worked past the generation of renderPM0.png and renderPM0.jpg.

Unfortunately, it throws a wobbly at generating a PICT file:

Traceback (most recent call last):
   File "renderPM.py", line 582, in ?
     test()
   File "renderPM.py", line 567, in test
     drawToFile(drawing,fullpath,fmt=k)
   File "renderPM.py", line 522, in drawToFile
     c.saveToFile(fn,fmt)
   File "renderPM.py", line 292, in saveToFile
     return _saveAsPICT(im,fn,fmt)
   File "renderPM.py", line 243, in _saveAsPICT
     s = _renderPM.pil2pict(cols,rows,im.tostring(),im.im.getpalette())
TypeError: pil2pict() takes exactly 5 arguments (4 given)

and I couldn't follow the C source well enough to see what was wrong... 
(the docstring suggests only four arguments are required, mind)

My package works properly now though, and I'm very grateful.

Thanks again, Robin,


Dr Leighton Pritchard AMRSC
PPI, Scottish Crop Research Institute
Invergowrie, Dundee, DD2 5DA, Scotland, UK
L.Pritchard@scri.sari.ac.uk
PGP key 47B4A485: http://www.keyserver.net http://pgp.mit.edu