From 3e3270264fb49739144e4fefd6a55182ea9900cc Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 23 Nov 2010 17:20:02 +0200 Subject: [PATCH] trml2pdf: Fix using of custom fonts in reports That snippet of code practically meant "don't use anything but the standard fonts (by name) in the report". It obviously wanted to prevent the rml2pdf engine from crashing at a non-existent font. Well, if the report specifies a font that cannot be mapped by the system, it should preferably raise an exception (and ask us to fix the report), not silently ignore the font. Case 1: the internationalized reports, where font name is used to select a Unicode-capable font. Case 2: l10n_ch, where the OCR-B font had to be used (perhaps legal req.) bzr revid: p_christ@hol.gr-20101123152002-es404ul29rsohzqd --- bin/report/render/rml2pdf/trml2pdf.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py index cfbf21e33c8..1280f8e612b 100644 --- a/bin/report/render/rml2pdf/trml2pdf.py +++ b/bin/report/render/rml2pdf/trml2pdf.py @@ -485,11 +485,7 @@ class _rml_canvas(object): self.canvas.drawPath(self.path, **utils.attr_get(node, [], {'fill':'bool','stroke':'bool'})) def setFont(self, node): - from reportlab.pdfbase import pdfmetrics fname = node.get('name') - #TODO : other fonts should be supported - if fname not in pdfmetrics.standardFonts: - fname = self.canvas._fontname return self.canvas.setFont(fname, utils.unit_get(node.get('size'))) def render(self, node):