







The PIL.ImageFont Module


FreeTypeFont(file, size, index=0, encoding="") (class) [ #PIL.ImageFont.FreeTypeFont-class# ]

Wrapper for FreeType fonts.

For more information about this class, see #PIL.ImageFont.FreeTypeFont-classThe FreeTypeFont Class .


ImageFont (class)  [ #PIL.ImageFont.ImageFont-class# ]

The ImageFont module defines a class with the same name.

For more information about this class, see #PIL.ImageFont.ImageFont-classThe ImageFont Class .


load(filename)  [ #PIL.ImageFont.load-function# ]

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


filename

Name of font file.

Returns:

A font object.

Raises IOError:
If the file could not be read.



load_default()  [ #PIL.ImageFont.load_default-function# ]

Load a (probably rather ugly) default font.


Returns:

A font object.



load_path(filename)  [ #PIL.ImageFont.load_path-function# ]

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


filename

Name of font file.

Returns:

A font object.

Raises IOError:
If the file could not be read.



TransposedFont(font, orientation=None) (class) [ #PIL.ImageFont.TransposedFont-class# ]

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


font

A font object.

orientation

An optional orientation.  If given, this should
    be one of Image.FLIP_LEFT_RIGHT, Image.FLIP_TOP_BOTTOM,
    Image.ROTATE_90, Image.ROTATE_180, or Image.ROTATE_270.


For more information about this class, see #PIL.ImageFont.TransposedFont-classThe TransposedFont Class .


truetype(filename, size, index=0, encoding="")  [ #PIL.ImageFont.truetype-function# ]

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

The requested size, in points.

index

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

encoding

Which font encoding to use (default is Unicode).  Common
   encodings are "unic" (Unicode), "symb" (Microsoft Symbol), "ADOB"
   (Adobe Standard), "ADBE" (Adobe Expert), and "armn" (Apple Roman).
   See the FreeType documentation for more information.

Returns:

A font object.

Raises IOError:
If the file could not be read.




The FreeTypeFont Class 


FreeTypeFont(file, size, index=0, encoding="") (class) [ #PIL.ImageFont.FreeTypeFont-class# ]

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


The ImageFont Class 


ImageFont (class)  [ #PIL.ImageFont.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) [ #PIL.ImageFont.TransposedFont-class# ]

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


font

A font object.

orientation

An optional orientation.  If given, this should
    be one of Image.FLIP_LEFT_RIGHT, Image.FLIP_TOP_BOTTOM,
    Image.ROTATE_90, Image.ROTATE_180, or Image.ROTATE_270.





