Your message dated Mon, 11 Aug 2014 21:56:39 +0000 with message-id <[email protected]> and subject line Bug#745985: fixed in python-reportlab 3.1.8-2 has caused the Debian Bug report #745985, regarding reportlab.graphics.renderPM.RenderPMError: Can't setFont(Times-Roman) missing the T1 files? to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 745985: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745985 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Source: python-reportlab Version: 3.0-1 Severity: important Tags: patch renderPM fails to find (replacements for) standard PostScript fonts: $ python test-minimal.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 NoneI've attached patch that makes renderPM use the replacement from the gsfont package. You should also add gsfonts to Recommends or Depends somewhere.I've also attached a script (test-fonts.py) that I used to verify that after patching renderPM is able to find all the fonts correctly.-- Jakub Wilk--- a/src/reportlab/pdfbase/_fontdata.py +++ b/src/reportlab/pdfbase/_fontdata.py @@ -54,46 +54,22 @@ } #this maps fontnames to the equivalent filename root. -_font2fnrMapWin32 = { - 'symbol': 'sy______', - 'zapfdingbats': 'zd______', - 'helvetica': '_a______', - 'helvetica-bold': '_ab_____', - 'helvetica-boldoblique': '_abi____', - 'helvetica-oblique': '_ai_____', - 'times-bold': '_eb_____', - 'times-bolditalic': '_ebi____', - 'times-italic': '_ei_____', - 'times-roman': '_er_____', - 'courier-bold': 'cob_____', - 'courier-boldoblique': 'cobo____', - 'courier': 'com_____', - 'courier-oblique': 'coo_____', - } -if sys.platform in ('linux2',): - _font2fnrMapLinux2 ={ - 'symbol': 'Symbol', - 'zapfdingbats': 'ZapfDingbats', - 'helvetica': 'Arial', - 'helvetica-bold': 'Arial-Bold', - 'helvetica-boldoblique': 'Arial-BoldItalic', - 'helvetica-oblique': 'Arial-Italic', - 'times-bold': 'TimesNewRoman-Bold', - 'times-bolditalic':'TimesNewRoman-BoldItalic', - 'times-italic': 'TimesNewRoman-Italic', - 'times-roman': 'TimesNewRoman', - 'courier-bold': 'Courier-Bold', - 'courier-boldoblique': 'Courier-BoldOblique', - 'courier': 'Courier', - 'courier-oblique': 'Courier-Oblique', - } - _font2fnrMap = _font2fnrMapLinux2 - for k, v in _font2fnrMap.items(): - if k in _font2fnrMapWin32.keys(): - _font2fnrMapWin32[v.lower()] = _font2fnrMapWin32[k] - del k, v -else: - _font2fnrMap = _font2fnrMapWin32 +_font2fnrMap = { + 'symbol': 's050000l', + 'zapfdingbats': 'd050000l', + 'helvetica': 'n019003l', + 'helvetica-bold': 'n019004l', + 'helvetica-oblique': 'n019023l', + 'helvetica-boldoblique': 'n019024l', + 'times-roman': 'n021003l', + 'times-bold': 'n021004l', + 'times-italic': 'n021023l', + 'times-bolditalic': 'n021024l', + 'courier': 'n022003l', + 'courier-bold': 'n022004l', + 'courier-oblique': 'n022023l', + 'courier-boldoblique': 'n022024l', +} def _findFNR(fontName): return _font2fnrMap[fontName.lower()] @@ -109,19 +85,6 @@ del T1SearchPath, rl_isfile def findT1File(fontName,ext='.pfb'): - if sys.platform in ('linux2',) and ext=='.pfb': - try: - f = _searchT1Dirs(_findFNR(fontName)) - if f: return f - except: - pass - - try: - f = _searchT1Dirs(_font2fnrMapWin32[fontName.lower()]+ext) - if f: return f - except: - pass - return _searchT1Dirs(_findFNR(fontName)+ext) # this lists the predefined font encodings - WinAnsi and MacRoman. We havefrom reportlab.graphics.shapes import Drawing from reportlab.graphics import renderPM d = Drawing(100, 100) renderPM.drawToFile(d, 'test.png', 'PNG')# encoding=UTF-8 from reportlab.graphics.shapes import Drawing, String from reportlab.graphics import renderPM from reportlab.pdfbase._fontdata import standardFonts as fonts try: unichr except NameError: unichr = chr d = Drawing(800, 50 * len(fonts)) for i, font in enumerate(fonts): if font == 'Symbol': text = 'Συμβολο' elif font == 'ZapfDingbats': text = ''.join( unichr(0x2710 + i) for i, ch in enumerate(text) ) else: text = font s = String(0, i * 50, text) s.fontName = font s.fontSize = 50 d.add(s) renderPM.drawToFile(d, 'test-fonts.png', 'PNG')
--- End Message ---
--- Begin Message ---Source: python-reportlab Source-Version: 3.1.8-2 We believe that the bug you reported is fixed in the latest version of python-reportlab, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Matthias Klose <[email protected]> (supplier of updated python-reportlab package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 1.8 Date: Mon, 11 Aug 2014 23:31:24 +0200 Source: python-reportlab Binary: python-reportlab python-reportlab-accel python-reportlab-accel-dbg python-renderpm python-renderpm-dbg python3-reportlab python3-reportlab-accel python3-reportlab-accel-dbg python3-renderpm python3-renderpm-dbg python-reportlab-doc Architecture: source all amd64 Version: 3.1.8-2 Distribution: unstable Urgency: medium Maintainer: Matthias Klose <[email protected]> Changed-By: Matthias Klose <[email protected]> Description: python-renderpm - python low level render interface python-renderpm-dbg - python low level render interface (debug extension) python-reportlab - ReportLab library to create PDF documents using Python python-reportlab-accel - C coded extension accelerator for the ReportLab Toolkit python-reportlab-accel-dbg - C coded extension accelerator for the ReportLab Toolkit python-reportlab-doc - Documentation for the ReportLab Python library (PDF format) python3-renderpm - python low level render interface python3-renderpm-dbg - python low level render interface (debug extension) python3-reportlab - ReportLab library to create PDF documents using Python3 python3-reportlab-accel - C coded extension accelerator for the ReportLab Toolkit python3-reportlab-accel-dbg - C coded extension accelerator for the ReportLab Toolkit Closes: 745985 Changes: python-reportlab (3.1.8-2) unstable; urgency=medium . * Let renderPM find (replacements for) standard PostScript fonts (Jakub Wilk). Closes: #745985. * python{,3}-renderpm: Recommend gsfonts. Checksums-Sha1: 2ce7422ed5d7d5c8edb9d205816d6d1fc29a28ce 2187 python-reportlab_3.1.8-2.dsc b822bbe5a838fdff41503b38800c27cfb41530f9 10860 python-reportlab_3.1.8-2.debian.tar.xz 1ee62d955afc08b06127882a21352d0cdef226d2 453006 python-reportlab_3.1.8-2_all.deb 48238d8ee207c8ba6a85ace6e0febfa50f3718a3 449646 python3-reportlab_3.1.8-2_all.deb 00214aaaf85bf25c9bbe49ebe0164c3001317706 604294 python-reportlab-doc_3.1.8-2_all.deb 259f93ed67b0d251d08a769683b739707fbf0d34 25410 python-reportlab-accel_3.1.8-2_amd64.deb c0418234ac4a8f3c902bdbbc17652125f0fc71be 60756 python-reportlab-accel-dbg_3.1.8-2_amd64.deb bc06b9fab6f873c68898aeba76522a3dc50c44c9 35112 python-renderpm_3.1.8-2_amd64.deb 2ad5d53b657c43474a123384455cb098c0234f18 102244 python-renderpm-dbg_3.1.8-2_amd64.deb e7abb4f89790abcd915fe61a898c63b2ee964f48 20978 python3-reportlab-accel_3.1.8-2_amd64.deb e1277563d481de5c4e20aa27324ee0499b532c4b 49520 python3-reportlab-accel-dbg_3.1.8-2_amd64.deb bd45258838ffcdf7e34bf69c725f6c25c19b632b 35628 python3-renderpm_3.1.8-2_amd64.deb 87dbd9272b570f6746f36b31b7622b728c9a9f52 104724 python3-renderpm-dbg_3.1.8-2_amd64.deb Checksums-Sha256: 332d4ccea523af0e9dd310eb1707a1aeb7c7a4546822b9963b24f22892bb9b84 2187 python-reportlab_3.1.8-2.dsc 1846305ea60d807563dc54b288a9482d6427eb67719bcc9a3b866ef5b231c491 10860 python-reportlab_3.1.8-2.debian.tar.xz 2107f8586de4934d76d6f91f166e56c23c5a296e0f86b53712f949daeadc2d2d 453006 python-reportlab_3.1.8-2_all.deb f0309c677e70b397b1062bdae6acdefc125a6579537ad6d06602309969059b24 449646 python3-reportlab_3.1.8-2_all.deb a1d5e03c54cc5301184b13cffe2c616295af177aad5893e5e2a7a0baf3eb740a 604294 python-reportlab-doc_3.1.8-2_all.deb ff6401669fd2e7aa3581e2d659964e637c595bf3a4077ae57aae02bdbf19e0b9 25410 python-reportlab-accel_3.1.8-2_amd64.deb ff95d6d8c7b1e5a320f72365ef825778e78108cc1dcd9bd914530abce3cd69ef 60756 python-reportlab-accel-dbg_3.1.8-2_amd64.deb 9dbe11dce88824736146566da4a27ef0fac70b41519fb823949f2e36f763b9ca 35112 python-renderpm_3.1.8-2_amd64.deb dd7ebf1e533b845449505552775e68b95e9708e47b5ae2656013fc40da5bc00e 102244 python-renderpm-dbg_3.1.8-2_amd64.deb c6d0f718eae549e976bdea3b2b042c65429f43080181089d0c2eb7c5e1d59a3d 20978 python3-reportlab-accel_3.1.8-2_amd64.deb 3d1afb55143096f96df82c5dea9ac7c6387d8a2172ba6ff2e55191404a3c8ce7 49520 python3-reportlab-accel-dbg_3.1.8-2_amd64.deb 0d53be938ae6728085aa6b618eca5858ed31a0c557203558c6b41d09bb12b662 35628 python3-renderpm_3.1.8-2_amd64.deb 9b4a0f1ca8dc53b98264afd457c27027f19347b6b4a1d33315af2eea61f4af9c 104724 python3-renderpm-dbg_3.1.8-2_amd64.deb Files: fe07fd3a6accf66b11918ecfd8bdc5aa 453006 python optional python-reportlab_3.1.8-2_all.deb c8fafeb05f2153e49595080b856a47d9 449646 python optional python3-reportlab_3.1.8-2_all.deb e3b70445a28f7d2cd95d95a18f870bea 604294 doc optional python-reportlab-doc_3.1.8-2_all.deb 5fec5b9bb1a925bfac080bbef2322499 25410 python optional python-reportlab-accel_3.1.8-2_amd64.deb fdd65631be1ce01add0d27688851fff8 60756 debug extra python-reportlab-accel-dbg_3.1.8-2_amd64.deb 16f037e286ee88ef8b7b3918df673a4e 35112 python optional python-renderpm_3.1.8-2_amd64.deb fd4d60c21b0663f3de14e24651e30080 102244 debug extra python-renderpm-dbg_3.1.8-2_amd64.deb 82cf549dacffe51ba48dfd17accbc9b8 20978 python optional python3-reportlab-accel_3.1.8-2_amd64.deb 2a9ac3ebdfae2326c1e79d10918734b2 49520 debug extra python3-reportlab-accel-dbg_3.1.8-2_amd64.deb 24d05b838388802d0e53adbb53e336fb 35628 python optional python3-renderpm_3.1.8-2_amd64.deb 83249812ca0e42d0ac25c142330ea4f9 104724 debug extra python3-renderpm-dbg_3.1.8-2_amd64.deb 45167f43e00796242592a51e28ce1a71 2187 python optional python-reportlab_3.1.8-2.dsc 5a3e9eff83bf649f433d47bc63568e91 10860 python optional python-reportlab_3.1.8-2.debian.tar.xz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlPpN50ACgkQStlRaw+TLJyqJQCdFDu9382TNCgnJmQO46EbPCDn 50EAn21eMVSryIIiusrNTTw+bAhu32FU =/3ci -----END PGP SIGNATURE-----
--- End Message ---

