[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&nbsp;&nbsp; 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 .&nbsp; 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>&nbsp;&nbsp;&nbsp; try:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gs.setFont(fontName,fontSize)<BR>&nbsp;&nbsp;&nbsp; except _renderPM.Error, errMsg:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if errMsg.args[0]!="Can't find font!": raise<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #here's where we try to add a font to the canvas<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f = getFont(fontName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_renderPM.makeT1Font(fontName,f.face.findT1Fil(),f.encoding.vector)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s1, s2 = map(str,sys.exc_info()[:2])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise RenderPMError, "Can't setFont(%s) missing the T1 files? \nOriginally %s: %s" %
 (fontName,s1,s2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gs.setFont(fontName,fontSize)</DIV>
<DIV>&nbsp;&nbsp; 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--