[reportlab-users] Can't find .pfb for face 'Times-Roman'
Max M
maxm at mxm.dk
Thu May 26 06:12:05 EDT 2005
I am trying out reportlab for the first time. I have succesfully
installed it on Windows XP.
So I am trying out the simple programme in the beginning of the user guide.
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(150,100, 'Hellø Wårld',
fontSize=18, fillColor=colors.red, font='rina'))
# save to pdf
from reportlab.graphics import renderPDF
renderPDF.drawToFile(d, 'example1.pdf', 'My First Drawing')
# save to png
from reportlab.graphics import renderPM
renderPM.drawToFile(d, 'example1.png', 'PNG')
When I try to save as png I get this (shortened) traceback:
Warn: Can't find .pfb for face 'Times-Roman'
Traceback (most recent call last):
...
reportlab.graphics.renderPM.RenderPMError: Can't
setFont(Times-Roman) missing the T1 files?
I have googled aroound and it seems that I am missing the 'Times-Roman'
file '_er_____.pfb'.
I have downloaded the latest version of Acrobat (7.01) but the file is
not in it's font path. Neither was it in the old 6.0 path. Or anywhere
else on my c: drive.
I cannot find the '_er_____.pfb' file on adobe.com, or anywhere else on
the web for that matter.
So I wonder if there is a workaround... to use another default font, to
set the font directly or where to download it from?
BTW: there is probably a bug in the documentation in the begining of the
user guide:
from reportlab.graphics import renderPM
renderPM.saveToFile(d, 'example1.png', 'PNG')
I believe it should be:
from reportlab.graphics import renderPM
renderPM.drawToFile(d, 'example1.png', 'PNG')
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
More information about the reportlab-users
mailing list