[reportlab-users] problem with missing Times-Roman font

Robin Becker robin at reportlab.com
Wed Dec 24 05:24:23 EST 2008


Mark Zitnik wrote:

> Hi All,

>

> i have installed successfully reportlab on ubunto and tried to create

> VerticalBarChart

>

> but i'am missing Can't setFont(Times-Roman) missing the T1 files? and i can

> not find it.

>

> Please help.

>

> the code

>

> # code to produce the above chart

> from reportlab.graphics.shapes import Drawing

> from reportlab.lib import colors

> from reportlab.graphics.charts.barcharts import VerticalBarChart

> drawing = Drawing(400, 200)

> data = [

> (13, 5, 20, 22, 37, 45, 19, 4),

> (14, 6, 21, 23, 38, 46, 20, 5)

> ]

> bc = VerticalBarChart()

> #bc.setFont('Helvetica', 30)

> bc.x = 50

> bc.y = 50

> bc.height = 125

> bc.width = 300

> bc.data = data

> bc.strokeColor = colors.black

> bc.valueAxis.valueMin = 0

> bc.valueAxis.valueMax = 50

> bc.valueAxis.valueStep = 10

> bc.categoryAxis.labels.boxAnchor = 'ne'

> bc.categoryAxis.labels.dx = 8

> bc.categoryAxis.labels.dy = -2

> bc.categoryAxis.labels.angle = 30

> bc.categoryAxis.categoryNames = ['Jan-99','Feb-99','Mar-99',

> 'Apr-99','May-99','Jun-99','Jul-99','Aug-99']

> drawing.add(bc)

>

>

> drawing.save(formats=['gif'])



you need to down load the original pfb fonts for the standard 14 fonts and
unpack them into reportlab/fonts.


You can find them here

http://www.reportlab.com/ftp/pfbfer.zip
--
Robin Becker


More information about the reportlab-users mailing list