[reportlab-users] RenderPM in 1.1.9
Andy Robinson
reportlab-users@reportlab.com
Thu, 29 Jan 2004 07:49:15 -0000
You registered the font name 'comic' to the
file in the local directory 'georgia.ttf'. Then
you asked for GOTHIC. That's the prioblem.
Try this:
pdfmetrics.registerFont(TTFont(GOTHIC', 'c:\\winnt\\fonts\\gothic.ttf'))
d.add(String(30,50,'jjj',fontName='GOTHIC'))
It doesn't auto-search the Windows font directory.
Hope this helps,
Andy Robinson
-----Original Message-----
From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com]On Behalf Of
ÿffffcaÿffffbfÿffffb7ÿffffbc ÿffffcdÿfffff5
Sent: 29 January 2004 06:00
To: reportlab-users@reportlab.com
Subject: [reportlab-users] RenderPM in 1.1.9
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!?
·±»ªÊÀ½çÀÈÃÎÒ¿´ÇåÄã