Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1059326: python3-reportlab: Can't set standard fonts

39 views
Skip to first unread message

Sebastien Delafond

unread,
Dec 22, 2023, 9:50:05 AM12/22/23
to
Package: python3-reportlab
Version: 3.6.12-1
Severity: normal

Control: notfound -1 4.0.8-1
Control: found -1 3.6.12-1

This is the same type of issue as archived bug
https://bugs.debian.org/1029683, and I'm filing this new one to make
it clear python3-reportlab in bookworm is affected.

Here's a short reproducer :

from reportlab.graphics.barcode import createBarcodeDrawing
barcode = createBarcodeDrawing('QR',value='test')
barcode.asString('png')

And the associated error :

,----
| Warn: Can't find .pfb for face 'Times-Roman'
| Traceback (most recent call last):
| File "/opt/test-reportlab-bug.py", line 7, in <module>
| barcode.asString('png')
| File "/usr/lib/python3/dist-packages/reportlab/graphics/shapes.py",
| line 807, in asString
| return renderPM.drawToString(self,
| fmt=format,showBoundary=getattr(self,'showBorder',
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py",
| line 696, in drawToString
| drawToFile(d,s,fmt=fmt, dpi=dpi, bg=bg,
| configPIL=configPIL,backend=backend)
| File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py",
| line 691, in drawToFile
| c = drawToPMCanvas(d, dpi=dpi, bg=bg, configPIL=configPIL,
| showBoundary=showBoundary,backend=backend)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py",
| line 677, in drawToPMCanvas
| draw(d, c, 0, 0, showBoundary=showBoundary)
| File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py",
| line 66, in draw
| R.draw(renderScaledDrawing(drawing), canvas, x, y,
| showBoundary=showBoundary)
| File
| "/usr/lib/python3/dist-packages/reportlab/graphics/renderbase.py",
| line 185, in draw
| self.initState(x,y) #this is the push()
| ^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py",
| line 113, in initState
| self.applyState()
| File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py",
| line 107, in applyState
| self._canvas.setFont(s['fontName'], s['fontSize'])
| File "/usr/lib/python3/dist-packages/reportlab/graphics/renderPM.py",
| line 405, in setFont
| _setFont(self._gs,fontName,fontSize)
| File "/usr/lib/python3/dist-packages/reportlab/graphics/utils.py",
| line 42, in setFont
| _errorDump(fontName,fontSize)
| File "/usr/lib/python3/dist-packages/reportlab/graphics/utils.py",
| line 29, in _errorDump
| rl_exec(code,dict(RenderPMError=RenderPMError))
| File "<string>", line 1, in <module>
`----

Cheers,

--
Seb

Sébastien Delafond

unread,
Dec 22, 2023, 10:00:04 AM12/22/23
to
Control: fixed 1059326 4.0.8-1

The earliest fixed version is most likely between 4.0.4-7 and 4.0.4-11.

Cheers,

--
Seb

Sébastien Delafond

unread,
Dec 22, 2023, 10:20:05 AM12/22/23
to
In case someone out there is stuck real bad with this bug in bookworm,
here's a very nasty workaround for which I of course decline all
responsibility:

$ mkdir /usr/share/fonts/type1/gsfonts
$ ln -sf /usr/share/fonts/X11/Type1/C059-Roman.pfb /usr/share/fonts/type1/gsfonts/n021003l.pfb

Cheers,

--
Seb
0 new messages