1
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
5
<title>The PIL.ImageFont Module</title>
6
<link rel='stylesheet' href='effbot.css' type='text/css' />
9
<h1>The PIL.ImageFont Module</h1>
11
<dt><b>FreeTypeFont(file, size, index=0, encoding="")</b> (class) [<a href='#PIL.ImageFont.FreeTypeFont-class'>#</a>]</dt>
13
<p>Wrapper for FreeType fonts.</p>
14
<p>For more information about this class, see <a href='#PIL.ImageFont.FreeTypeFont-class'><i>The FreeTypeFont Class</i></a>.</p>
16
<dt><b>ImageFont</b> (class) [<a href='#PIL.ImageFont.ImageFont-class'>#</a>]</dt>
18
<p>The ImageFont module defines a class with the same name.</p>
19
<p>For more information about this class, see <a href='#PIL.ImageFont.ImageFont-class'><i>The ImageFont Class</i></a>.</p>
21
<dt><a id='PIL.ImageFont.load-function' name='PIL.ImageFont.load-function'><b>load(filename)</b></a> [<a href='#PIL.ImageFont.load-function'>#</a>]</dt>
23
<p>Load font file. This function loads a font object from the given
24
bitmap font file, and returns the corresponding font object.</p>
26
<dt><i>filename</i></dt>
28
Name of font file.</dd>
32
<dt>Raises <b>IOError</b>:</dt><dd>
33
If the file could not be read.</dd>
36
<dt><a id='PIL.ImageFont.load_default-function' name='PIL.ImageFont.load_default-function'><b>load_default()</b></a> [<a href='#PIL.ImageFont.load_default-function'>#</a>]</dt>
38
<p>Load a (probably rather ugly) default font.</p>
45
<dt><a id='PIL.ImageFont.load_path-function' name='PIL.ImageFont.load_path-function'><b>load_path(filename)</b></a> [<a href='#PIL.ImageFont.load_path-function'>#</a>]</dt>
47
<p>Load font file. Same as load, but searches for a bitmap font along
50
<dt><i>filename</i></dt>
52
Name of font file.</dd>
56
<dt>Raises <b>IOError</b>:</dt><dd>
57
If the file could not be read.</dd>
60
<dt><b>TransposedFont(font, orientation=None)</b> (class) [<a href='#PIL.ImageFont.TransposedFont-class'>#</a>]</dt>
62
<p>Wrapper that creates a transposed font from any existing font
68
<dt><i>orientation</i></dt>
70
An optional orientation. If given, this should
71
be one of Image.FLIP_LEFT_RIGHT, Image.FLIP_TOP_BOTTOM,
72
Image.ROTATE_90, Image.ROTATE_180, or Image.ROTATE_270.</dd>
74
<p>For more information about this class, see <a href='#PIL.ImageFont.TransposedFont-class'><i>The TransposedFont Class</i></a>.</p>
76
<dt><a id='PIL.ImageFont.truetype-function' name='PIL.ImageFont.truetype-function'><b>truetype(filename, size, index=0, encoding="")</b></a> [<a href='#PIL.ImageFont.truetype-function'>#</a>]</dt>
78
<p>Load a TrueType or OpenType font file, and create a font object.
79
This function loads a font object from the given file, and creates
80
a font object for a font of the given size.
82
This function requires the _imagingft service.
85
<dt><i>filename</i></dt>
87
A truetype font file. Under Windows, if the file
88
is not found in this filename, the loader also looks in Windows
89
<b>fonts</b> directory
93
The requested size, in points.</dd>
96
Which font face to load (default is first available face).</dd>
97
<dt><i>encoding</i></dt>
99
Which font encoding to use (default is Unicode). Common
100
encodings are "unic" (Unicode), "symb" (Microsoft Symbol), "ADOB"
101
(Adobe Standard), "ADBE" (Adobe Expert), and "armn" (Apple Roman).
102
See the FreeType documentation for more information.</dd>
106
<dt>Raises <b>IOError</b>:</dt><dd>
107
If the file could not be read.</dd>
111
<h2><a id='PIL.ImageFont.FreeTypeFont-class' name='PIL.ImageFont.FreeTypeFont-class'>The FreeTypeFont Class</a></h2>
113
<dt><b>FreeTypeFont(file, size, index=0, encoding="")</b> (class) [<a href='#PIL.ImageFont.FreeTypeFont-class'>#</a>]</dt>
115
<p>Wrapper for FreeType fonts. Application code should use the
116
<b>truetype</b> factory function to create font objects.
119
<h2><a id='PIL.ImageFont.ImageFont-class' name='PIL.ImageFont.ImageFont-class'>The ImageFont Class</a></h2>
121
<dt><b>ImageFont</b> (class) [<a href='#PIL.ImageFont.ImageFont-class'>#</a>]</dt>
123
<p>The <b>ImageFont</b> module defines a class with the same name.
124
Instances of this class store bitmap fonts, and are used with the
125
<b>text</b> method of the <b>ImageDraw</b> class.
127
PIL uses it's own font file format to store bitmap fonts. You can
128
use the <b>pilfont</b> utility to convert BDF and PCF font
129
descriptors (X window font formats) to this format.
131
Starting with version 1.1.4, PIL can be configured to support
132
TrueType and OpenType fonts. For earlier version, TrueType
133
support is only available as part of the imToolkit package
137
<h2><a id='PIL.ImageFont.TransposedFont-class' name='PIL.ImageFont.TransposedFont-class'>The TransposedFont Class</a></h2>
139
<dt><b>TransposedFont(font, orientation=None)</b> (class) [<a href='#PIL.ImageFont.TransposedFont-class'>#</a>]</dt>
141
<p>Wrapper that creates a transposed font from any existing font
147
<dt><i>orientation</i></dt>
149
An optional orientation. If given, this should
150
be one of Image.FLIP_LEFT_RIGHT, Image.FLIP_TOP_BOTTOM,
151
Image.ROTATE_90, Image.ROTATE_180, or Image.ROTATE_270.</dd>
1
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
5
<title>The PIL.ImageFont Module</title>
6
<link rel='stylesheet' href='effbot.css' type='text/css' />
9
<h1>The PIL.ImageFont Module</h1>
11
<dt><b>FreeTypeFont(file, size, index=0, encoding="")</b> (class) [<a href='#PIL.ImageFont.FreeTypeFont-class'>#</a>]</dt>
13
<p>Wrapper for FreeType fonts.</p>
14
<p>For more information about this class, see <a href='#PIL.ImageFont.FreeTypeFont-class'><i>The FreeTypeFont Class</i></a>.</p>
16
<dt><b>ImageFont</b> (class) [<a href='#PIL.ImageFont.ImageFont-class'>#</a>]</dt>
18
<p>The ImageFont module defines a class with the same name.</p>
19
<p>For more information about this class, see <a href='#PIL.ImageFont.ImageFont-class'><i>The ImageFont Class</i></a>.</p>
21
<dt><a id='PIL.ImageFont.load-function' name='PIL.ImageFont.load-function'><b>load(filename)</b></a> [<a href='#PIL.ImageFont.load-function'>#</a>]</dt>
24
<dt><i>filename</i></dt>
30
<dt>Raises <b>IOError</b>:</dt><dd>
34
<dt><a id='PIL.ImageFont.load_default-function' name='PIL.ImageFont.load_default-function'><b>load_default()</b></a> [<a href='#PIL.ImageFont.load_default-function'>#</a>]</dt>
42
<dt><a id='PIL.ImageFont.load_path-function' name='PIL.ImageFont.load_path-function'><b>load_path(filename)</b></a> [<a href='#PIL.ImageFont.load_path-function'>#</a>]</dt>
45
<dt><i>filename</i></dt>
51
<dt>Raises <b>IOError</b>:</dt><dd>
55
<dt><b>TransposedFont(font, orientation=None)</b> (class) [<a href='#PIL.ImageFont.TransposedFont-class'>#</a>]</dt>
57
<p>Wrapper that creates a transposed font from any existing font
63
<dt><i>orientation</i></dt>
67
<p>For more information about this class, see <a href='#PIL.ImageFont.TransposedFont-class'><i>The TransposedFont Class</i></a>.</p>
69
<dt><a id='PIL.ImageFont.truetype-function' name='PIL.ImageFont.truetype-function'><b>truetype(filename, size, index=0, encoding="")</b></a> [<a href='#PIL.ImageFont.truetype-function'>#</a>]</dt>
71
<p>Load a TrueType or OpenType font file, and create a font object.
72
This function loads a font object from the given file, and creates
73
a font object for a font of the given size.
75
This function requires the _imagingft service.
78
<dt><i>filename</i></dt>
80
A truetype font file. Under Windows, if the file
81
is not found in this filename, the loader also looks in Windows
82
<b>fonts</b> directory
90
<dt><i>encoding</i></dt>
96
<dt>Raises <b>IOError</b>:</dt><dd>
101
<h2><a id='PIL.ImageFont.FreeTypeFont-class' name='PIL.ImageFont.FreeTypeFont-class'>The FreeTypeFont Class</a></h2>
103
<dt><b>FreeTypeFont(file, size, index=0, encoding="")</b> (class) [<a href='#PIL.ImageFont.FreeTypeFont-class'>#</a>]</dt>
105
<p>Wrapper for FreeType fonts. Application code should use the
106
<b>truetype</b> factory function to create font objects.
109
<h2><a id='PIL.ImageFont.ImageFont-class' name='PIL.ImageFont.ImageFont-class'>The ImageFont Class</a></h2>
111
<dt><b>ImageFont</b> (class) [<a href='#PIL.ImageFont.ImageFont-class'>#</a>]</dt>
113
<p>The <b>ImageFont</b> module defines a class with the same name.
114
Instances of this class store bitmap fonts, and are used with the
115
<b>text</b> method of the <b>ImageDraw</b> class.
117
PIL uses it's own font file format to store bitmap fonts. You can
118
use the <b>pilfont</b> utility to convert BDF and PCF font
119
descriptors (X window font formats) to this format.
121
Starting with version 1.1.4, PIL can be configured to support
122
TrueType and OpenType fonts. For earlier version, TrueType
123
support is only available as part of the imToolkit package
127
<h2><a id='PIL.ImageFont.TransposedFont-class' name='PIL.ImageFont.TransposedFont-class'>The TransposedFont Class</a></h2>
129
<dt><b>TransposedFont(font, orientation=None)</b> (class) [<a href='#PIL.ImageFont.TransposedFont-class'>#</a>]</dt>
135
<dt><i>orientation</i></dt>