[reportlab-users] problem with using renderPM.drawToFile to save to .GIF

waxmop reportlab-users@reportlab.com
Fri, 15 Aug 2003 10:05:11 -0400

Hi - I'm trying to save a Drawing object as a .gif, but not having much
luck,  Can anyone tell me what I'm doing wrong here?

[waxmop@localhost fedcharts]$ python
Python 2.2.2 (#2, Feb  5 2003, 10:40:08) 
[GCC 3.2.1 (Mandrake Linux 9.1 3.2.1-5mdk)] on linux-i386
Type "help", "copyright", "credits" or "license" for more information.
>>> from reportlab.graphics.shapes import *
>>> from reportlab.lib import colors
>>> d = Drawing(100,100)
>>> r = Rect(10, 10, 80, 80, fillColor='yellow')
>>> d.add(r)
>>> from reportlab.graphics.renderPM import drawToFile
>>> drawToFile(d, 'out.gif', 'GIF')
Warn: Can't find .pfb for face 'Times-Roman'
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/site-packages/reportlab/graphics/renderPM.py", line 521, in drawToFile
    c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, showBoundary=showBoundary)
  File "/usr/lib/python2.2/site-packages/reportlab/graphics/renderPM.py", line 507, in drawToPMCanvas
    draw(d, c, 0, 0)
  File "/usr/lib/python2.2/site-packages/reportlab/graphics/renderPM.py", line 51, in draw
    R.draw(drawing, canvas, x, y)
  File "/usr/lib/python2.2/site-packages/reportlab/graphics/renderPM.py", line 97, in draw
  File "/usr/lib/python2.2/site-packages/reportlab/graphics/renderPM.py", line 82, in applyState
    self._canvas.setFont(s['fontName'], s['fontSize'])
  File "/usr/lib/python2.2/site-packages/reportlab/graphics/renderPM.py", line 329, in setFont
  File "/usr/lib/python2.2/site-packages/reportlab/graphics/renderPM.py", line 233, in _setFont
    raise RenderPMError, "Can't setFont(%s) missing the T1 files?\nOriginally %s: %s" % (fontName,s1,s2)
reportlab.graphics.renderPM.RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
Originally exceptions.TypeError: makeT1Font() argument 2 must be string, not None

Am I missing those T1 files?  I thought I installed everything ok.

Thanks for the help.