[reportlab-users] <setFont> Problem

Bernard Cagalj reportlab-users@reportlab.com
Mon, 4 Oct 2004 17:46:31 +0200


Hallo !

when I use another font than "Helvetica" (I need to use Helvetica-Bold) with
<setFont>  in the page template I get a error message:

Source:

	<pageTemplate id="firstPage">
		<pageGraphics>
		<image x="170mm" y="270mm" width="22mm" height="22mm"
file="sahm_logo.png"/>
		<setFont name="Helvetica" size="12"/>
		<fill color="red"/>
		<drawString x="100mm" y="270mm">Test</drawString>
		</pageGraphics>
		<frame id="address" x1="18mm" y1="205mm" width="100mm" height="045mm"/>
		<frame id="text"	x1="18mm" y1="20mm" width="165mm" height="172mm"/>
	</pageTemplate>

Error:

  File "/usr/lib/python2.2/site-packages/reportlab/platypus/doctemplate.py",
line 650, in build
    self._endBuild()
  File "/usr/lib/python2.2/site-packages/reportlab/platypus/doctemplate.py",
line 607, in _endBuild
    if getattr(self,'_doSave',1): self.canv.save()
  File "/usr/lib/python2.2/site-packages/reportlab/pdfgen/canvas.py", line
847, in save
    self._doc.SaveToFile(self._filename, self)
  File "/usr/lib/python2.2/site-packages/reportlab/pdfbase/pdfdoc.py", line
234, in SaveToFile
    f.write(self.GetPDFData(canvas))
  File "/usr/lib/python2.2/site-packages/reportlab/pdfbase/pdfdoc.py", line
256, in GetPDFData
    return self.format()
  File "/usr/lib/python2.2/site-packages/reportlab/pdfbase/pdfdoc.py", line
413, in format
    return File.format(self)
  File "/usr/lib/python2.2/site-packages/reportlab/pdfbase/pdfdoc.py", line
770, in format
    return string.join(self.strings, "")
  File "/usr/lib/python2.2/string.py", line 131, in join
    return sep.join(words)

UnicodeError: ASCII decoding error: ordinal not in range(128)

In the <para> everthing works fine with the fonts. I am not very into
Python. Can anybold help ?

Greetings

Bernard