[reportlab-users] problems with renderPM.
Ê¿·¼ Íõ
reportlab-users@reportlab.com
Mon, 8 Dec 2003 16:12:32 +0800 (CST)
--0-956920598-1070871152=:90991
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit
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
--0-956920598-1070871152=:90991
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: 8bit
<DIV>Hi:</DIV>
<DIV> I want to set the string's fontName as 'STSong-Light-GB-EUC-H',but the renderPM have some problems,what should I do?</DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV>from reportlab.graphics.shapes import *<BR>from reportlab.graphics import renderPM,renderPDF<BR>from reportlab.graphics.renderPM import drawToFile<BR>from reportlab.lib import colors<BR>d=Drawing(100,100)<BR>d.add(String(40,40,'ddd',fontSize=10,fontName='STSong-Light-GB-EUC-H'))<BR>d.add(Line(10,30,40,40))<BR>renderPM.drawToFile(d,'fff.gif')</DIV>
<DIV> </DIV>
<DIV>the problems as following:</DIV>
<DIV>Warn: Can't find .pfb for face 'STSong-Light'<BR>Traceback (most recent call last):<BR> File "C:\Documents and Settings\Administrator\¡ÁÀÃæ\RR.py", line 9, in ?<BR> renderPM.drawToFile(d,'fff.gif')<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 535, in drawToFile<BR> c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, showBoundary=showBoundary)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 521, in drawToPMCanvas<BR> draw(d, c, 0, 0)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 64, in draw<BR> R.draw(drawing, canvas, x, y)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 112, in draw<BR> self.drawNode(drawing)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 127, in
drawNode<BR> self.drawNodeDispatcher(node)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", line 217, in drawNodeDispatcher<BR> self.drawGroup(node)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", line 241, in drawGroup<BR> self.drawNode(node)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 124, in drawNode<BR> self.push(node)<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 82, in push<BR> self.applyState()<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 95, in applyState<BR> self._canvas.setFont(s['fontName'], s['fontSize'])<BR> File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 343, in setFont<BR> _setFont(self._gs,fontName,fontSize)<BR> File
"E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 247, in _setFont<BR> raise RenderPMError, "Can't setFont(%s) missing the T1 files?\nOriginally %s: %s" % (fontName,s1,s2)<BR>RenderPMError: Can't setFont(STSong-Light-GB-EUC-H) missing the T1 files?<BR>Originally exceptions.AttributeError: CIDEncoding instance has no attribute 'vector'<BR></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com
--0-956920598-1070871152=:90991--