The PIL.ImageFont Module

FreeTypeFont(file, size, index=0, encoding="") (class) [#]

Wrapper for FreeType fonts.

For more information about this class, see The FreeTypeFont Class.

ImageFont (class) [#]

The ImageFont module defines a class with the same name.

For more information about this class, see The ImageFont Class.

load(filename) [#]
filename
Returns:
Raises IOError:

load_default() [#]
Returns:

load_path(filename) [#]
filename
Returns:
Raises IOError:

TransposedFont(font, orientation=None) (class) [#]

Wrapper that creates a transposed font from any existing font object.

font
orientation

For more information about this class, see The TransposedFont Class.

truetype(filename, size, index=0, encoding="") [#]

Load a TrueType or OpenType font file, and create a font object. This function loads a font object from the given file, and creates a font object for a font of the given size.

This function requires the _imagingft service.

filename
A truetype font file. Under Windows, if the file is not found in this filename, the loader also looks in Windows fonts directory
size
index
encoding
Returns:
Raises IOError:

The FreeTypeFont Class

FreeTypeFont(file, size, index=0, encoding="") (class) [#]

Wrapper for FreeType fonts. Application code should use the truetype factory function to create font objects.

The ImageFont Class

ImageFont (class) [#]

The ImageFont module defines a class with the same name. Instances of this class store bitmap fonts, and are used with the text method of the ImageDraw class.

PIL uses it's own font file format to store bitmap fonts. You can use the pilfont utility to convert BDF and PCF font descriptors (X window font formats) to this format.

Starting with version 1.1.4, PIL can be configured to support TrueType and OpenType fonts. For earlier version, TrueType support is only available as part of the imToolkit package

The TransposedFont Class

TransposedFont(font, orientation=None) (class) [#]
font
orientation