mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
142 lines
4.5 KiB
HTML
142 lines
4.5 KiB
HTML
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
|
|
<title>The PIL.ImageFont Module</title>
|
|
<link rel='stylesheet' href='effbot.css' type='text/css' />
|
|
</head>
|
|
<body>
|
|
<h1>The PIL.ImageFont Module</h1>
|
|
<dl>
|
|
<dt><b>FreeTypeFont(file, size, index=0, encoding="")</b> (class) [<a href='#PIL.ImageFont.FreeTypeFont-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Wrapper for FreeType fonts.</p>
|
|
<p>For more information about this class, see <a href='#PIL.ImageFont.FreeTypeFont-class'><i>The FreeTypeFont Class</i></a>.</p>
|
|
</dd>
|
|
<dt><b>ImageFont</b> (class) [<a href='#PIL.ImageFont.ImageFont-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>The ImageFont module defines a class with the same name.</p>
|
|
<p>For more information about this class, see <a href='#PIL.ImageFont.ImageFont-class'><i>The ImageFont Class</i></a>.</p>
|
|
</dd>
|
|
<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>
|
|
<dd>
|
|
<dl>
|
|
<dt><i>filename</i></dt>
|
|
<dd>
|
|
</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>
|
|
</dd>
|
|
<dt>Raises <b>IOError</b>:</dt><dd>
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
<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>
|
|
<dd>
|
|
<dl>
|
|
<dt>Returns:</dt>
|
|
<dd>
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
<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>
|
|
<dd>
|
|
<dl>
|
|
<dt><i>filename</i></dt>
|
|
<dd>
|
|
</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>
|
|
</dd>
|
|
<dt>Raises <b>IOError</b>:</dt><dd>
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
<dt><b>TransposedFont(font, orientation=None)</b> (class) [<a href='#PIL.ImageFont.TransposedFont-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Wrapper that creates a transposed font from any existing font
|
|
object.</p>
|
|
<dl>
|
|
<dt><i>font</i></dt>
|
|
<dd>
|
|
</dd>
|
|
<dt><i>orientation</i></dt>
|
|
<dd>
|
|
</dd>
|
|
</dl><br />
|
|
<p>For more information about this class, see <a href='#PIL.ImageFont.TransposedFont-class'><i>The TransposedFont Class</i></a>.</p>
|
|
</dd>
|
|
<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>
|
|
<dd>
|
|
<p>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.
|
|
</p><p>
|
|
This function requires the _imagingft service.
|
|
|
|
</p><dl>
|
|
<dt><i>filename</i></dt>
|
|
<dd>
|
|
A truetype font file. Under Windows, if the file
|
|
is not found in this filename, the loader also looks in Windows
|
|
<b>fonts</b> directory
|
|
</dd>
|
|
<dt><i>size</i></dt>
|
|
<dd>
|
|
</dd>
|
|
<dt><i>index</i></dt>
|
|
<dd>
|
|
</dd>
|
|
<dt><i>encoding</i></dt>
|
|
<dd>
|
|
</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>
|
|
</dd>
|
|
<dt>Raises <b>IOError</b>:</dt><dd>
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
</dl>
|
|
<h2><a id='PIL.ImageFont.FreeTypeFont-class' name='PIL.ImageFont.FreeTypeFont-class'>The FreeTypeFont Class</a></h2>
|
|
<dl>
|
|
<dt><b>FreeTypeFont(file, size, index=0, encoding="")</b> (class) [<a href='#PIL.ImageFont.FreeTypeFont-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Wrapper for FreeType fonts. Application code should use the
|
|
<b>truetype</b> factory function to create font objects.
|
|
</p></dd>
|
|
</dl>
|
|
<h2><a id='PIL.ImageFont.ImageFont-class' name='PIL.ImageFont.ImageFont-class'>The ImageFont Class</a></h2>
|
|
<dl>
|
|
<dt><b>ImageFont</b> (class) [<a href='#PIL.ImageFont.ImageFont-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>The <b>ImageFont</b> module defines a class with the same name.
|
|
Instances of this class store bitmap fonts, and are used with the
|
|
<b>text</b> method of the <b>ImageDraw</b> class.
|
|
</p><p>
|
|
PIL uses it's own font file format to store bitmap fonts. You can
|
|
use the <b>pilfont</b> utility to convert BDF and PCF font
|
|
descriptors (X window font formats) to this format.
|
|
</p><p>
|
|
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
|
|
|
|
</p></dd>
|
|
</dl>
|
|
<h2><a id='PIL.ImageFont.TransposedFont-class' name='PIL.ImageFont.TransposedFont-class'>The TransposedFont Class</a></h2>
|
|
<dl>
|
|
<dt><b>TransposedFont(font, orientation=None)</b> (class) [<a href='#PIL.ImageFont.TransposedFont-class'>#</a>]</dt>
|
|
<dd>
|
|
<dl>
|
|
<dt><i>font</i></dt>
|
|
<dd>
|
|
</dd>
|
|
<dt><i>orientation</i></dt>
|
|
<dd>
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
</dl>
|
|
</body></html>
|