[reportlab-users] problems with renderPM.

Robin Becker reportlab-users@reportlab.com
Mon, 8 Dec 2003 08:51:49 +0000


In article <20031208081232.91004.qmail@web15304.mail.bjs.yahoo.com>,
=?gb2312?q?=CA=BF=B7=BC=20=CD=F5?= <wangshifang_2008@yahoo.com.cn>
writes

I don't think we support far eastern fonts in renderPM just yet. We have
just gone through trying to get TTF fonts in via freetype 2, but the
structure of fonts other than T1/TTF isn't handled well yet.
>    Hi:
>
>      I want to set the string's fontName as 
>    'STSong-Light-GB-EUC-H',but the renderPM have some problems,what 
>    should I do?
>
>    Thanks
>
>     
>
>    from reportlab.graphics.shapes import *
>    from reportlab.graphics import renderPM,renderPDF
>    from reportlab.graphics.renderPM import drawToFile
>    from reportlab.lib import colors
>    d=Drawing(100,100)
>    d.add(String(40,40,'ddd',fontSize=10,fontName='STSong-Light-GB-EUC-H'))
>    d.add(Line(10,30,40,40))
>    renderPM.drawToFile(d,'fff.gif')
>
>     
>
>    the problems as following:
>
>    Warn: Can't find .pfb for face 'STSong-Light'
>    Traceback (most recent call last):
>      File "C:\Documents and Settings\Administrator\ÀÃæ\RR.py", line 9, 
>    in ?
>        renderPM.drawToFile(d,'fff.gif')
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 535, in drawToFile
>        c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, 
>    showBoundary=showBoundary)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 521, in drawToPMCanvas
>        draw(d, c, 0, 0)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 64, in draw
>        R.draw(drawing, canvas, x, y)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 112, in draw
>        self.drawNode(drawing)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 127, in drawNode
>        self.drawNodeDispatcher(node)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", 
>    line 217, in drawNodeDispatcher
>        self.drawGroup(node)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", 
>    line 241, in drawGroup
>        self.drawNode(node)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 124, in drawNode
>        self.push(node)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 82, in push
>        self.applyState()
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 95, in applyState
>        self._canvas.setFont(s['fontName'], s['fontSize'])
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 343, in setFont
>        _setFont(self._gs,fontName,fontSize)
>      File 
>    "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", 
>    line 247, in _setFont
>        raise RenderPMError, "Can't setFont(%s) missing the T1 
>    files?\nOriginally %s: %s" % (fontName,s1,s2)
>    RenderPMError: Can't setFont(STSong-Light-GB-EUC-H) missing the T1 
>    files?
>    Originally exceptions.AttributeError: CIDEncoding instance has no 
>    attribute 'vector'
>
>    __________________________________________________
>    Do You Yahoo!?
>    Tired of spam? Yahoo! Mail has the best spam protection around 
>    http://mail.yahoo.com 

-- 
Robin Becker