[reportlab-users] "setfont" tag in RML seems not to work propelry

Bogdan M. Maryniuck reportlab-users@reportlab.com
Tue, 20 Jul 2004 11:31:18 +0300


On Mon, Jul 19, 2004 at 11:59:04AM +0200, Ulrich Weber wrote:
> Traceback (most recent call last):
>   File "D:\Program
> Files\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
>     exec codeObject in __main__.__dict__
>   File "D:\AR_Tool\AR_Tool_V9.1\AR_Tool\Script1.py", line 27, in ?
>     x = parseString(rml)
>   File "trml2pdf\trml2pdf.py", line 518, in parseString
>   File "trml2pdf\trml2pdf.py", line 148, in render
>   File "trml2pdf\trml2pdf.py", line 507, in render
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\platypus\doctemplate.py", line
> 650, in build
>     self._endBuild()
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\platypus\doctemplate.py", line
> 607, in _endBuild
>     if getattr(self,'_doSave',1): self.canv.save()
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfgen\canvas.py", line 847, in
> save
>     self._doc.SaveToFile(self._filename, self)
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 234, in
> SaveToFile
>     f.write(self.GetPDFData(canvas))
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 256, in
> GetPDFData
>     return self.format()
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 413, in
> format
>     return File.format(self)
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 770, in
> format
>     return string.join(self.strings, "")
>   File "D:\Program Files\Python23\Lib\string.py", line 135, in join
>     return sep.join(words)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 11:
> ordinal not in range(128)

1. Unicode && TTF's are supported in my fork of this project. But I never had
tried it (and probably never will) on Win32 OS.

2. Current recipe to you: yourunicodestring.encode(yourcharset) for your
strings.

-- 
暮

reduce(lambda c,d:chr(ord(d)-2)+c, 'ofcpqkekhhC"zwpkN"fgtgyqR/pqjv{R')