[reportlab-users] user manual updates

Robin Becker robin at reportlab.com
Tue Mar 8 07:46:50 EST 2011


On 07/03/2011 21:40, Brenda J. Butler wrote:

>

> Two things: a documentation comment and a question.

>

> ** Documentation comment:

> I'm trying out ReportLab, and I'm looking at the manual "ReportLab PDF Library

> Users Guide" (ReportLab Version 2.5 Document generated on 2011/03/03 03:38:57).

>


Apparently it has been merged.



> My goal is that I want to embed some charts in a web page.

>

> In chapter 2 (section 2.17) it mentions that charts are covered in a separate

> document, "The ReportLab Graphics Library". I wonder if that document has been

> merged into the document I'm reading as Chapter 11, or if it is still a separate

> document? If separate, where can I get it?

>

>

> ** Question:

> About the ArialMT font - I got the font zip file and unpacked it into the

> reportlab font directory, but I still cannot use the Arial font.

>

> More details:

> The file I got was: http://www.reportlab.org/ftp/fonts/pfbfer.zip

> I unpacked it into

> /usr/local/pythonenv/CLIENTPORTAL/lib/python2.5/site-packages/reportlab/fonts.

> I'm using a virtualenv for python, so

> /usr/local/pythonenv/CLIENTPORTAL/lib/python2.5/site-packages is on the python

> path (and the system site-packages is not).

>


The pfbfer.zip file just contains the pfb and afm files for the standard 14
fonts so no arial etc etc.
........

I'm fairly sure there are packages that make the M$ fonts available in debian,
but we need access to the font files. The usual way is to register the TTFont
object.

from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase.pdfmetrics import registerFont

registerFont(TTFont("arial", "/path/to/arial.ttf"))

you should then be able to use the name "arial" etc etc.

There is a way to just use the filename so that TTFont("arial", "arial.ttf")
would also find the right file. The TTFSearchPath defined in rl_config will be
searched for a file of the right name. We probably need to add the standard
debian locations there. Currently we don't support searching by the font's
postscript name.
--
Robin Becker


More information about the reportlab-users mailing list