Python Imaging Library and fonts

Fredrik Lundh fredrik at pythonware.com
Sun Dec 16 07:51:01 EST 2001


Bob Greschke wrote:
> How do I convey to the PIL font stuff that I want it to use the
> same font as the rest of the frame for its labels and such?  PIL
> wants to start with font files.  I can't seem to find the connection.

there is no connection: Tk uses the window system's
font renderer, PIL's ImageFont package uses platform-
independent bitmap font files.

you have to add some code to map Tkinter font strings
to the font files you have installed.

you can find PIL versions of the standard X window fonts
here:

    http://effbot.org/pil

(I suggest falling back on Helvetica if you cannot find a
matching font file)

</F>

<!-- (the eff-bot guide to) the python standard library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list