[reportlab-users] RenderPM in 1.1.9

ÿffffcaÿffffbfÿffffb7ÿffffbc ÿffffcdÿfffff5 reportlab-users@reportlab.com
Thu, 29 Jan 2004 14:00:19 +0800 (CST)


--0-746731467-1075356019=:74824
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit

Hi:
1   In reportlab 1.1.9 said: Support for True Type Fonts in renderPM.
     Can you tell me how to use it?
     I do it as following;
     from reportlab  import *
     from reportlab.graphics import renderPM
     from reportlab.pdfbase import pdfmetrics
     from reportlab.pdfbase.ttfonts import TTFont
     pdfmetrics.registerFont(TTFont('comic', 'georgia.ttf'))
     from reportlab.lib import colors
     from reportlab.graphics.shapes import *
    d = Drawing(400,200)
    d.add(Rect(50,50,300,100, fillColor=colors.yellow))
    d.add(String(30,50,'jjj',fontName='GOTHIC.TTF'))
    renderPM.drawToFile(d, 'out.jpg', 'JPG')
The resualt is:
  RenderPMError: Can't setFont(GOTHIC.TTF) missing the T1 files?
  Originally exceptions.KeyError: GOTHIC.TTF
  GOTHIC.TTF is in c:\winnt\fonts
2   How could I draw some 3dchart,can you give me some examples/
 Thanks in advance




---------------------------------
Do You Yahoo!?
·±»ªÊÀ½çÀÈÃÎÒ¿´ÇåÄã
--0-746731467-1075356019=:74824
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: 8bit

<DIV>Hi:</DIV>
<DIV>1 &nbsp; In reportlab 1.1.9 said: Support for True Type Fonts in renderPM.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; Can you tell me how to use it?</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I do it as following;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; from reportlab&nbsp; import *<BR>&nbsp;&nbsp;&nbsp;&nbsp; from reportlab.graphics import renderPM<BR>&nbsp;&nbsp;&nbsp;&nbsp; from reportlab.pdfbase import pdfmetrics<BR>&nbsp;&nbsp;&nbsp;&nbsp; from reportlab.pdfbase.ttfonts import TTFont<BR>&nbsp;&nbsp;&nbsp;&nbsp; pdfmetrics.registerFont(TTFont('comic', 'georgia.ttf'))<BR>&nbsp;&nbsp;&nbsp;&nbsp; from reportlab.lib import colors<BR>&nbsp;&nbsp;&nbsp;&nbsp; from reportlab.graphics.shapes import *<BR>&nbsp;&nbsp;&nbsp; d = Drawing(400,200)<BR>&nbsp;&nbsp;&nbsp; d.add(Rect(50,50,300,100, fillColor=colors.yellow))<BR>&nbsp;&nbsp;&nbsp; d.add(String(30,50,'jjj',fontName='GOTHIC.TTF'))<BR>&nbsp;&nbsp;&nbsp; renderPM.drawToFile(d, 'out.jpg', 'JPG')</DIV>
<DIV>The resualt is:</DIV>
<DIV>&nbsp; RenderPMError: Can't setFont(GOTHIC.TTF) missing the T1 files?<BR>&nbsp; Originally exceptions.KeyError: GOTHIC.TTF</DIV>
<DIV>&nbsp; GOTHIC.TTF is in c:\winnt\fonts</DIV>
<DIV>2&nbsp;&nbsp; How could I draw some 3dchart,can you give me some examples/</DIV>
<DIV>&nbsp;Thanks in advance<BR></DIV><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.surveys.yahoo.com/cn_user_profile_study_dec2003" target=blank>·±»ªÊÀ½çÀÈÃÎÒ¿´ÇåÄã</a>
--0-746731467-1075356019=:74824--