[reportlab-users] Error in ttfont

Dick Kniep dick at kniep.nl
Fri Mar 31 12:34:42 EST 2006


Hi list,

here is some code

<snip>
        self.CurrFont = TTFont('Lucida Sans','SUSESans-Roman.ttf')
        pdfmetrics.registerFont(self.CurrFont)
        thisFont = pdfmetrics.getFont(self.CurrFont)
<snip>

And this is the result

<snip>
2006-03-31 19:30:20,941 INFO GenReportLab 188 self.CurrFont is 
<reportlab.pdfbase.ttfonts.TTFont instance at 0x4264b98c>
Traceback (most recent call last):
  File "/home/dick/CVix/CVix/src/DefColumns.py", line 1542, in ExecPrinten
    StdReport(self.title, [hdrs], data, 
medewerker=strip(Getuser.CurrUser.medewerkerrec.per_naam1), toon=Tonen)
  File "/home/dick/CVix/CVix/src/Report.py", line 207, in __init__
    Report.__init__(self, reporthdr, velden, fldhdrs, repdata, medewerker, 
toon=toon)
  File "/home/dick/CVix/CVix/src/Report.py", line 196, in __init__
    form=form, orientation=self.orientation)
  File "/home/dick/CVix/CVix/src/GenReportLab.py", line 189, in __init__
    thisFont = pdfmetrics.getFont(self.CurrFont)
  File "/usr/lib/python2.4/site-packages/reportlab/pdfbase/pdfmetrics.py", 
line 641, in getFont
    face = getTypeFace(fontName)
  File "/usr/lib/python2.4/site-packages/reportlab/pdfbase/pdfmetrics.py", 
line 592, in getTypeFace
    return _typefaces[faceName]
KeyError: <reportlab.pdfbase.ttfonts.TTFont instance at 0x4264b98c>
<snip>

Can anyone tell me what I am doing wrong?

Thanks a lot in advance,

Dick Kniep


More information about the reportlab-users mailing list