[reportlab-users] problems with renderPM.

Ê¿·¼ Íõ reportlab-users@reportlab.com
Mon, 8 Dec 2003 17:29:16 +0800 (CST)


--0-721162175-1070875756=:6414
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit



Robin Becker <robin@reportlab.com> wrote: 
In article <20031208081232.91004.qmail@web15304.mail.bjs.yahoo.com>,
=?gb2312?q?=CA=BF=B7=BC=20=CD=F5?= 
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
>
> ?lt;br>>
> 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')
>
> ?lt;br>>
> 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
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users

Thank you Robin

I have make .pdf which supporting Chinese ,but I want to convert it to .gif file, or I should make a .gif file which supporting Chinese,what shoule I do?

Thanks agian



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--0-721162175-1070875756=:6414
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: 8bit

<DIV>
<DIV><BR><BR><B><I>Robin Becker &lt;robin@reportlab.com&gt;</I></B> wrote: 
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<P>In article &lt;20031208081232.91004.qmail@web15304.mail.bjs.yahoo.com&gt;,<BR>=?gb2312?q?=CA=BF=B7=BC=20=CD=F5?= <WANGSHIFANG_2008@YAHOO.COM.CN><BR>writes<BR><BR>I don't think we support far eastern fonts in renderPM just yet. We have<BR>just gone through trying to get TTF fonts in via freetype 2, but the<BR>structure of fonts other than T1/TTF isn't handled well yet.<BR>&gt; Hi:<BR>&gt;<BR>&gt; ?I want to set the string's fontName as <BR>&gt; 'STSong-Light-GB-EUC-H',but the renderPM have some problems,what <BR>&gt; should I do?<BR>&gt;<BR>&gt; Thanks<BR>&gt;<BR>&gt; ?lt;br&gt;&gt;<BR>&gt; from reportlab.graphics.shapes import *<BR>&gt; from reportlab.graphics import renderPM,renderPDF<BR>&gt; from reportlab.graphics.renderPM import drawToFile<BR>&gt; from reportlab.lib import colors<BR>&gt; d=Drawing(100,100)<BR>&gt; d.add(String(40,40,'ddd',fontSize=10,fontName='STSong-Light-GB-EUC-H'))<BR>&gt; d.add(Line(10,30,40,40))<BR>&gt; renderPM.drawToFile(d,'fff.gif')<BR>&gt;<BR>&gt;
 ?lt;br&gt;&gt;<BR>&gt; the problems as following:<BR>&gt;<BR>&gt; Warn: Can't find .pfb for face 'STSong-Light'<BR>&gt; Traceback (most recent call last):<BR>&gt; ?File "C:\Documents and Settings\Administrator\ÀÃæ\RR.py", line 9, <BR>&gt; in ?<BR>&gt;   ?renderPM.drawToFile(d,'fff.gif')<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 535, in drawToFile<BR>&gt;   ?c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, <BR>&gt; showBoundary=showBoundary)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 521, in drawToPMCanvas<BR>&gt;   ?draw(d, c, 0, 0)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 64, in draw<BR>&gt;   ?R.draw(drawing, canvas, x, y)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 112, in draw<BR>&gt;   ?self.drawNode(drawing)<BR>&gt; ?File <BR>&gt;
 "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 127, in drawNode<BR>&gt;   ?self.drawNodeDispatcher(node)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", <BR>&gt; line 217, in drawNodeDispatcher<BR>&gt;   ?self.drawGroup(node)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderbase.py", <BR>&gt; line 241, in drawGroup<BR>&gt;   ?self.drawNode(node)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 124, in drawNode<BR>&gt;   ?self.push(node)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 82, in push<BR>&gt;   ?self.applyState()<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 95, in applyState<BR>&gt;   ?self._canvas.setFont(s['fontName'], s['fontSize'])<BR>&gt; ?File <BR>&gt;
 "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 343, in setFont<BR>&gt;   ?_setFont(self._gs,fontName,fontSize)<BR>&gt; ?File <BR>&gt; "E:\PYTHON22\lib\site-packages\reportlab\graphics\renderPM.py", <BR>&gt; line 247, in _setFont<BR>&gt;   ?raise RenderPMError, "Can't setFont(%s) missing the T1 <BR>&gt; files?\nOriginally %s: %s" % (fontName,s1,s2)<BR>&gt; RenderPMError: Can't setFont(STSong-Light-GB-EUC-H) missing the T1 <BR>&gt; files?<BR>&gt; Originally exceptions.AttributeError: CIDEncoding instance has no <BR>&gt; attribute 'vector'<BR>&gt;<BR>&gt; __________________________________________________<BR>&gt; Do You Yahoo!?<BR>&gt; Tired of spam? Yahoo! Mail has the best spam protection around <BR>&gt; http://mail.yahoo.com <BR><BR>-- <BR>Robin Becker<BR>_______________________________________________<BR>reportlab-users mailing list<BR>reportlab-users@reportlab.com<BR><A
 href="http://two.pairlist.net/mailman/listinfo/reportlab-users">http://two.pairlist.net/mailman/listinfo/reportlab-users</A></P>
<P>Thank you Robin</P>
<P>I have make .pdf which supporting Chinese ,but I want to convert it to .gif file, or I should make a .gif file which supporting Chinese,what shoule I do?</P>
<P>Thanks agian</P></BLOCKQUOTE></DIV></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com 
--0-721162175-1070875756=:6414--