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

Leighton Pritchard reportlab-users@reportlab.com
Wed, 27 Aug 2003 17:22:39 +0100


Hi,

I'm having trouble with renderPM on WindowsXP with python2.2 and reportlab 
1.18.  When I attempt to write a file using the renderPM module, I get the 
error:

Traceback (most recent call last):
   File "test_Diagram.py", line 217, in t_bmp
     self.diagram.write(outfile, output='BMP')
   File "Diagram.py", line 291, in write
     drawmethod.drawToFile(self._drawing, filename, output)
   File "E:\APPLIC~1\PYTHON~1\reportlab\graphics\renderPM.py", line 521, in 
drawToFile
     c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, 
showBoundary=showBoundary)
   File "E:\APPLIC~1\PYTHON~1\reportlab\graphics\renderPM.py", line 507, in 
drawToPMCanvas
     draw(d, c, 0, 0)
   File "E:\APPLIC~1\PYTHON~1\reportlab\graphics\renderPM.py", line 51, in draw
     R.draw(drawing, canvas, x, y)
   File "E:\APPLIC~1\PYTHON~1\reportlab\graphics\renderPM.py", line 97, in draw
     self.applyState()
   File "E:\APPLIC~1\PYTHON~1\reportlab\graphics\renderPM.py", line 82, in 
applyState
     self._canvas.setFont(s['fontName'], s['fontSize'])
   File "E:\APPLIC~1\PYTHON~1\reportlab\graphics\renderPM.py", line 329, in 
setFont
     _setFont(self._gs,fontName,fontSize)
   File "E:\APPLIC~1\PYTHON~1\reportlab\graphics\renderPM.py", line 233, in 
_setFont
     raise RenderPMError, "Can't setFont(%s) missing the T1 
files?\nOriginally %s: %s" % (fontName,s1,s2)
RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
Originally exceptions.TypeError: makeT1Font() argument 2 must be string, 
not None

I got the same error with Linux until I placed the local Adobe Acrobat 
Reader .pfb font files under .../site-packages/reportlab/fonts - that 
installation now works fine.

I tried the same approach on Windows (with the Linux .pfb files and also 
with the .pfb files that come with the Windows installation of Acrobat 
Reader 6.0) but to no avail. I also tried transferring .pfb files from 
Ghostscript and texmf to .../reportlab/fonts.

I also edited rl_config.py to point to each of the folders that originally 
contained the fonts.  This did not work, either.  Nor did a fresh 
installation of ReportLab.

What else can I try to solve this problem?


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