[Zope] How to load PIL fonts

Thomas B. Passin tpassin@mitretek.org
Thu, 11 Oct 2001 10:40:18 -0400


[Chris Fenton]

>     The following snippet bothers me.
>     Run from the command line OK, from within Zope :- File not found ???
>
>     In my sitecustomize.py file I have appended the font directory to
> pythons path  "C:\\py21\\fonts\\100".
>     I did this both for my python2.1 executable and the zope python
> executable.
>     I checked sys.path it has been appended.
>     Yet run the snippet from python the font file is found, but as an
> external method it is not ???

Here's something that has bitten me several times and may be the cause here.
When you run it "externally", you are probably using an ordinary Python
installation, not Zope's.  Zope uses its own, and no matter what sys.path
you may have set for the Python installation, the Zope version won't know
about it.

For example, I use .pth files to set Python's path.  I have to copy them to
Zope's Python directory for Zope to find them.  The same applies for the
location of binaries that Python finds because they are in the Python tree.
You have to copy them to corresponding places in the Zope Python tree or
Zope won't find them.

Anything that is in the environment or in operating system paths, Zope ought
to be able to find as well as the regular Python interpreter, but not the
others.

Give it a try.

Cheers,

Tom P