[reportlab-users] bug in graphics/renderPDF.py
Robin Becker
robin at reportlab.com
Fri Sep 25 08:43:25 EDT 2009
Volker Haas wrote:
> When rendering a drawing with renderPDF.drawToFile() the font
> "Times-Roman" is always reported as being used in the document. This is
> a problem if all fonts need to be embedded in the PDF.
>
> The problem is the hardcoded fontname "Times-Roman" instead of
> rl_config.defaultGraphicsFontName.
>
> The following patch solves the problem for me:
>
> @@ -260 +260 @@ def drawToFile(d, fn, msg="",
> showBoundary=rl_config._unset_, autoSize=1):
> - c.setFont('Times-Roman', 36)
> + c.setFont(rl_config.defaultGraphicsFontName, 36)
> @@ -269 +269 @@ def drawToFile(d, fn, msg="",
> showBoundary=rl_config._unset_, autoSize=1):
> - c.setFont('Times-Roman', 12)
> + c.setFont(rl_config.defaultGraphicsFontName, 12)
>
> Attached is a minimal example that shows the problem (to make the
> example work, the font location needs to be specified correctly...).
>
........
thanks for the report. I guess we need to fix that and also to make the string
drawing conditional on whether there is actually any msg value.
--
Robin Becker
More information about the reportlab-users
mailing list