[reportlab-users] some questions about renderPM
ÿffffcaÿffffbfÿffffb7ÿffffbc ÿffffcdÿfffff5
reportlab-users@reportlab.com
Fri, 16 Jan 2004 14:51:47 +0800 (CST)
--0-1882822178-1074235907=:47139
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8bit
Hi:
1 . Is renderPM supportting TTF fonts?
2 . You said: We have just gone through trying to get TTF fonts in via freetype 2
I want to know how to do it.
3 . If it supports TTF fonts ,is that meaning if I use Chinese TTF fonts (SIMHEI.TTF for example ) it also can work?
4 .in the renderPM script:
def _setFont(gs,fontName,fontSize):
try:
gs.setFont(fontName,fontSize)
except _renderPM.Error, errMsg:
if errMsg.args[0]!="Can't find font!": raise
#here's where we try to add a font to the canvas
try:
f = getFont(fontName)
_renderPM.makeT1Font(fontName,f.face.findT1Fil(),f.encoding.vector)
except:
s1, s2 = map(str,sys.exc_info()[:2])
raise RenderPMError, "Can't setFont(%s) missing the T1 files? \nOriginally %s: %s" % (fontName,s1,s2)
gs.setFont(fontName,fontSize)
is that meaning it only support type1 fonts
Thanks in advance
---------------------------------
Do You Yahoo!?
·±»ªÊÀ½çÀÈÃÎÒ¿´ÇåÄã
--0-1882822178-1074235907=:47139
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: 8bit
<DIV>
<DIV>Hi:</DIV>
<DIV>1 . Is renderPM supportting TTF fonts? </DIV>
<DIV>2 . You said: We have just gone through trying to get TTF fonts in via freetype 2</DIV>
<DIV>I want to know how to do it.</DIV>
<DIV>3 . If it supports TTF fonts ,is that meaning if I use Chinese TTF fonts (SIMHEI.TTF for example ) it also can work?</DIV>
<DIV>4 .in the renderPM script:</DIV>
<DIV>def _setFont(gs,fontName,fontSize):<BR> try:<BR> gs.setFont(fontName,fontSize)<BR> except _renderPM.Error, errMsg:<BR> if errMsg.args[0]!="Can't find font!": raise<BR> #here's where we try to add a font to the canvas<BR> try:<BR> f = getFont(fontName)<BR> _renderPM.makeT1Font(fontName,f.face.findT1Fil(),f.encoding.vector)<BR> except:<BR> s1, s2 = map(str,sys.exc_info()[:2])<BR> raise RenderPMError, "Can't setFont(%s) missing the T1 files? \nOriginally %s: %s" %
(fontName,s1,s2)<BR> gs.setFont(fontName,fontSize)</DIV>
<DIV> is that meaning it only support type1 fonts</DIV>
<DIV>Thanks in advance</DIV></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-1882822178-1074235907=:47139--