Freetypy API documentation

The API closely follows the freetype API. It is not 100% complete, but it does contain the functionality that most would need.

Names have been modified to follow Python’s PEP8 style guidelines.

Where appropriate, extra API functions have been added to make working with freetype more Pythonic. These methods are marked with the ⨎ in the documentation.

Face

Face A face object models a given typeface, in a given style.
Size A size object models a face object at a given size.
Size_Metrics The metrics of a size object.
FACE_FLAG A set of bit flags that give important information about the face.
STYLE_FLAG Bit flags to indicate the style of a given face.
LOAD A flag indicating what to load for this glyph.
SIZE_REQUEST_TYPE Modes for selecting the size of a bitmap font.
FSTYPE A list of bit flags indicating the embedding and subsetting restrictions with a font.

Layout

⨎ Freetypy includes a very basic layout algorithm for left-to-right text. For more serious usage, one should use a real layout engine, such as Pango.

Layout ⨎ This class handles very simple layout of left-to-right text.

Glyph

Glyph Contains information pertaining to a single glyph.
Glyph_Metrics A structure used to model the metrics of a single glyph.
GLYPH_BBOX The mode how the values of Glyph.get_cbox are returned.
GLYPH_FORMAT An enumeration type used to describe the format of a given glyph image.
SubGlyph A description of a given subglyph.
SUBGLYPH_FLAG A list of constants used to describe subglyphs.

Bitmap

Bitmap A structure used to describe a bitmap or pixmap to the raster.
Bitmap_Size Models the metrics of a bitmap strike in a bitmap font.
PIXEL_MODE Constants related to the pixel mode of bitmaps.
RENDER_MODE A set of enumerations to select a bitmap renderer.

Outline

Outline Represents an outline.
OUTLINE A set of bit flags to characterize an Outline.
ORIENTATION Values to specify how an outline is oriented.

CharMap

CharMap A mapping from code points to glyph identifiers.
ENCODING A tag identifying a CharMap type.

TrueType information

SfntName An SFNT ‘name’ table entry.
SfntNames A sequence of SFNT names in the face.
TT_Header TrueType header.
TT_HoriHeader A structure used to model a TrueType horizontal header (‘hhea’).
TT_VertHeader A structure used to model a TrueType vertical header (‘vhea’).
TT_OS2 Information about the TrueType font, used on OS/2 and Microsoft Windows.
TT_Pclt A structure used to model a TrueType PCLT table.
TT_Postscript A TrueType PostScript table.
TT_PLATFORM A set of platform identifier codes.
TT_APPLE_ID Apple-specific encoding values.
TT_MAC_ID Macintosh-specific encoding values.
TT_MAC_LANGID Possible values of the language identifier field in the name records of the TTF “name” table if the “platform” identifier code is TT_PLATFORM.MACINTOSH.
TT_MS_ID Microsoft-specific encoding values.
TT_MS_LANGID Possible values of the language identifier field in the name records of the TTF “name” table if the “platform” identifier code is TT_PLATFORM.MICROSOFT.
TT_ADOBE_ID Adobe-specific encoding values.
TT_NAME_ID Indicates the type of value stored in a SfntName record.
TT_MAC_STYLE Bit flags indicating the style of the face.
TT_HEADER_FLAGS ⨎ Bitflags giving global information about the font.
TT_WIDTH_CLASS ⨎ Width values for the TT_OS2.width_class property.
TT_WEIGHT_CLASS ⨎ Weight values for the TT_OS2.weight_class property.
TT_FS_SELECTION Bitflag concerning the nature of the font patterns.

Basic Types

BBox An outline’s bounding box.
Matrix A 2x2 matrix.
Vector A 2D vector.

Miscellaneous Utilities

util