rml2pdf: better message if a font is not available.
Since 91422704d965268f, specifying a font that is not registered with pdfmetrics will raise an exception. Now, improve that exception to help the user understand what has gone wrong. Note: rather than hiding the fact that some font is missing, the admin should see this error and try to either fix the report (to use a known font), or register more fonts with the customfonts.py mechanism. bzr revid: p_christ@hol.gr-20101123153235-c1yri33ptaydb5eo
This commit is contained in:
@@ -486,7 +486,10 @@ class _rml_canvas(object):
|
||||
|
||||
def setFont(self, node):
|
||||
fname = node.get('name')
|
||||
return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
|
||||
try:
|
||||
return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
|
||||
except KeyError, e:
|
||||
raise KeyError('Font "%s" is not registered in the engine' % fname)
|
||||
|
||||
def render(self, node):
|
||||
tags = {
|
||||
|
||||
Reference in New Issue
Block a user