Package: python-reportlab
Version: 2.5-1.1
Severity: important
Tags: upstream
Dear Maintainer,
I was trying to have some TTF fonts available for PDF generation.
* What exactly did you do (or not do) that was effective (or ineffective)?
Adding the following block at the beginning (global) of my python class:
import reportlab.rl_config
reportlab.rl_config.warnOnMissingFontGlyphs = 0
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont('LiberationSN', 'LiberationSansNarrow-
Regular.ttf'))
* What was the outcome of this action?
A crash. So, I add a line where it seems logical into:
/usr/lib/python2.7/dist-packages/reportlab/pdfbase/ttfonts.py
Log line #165:
print("LOG ======>>>>>> REPORTLAB_ttfonts.py L#165: TTF file = %s" % fn)
Here is the crash log (there are 2 calls instead of only one, and the 2nd's
empty, which lead me to think it is a loop PB ):
$ python pxpdf_UTILISE_REPORTLAB_ET_AUTOMATISE_LES_CADRES-
TABLES___COPIE_de_TRAVAIL.py
LOG ======>>>>>> REPORTLAB_ttfonts.py L#165: TTF file = LiberationSansNarrow-
Regular.ttf
LOG ======>>>>>> REPORTLAB_ttfonts.py L#165: TTF file =
Traceback (most recent call last):
File "pxpdf_UTILISE_REPORTLAB_ET_AUTOMATISE_LES_CADRES-
TABLES___COPIE_de_TRAVAIL.py", line 984, in <module>
font="LiberationSN", fontsize=10)
File "pxpdf_UTILISE_REPORTLAB_ET_AUTOMATISE_LES_CADRES-
TABLES___COPIE_de_TRAVAIL.py", line 76, in __init__
self.setfont( self.fontname, self.fontsize )
File "pxpdf_UTILISE_REPORTLAB_ET_AUTOMATISE_LES_CADRES-
TABLES___COPIE_de_TRAVAIL.py", line 191, in setfont
reportlab.pdfbase.ttfonts.TTFont( font, fontfile ) )
File "/usr/lib/python2.7/dist-packages/reportlab/pdfbase/ttfonts.py", line
1010, in __init__
self.face = TTFontFace(filename, validate=validate,
subfontIndex=subfontIndex)
File "/usr/lib/python2.7/dist-packages/reportlab/pdfbase/ttfonts.py", line
916, in __init__
TTFontFile.__init__(self, filename, validate=validate,
subfontIndex=subfontIndex)
File "/usr/lib/python2.7/dist-packages/reportlab/pdfbase/ttfonts.py", line
413, in __init__
TTFontParser.__init__(self, file,
validate=validate,subfontIndex=subfontIndex)
File "/usr/lib/python2.7/dist-packages/reportlab/pdfbase/ttfonts.py", line
190, in __init__
self.readFile(file)
File "/usr/lib/python2.7/dist-packages/reportlab/pdfbase/ttfonts.py", line
264, in readFile
self.filename, f = TTFOpenFile(f)
File "/usr/lib/python2.7/dist-packages/reportlab/pdfbase/ttfonts.py", line
176, in TTFOpenFile
raise TTFError('Can\'t open file "%s"' % fn)
reportlab.pdfbase.ttfonts.TTFError: Can't open file ""
* What outcome did you expect instead?
No crash, the wanted TTF available, cigar, Cognac and rollmops.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 3.1.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-reportlab depends on:
ii python 2.7.2-9
ii python2.6 2.6.7-4
ii python2.7 2.7.2-9
Versions of packages python-reportlab recommends:
ii python-imaging 1.1.7-4
ii python-renderpm 2.5-1.1
ii python-reportlab-accel 2.5-1.1
Versions of packages python-reportlab suggests:
ii evince-gtk [pdf-viewer] 3.2.1-1
ii gv [pdf-viewer] 1:3.7.3-1
ii python-egenix-mxtexttools <none>
ii python-reportlab-doc 2.5-1.1
-- no debconf information
-- debsums errors found:
debsums: changed file /usr/share/pyshared/reportlab/pdfbase/ttfonts.py (from
python-reportlab package)
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]