[reportlab-users] reportlab error

201 views
Skip to first unread message

Walid Bouazizi

unread,
Aug 27, 2013, 5:59:55 AM8/27/13
to reportl...@lists2.reportlab.com
Hi,
I have this piece of code that gives the following error

please help me




from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics import renderPM

d = Drawing(300, 200)

        chart = VerticalBarChart()
        chart.width = 260
        chart.height = 160
        chart.x = 20
        chart.y = 20
        chart.data = [[1,2], [3,4]]
        chart.categoryAxis.categoryNames = ['foo', 'bar']
        chart.valueAxis.valueMin = 0

        d.add(chart)
        #d.save(fnRoot='test', formats=['png', 'pdf'])
        renderPM.drawToFile(d, 'example.png', 'PNG')


File "reportlab\graphics\renderPM.pyo", line 651, in drawToFile
  File "reportlab\graphics\renderPM.pyo", line 637, in drawToPMCanvas
  File "reportlab\graphics\renderPM.pyo", line 50, in draw
  File "reportlab\graphics\renderbase.pyo", line 198, in draw
  File "reportlab\graphics\renderPM.pyo", line 93, in initState
  File "reportlab\graphics\renderPM.pyo", line 87, in applyState
  File "reportlab\graphics\renderPM.pyo", line 368, in setFont
  File "reportlab\graphics\renderPM.pyo", line 221, in _setFont
RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
Originally <type 'exceptions.TypeError'>: makeT1Font() argument 2 must be string, not None

Alberto Cabello Sánchez

unread,
Aug 27, 2013, 6:40:41 AM8/27/13
to reportlab-users
On Tue, Aug 27, 2013 at 10:59:55AM +0100, Walid Bouazizi wrote:
> Hi,
> I have this piece of code that gives the following error
>
> please help me
...
> RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
> Originally <type 'exceptions.TypeError'>: makeT1Font() argument 2 must be
> string, not None

Did you check this one ("Fixing font error in renderpm")?

http://john.parnefjord.se/node/51

--
-----------------------
Alberto Cabello Sánchez
alb...@unex.es
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users

Walid Bouazizi

unread,
Aug 27, 2013, 6:51:52 AM8/27/13
to reportlab-users
yes, I downloaded pfbfer.zip and I put it in the directory "C: \ Python27 \ Lib \ site-packages \ reportlab \ fonts" but still the same problem


2013/8/27 Alberto Cabello Sánchez <alb...@unex.es>

Alberto Cabello Sánchez

unread,
Aug 27, 2013, 7:28:33 AM8/27/13
to reportlab-users
On Tue, Aug 27, 2013 at 11:51:52AM +0100, Walid Bouazizi wrote:
> yes, I downloaded pfbfer.zip and I put it in the directory "C: \ Python27 \ Lib
> \ site-packages \ reportlab \ fonts" but still the same problem
>

I think reportlab is not finding PFB files. On GNU/Linux, I would use "strace"
to check where is it looking for them.

Alternatively, a not so old message in this same list mentions about re-running
"pip install reportlab":

http://two.pairlist.net/pipermail/reportlab-users/2011-January/009909.html
Reply all
Reply to author
Forward
0 new messages