* Andreas Tille <andr...@an3as.eu>, 2014-04-25, 16:08:
[Debian Python Modules Team <python-modules-t...@lists.alioth.debian.org> in CC since it maintains python-reportlab]

ITYM s/maintains/is in Uploaders of/. It makes a big difference here...

test_GraphicsBitmaps ... Warn: Can't find .pfb for face 'Times-Roman'
skipping. Check the fonts needed by ReportLab if you want bitmaps from 
Bio.Graphics
Can't setFont(Times-Roman) missing the T1 files?
Originally <type 'exceptions.TypeError'>: makeT1Font() argument 2 must be 
string, not None

Well, this was rather me forgetting a python-imaging dependency - I (wrongly) assumed that python-pil would be sufficient.

Note that python-imaging is only a compatibility package. It would be better to port biopython to the new PIL API.

So any idea how to get ".pfb for face 'Times-Roman'" found by reportlab
[…]
Unfortunately the result remained the same. I somehow came to the conclusion that the problem is caused by a broken reportlab package

I came to the same conclusion. I've attached what seems to be a minimal test-case:

$ python test.py
Warn: Can't find .pfb for face 'Times-Roman'
Traceback (most recent call last):
 File "test.py", line 6, in <module>
   renderPM.drawToFile(d, 'test.png', 'PNG')
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderPM.py", line 
655, in drawToFile
   c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL, 
showBoundary=showBoundary)
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderPM.py", line 
641, in drawToPMCanvas
   draw(d, c, 0, 0, showBoundary=showBoundary)
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderPM.py", line 
50, in draw
   R.draw(renderScaledDrawing(drawing), canvas, x, y, showBoundary=showBoundary)
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderbase.py", line 
198, in draw
   self.initState(x,y)  #this is the push()
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderPM.py", line 
99, in initState
   self.applyState()
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderPM.py", line 
93, in applyState
   self._canvas.setFont(s['fontName'], s['fontSize'])
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderPM.py", line 
374, in setFont
   _setFont(self._gs,fontName,fontSize)
 File "/usr/lib/python2.7/dist-packages/reportlab/graphics/renderPM.py", line 
227, in _setFont
   raise RenderPMError("Can't setFont(%s) missing the T1 files?\nOriginally %s: 
%s" % (fontName,s1,s2))
reportlab.graphics.renderPM.RenderPMError: Can't setFont(Times-Roman) missing 
the T1 files?
Originally <type 'exceptions.TypeError'>: makeT1Font() argument 2 must be 
string, not None


If I understand correctly, reportlab is trying to use non-free Adobe PostScript fonts, which (unsurprisingly) doesn't work on Debian systems. It should use the substitutes from the gsfonts package instead.

--
Jakub Wilk
from reportlab.graphics.shapes import Drawing
from reportlab.graphics import renderPM

d = Drawing(100, 100)
renderPM.drawToFile(d, 'test.png', 'PNG')

Reply via email to