Module PIL.ImageFont

Module Summary:

def load(filename)
Load font file.
def load_default()
Load a (probably rather ugly) default font.
def load_path(filename)
Load font file.
def truetype(filename, size, index=0)
Load a TrueType or OpenType font file, and create a font object.

Functions

load

load(filename)

Load font file. This function loads a font object from the given bitmap font file, and returns the corresponding font object.

Parameters:

filename -- Name of font file.

Returns:

A font object.

Exceptions:

IOError -- Raised if the file could not be read.

load_default

load_default()

Load a (probably rather ugly) default font.

Returns:

A font object.

load_path

load_path(filename)

Load font file. Same as load, but searches for a bitmap font along the Python path.

Parameters:

filename -- Name of font file.

Returns:

A font object.

Exceptions:

IOError -- Raised if the file could not be read.

truetype

truetype(filename, size, index=0)

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.

Parameters:

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 -- The requested size, in points.

index -- Which font face to load (default is first available face).

Returns:

A font object.

Exceptions:

IOError -- Raised if the file could not be read.