[reportlab-users] Problem using FAQ example for embedding font

Gerry Reno greno at verizon.net
Sat Sep 13 10:00:59 EDT 2008


Ok, I try this as well:

I changed this line:
justFont = pdfmetrics.Font('GnuMICR', faceName, 'WinAnsiEncoding')

to this which makes even more sense:
justFont = pdfmetrics.Font('GnuMICR', faceName, 'GnuMICREncoding')

but now I get this error:

testing for existence of MICR font files...
afmFile = addons/l10n_micr/fonts/GnuMICR.afm
pfbFile = addons/l10n_micr/fonts/GnuMICR.pfb
debug: enc = <reportlab.pdfbase.pdfmetrics.Encoding instance at 0x926c9cc>
debug: _encodings[enc.name] = <reportlab.pdfbase.pdfmetrics.Encoding
instance at 0x8dc5cec>
Sat, 13 Sep 2008 09:56:15 ERROR:web-services:Exception in call:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/tinyerp-server/netsvc.py", line
317, in run
r=m(*msg[2:])
File
"/usr/lib/python2.5/site-packages/tinyerp-server/service/web_services.py",
line 422, in execute
return self._execute(db, uid, wiz_id, datas, action, context)
File
"/usr/lib/python2.5/site-packages/tinyerp-server/service/web_services.py",
line 402, in _execute
return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
File
"/usr/lib/python2.5/site-packages/tinyerp-server/wizard/__init__.py",
line 160, in execute
res = self.execute_cr(cr, uid, data, state, context)
File
"/usr/lib/python2.5/site-packages/tinyerp-server/wizard/__init__.py",
line 75, in execute_cr
action_res = action(self, cr, uid, data, context)
File
"/usr/lib/python2.5/site-packages/tinyerp-server/addons/base/module/wizard/wizard_update_module.py",
line 57, in _update_module
update, add =
pooler.get_pool(cr.dbname).get('ir.module.module').update_list(cr, uid)
File
"/usr/lib/python2.5/site-packages/tinyerp-server/addons/base/module/module.py",
line 388, in update_list
imp.load_module(name, *imp.find_module(mod_name))
File
"/usr/lib/python2.5/site-packages/tinyerp-server/addons/l10n_micr/__init__.py",
line 59, in <module>
justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile)
File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py",
line 480, in __init__
self._loadMetrics(afmFileName)
File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py",
line 541, in _loadMetrics
registerEncoding(enc)
File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py",
line 599, in registerEncoding
raise FontError('Encoding "%s" already registered with a different name
vector!' % enc.name)
FontError: Encoding "GnuMICREncoding" already registered with a
different name vector!

????

Regards,
Gerry



More information about the reportlab-users mailing list