[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>&nbsp; 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>&nbsp;</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>&nbsp;</DIV>
<DIV>the problems as following:</DIV>
<DIV>Warn: Can't find .pfb for face 'STSong-Light'<BR>Traceback (most recent call last):<BR>&nbsp; File "C:\Documents and Settings\Administrator\¡Á&Agrave;&Atilde;&aelig;\RR.py", line 9, in ?<BR>&nbsp;&nbsp;&nbsp; renderPM.drawToFile(d,'fff.gif')<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 535, in drawToFile<BR>&nbsp;&nbsp;&nbsp; c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, showBoundary=showBoundary)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 521, in drawToPMCanvas<BR>&nbsp;&nbsp;&nbsp; draw(d, c, 0, 0)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 64, in draw<BR>&nbsp;&nbsp;&nbsp; R.draw(drawing, canvas, x, y)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 112, in draw<BR>&nbsp;&nbsp;&nbsp; self.drawNode(drawing)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 127, in
 drawNode<BR>&nbsp;&nbsp;&nbsp; self.drawNodeDispatcher(node)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", line 217, in drawNodeDispatcher<BR>&nbsp;&nbsp;&nbsp; self.drawGroup(node)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", line 241, in drawGroup<BR>&nbsp;&nbsp;&nbsp; self.drawNode(node)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 124, in drawNode<BR>&nbsp;&nbsp;&nbsp; self.push(node)<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 82, in push<BR>&nbsp;&nbsp;&nbsp; self.applyState()<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 95, in applyState<BR>&nbsp;&nbsp;&nbsp; self._canvas.setFont(s['fontName'], s['fontSize'])<BR>&nbsp; File "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 343, in setFont<BR>&nbsp;&nbsp;&nbsp; _setFont(self._gs,fontName,fontSize)<BR>&nbsp; File
 "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", line 247, in _setFont<BR>&nbsp;&nbsp;&nbsp; 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--