[reportlab-users] TrueType and ParagraphStyle

Dirk Holtwick reportlab-users@reportlab.com
Mon, 10 Feb 2003 18:49:21 +0100


I get the following error when using a TrueType font in ParagraphStyle 
attribute fontName. But everything works fine if I use the same font in 
the <font> tag. Has anyone an idea what went wrong?

dirk

SNIP:

Warn: Font Rina: _not an encoding_  not found - using Courier: _not an 
encoding_  for widths
Traceback (most recent call last):
   File "pdftools.py", line 359, in ?
     CreatePDF(open(src,"r"), open(dest,"wb"), debug=1, 
path=os.path.abspath(src), errout=sys.stdout)
   File "pdftools.py", line 166, in __init__
     self.doc.build(self.story.pop())
   File "H:\work\dado2\python21\reportlab\platypus\doctemplate.py", line 
583, in build
     self.handle_flowable(flowables)
   File "H:\work\dado2\python21\reportlab\platypus\doctemplate.py", line 
497, in handle_flowable
     if self.frame.add(f, self.canv, trySplit=self.allowSplitting):
   File "H:\work\dado2\python21\reportlab\platypus\frames.py", line 111, 
in _add
     w, h = flowable.wrap(self._aW, h)
   File "H:\work\dado2\python21\reportlab\platypus\paragraph.py", line 
382, in wrap
     self.blPara = self.breakLines([first_line_width, later_widths])
   File "H:\work\dado2\python21\reportlab\platypus\paragraph.py", line 
491, in breakLines
     wordWidth = stringWidth(word, fontName, fontSize)
   File "H:\work\dado2\python21\reportlab\pdfbase\pdfmetrics.py", line 
668, in _SWRecover
     return _stringWidth(text,'courier',fontSize,encoding)
_rl_accel.error: unknown font