[reportlab-users] Problem using FAQ example for embedding font
Gerry Reno
greno at verizon.net
Sat Sep 13 09:53:07 EDT 2008
I changed this line:
justFont = pdfmetrics.Font('GnuMICR', faceName, 'WinAnsiEncoding')
to this which makes more sense:
justFont = pdfmetrics.Font('GnuMICR', faceName, 'FontSpecific')
but now I get this error:
Traceback (most recent call last):
File "./tinyerp-server.py", line 170, in <module>
addons.register_classes()
File
"/usr/lib/python2.5/site-packages/tinyerp-server/addons/__init__.py",
line 250, in register_classes
imp.load_module(m, *imp.find_module(m))
File
"/usr/lib/python2.5/site-packages/tinyerp-server/addons/l10n_micr/__init__.py",
line 64, in <module>
justFont = pdfmetrics.Font('GnuMICR', faceName, 'FontSpecific')
File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py",
line 360, in __init__
self.encoding= getEncoding(encName)
File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py",
line 652, in getEncoding
return _encodings[encName]
KeyError: 'FontSpecific'
So what can I do to get pdfmetrics.py to process a non-standard single
byte font with font specific encoding?
Regards,
Gerry
More information about the reportlab-users
mailing list