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