pygame2.freetype

The pygame2.freetype C API contains some objects and functions for high-quality font, glyph and text operations.

Import

Include headers:

pygame2/pgfreetype.h
int import_pygame2_freetype(void)
Imports the pygame2.freetype module. This returns 0 on success and -1 on failure.

Basic Types

FontId

A simple font face information structure.

int FontId.face_index
The index number of the font face within the font.
FT_Open_Args FontId.open_args
The arguments used to open the face.

PyFreeTypeFont

PyFreeTypeFont
PyFreeTypeFont_Type

The PyFreeTypeFont object is suitable for creating and managing fonts, glyph and text operations and text rendering.

Members

PyFont PyFreeTypeFont.pyfont
The parent PyFont class the PyFreeTypeFont inherits from.
FontId PyFreeTypeFont.id
The used font face information.
FT_Int16 PyFreeTypeFont.ptsize
The default font size (height) in points.
FT_Byte PyFreeTypeFont.style
The default font style to apply.
FT_Byte PyFreeTypeFont.vertical
Indicates, whether operations should use a vertical alignment.
FT_Byte PyFreeTypeFont.antialias
Indicates, whether operations should use antialiasing.

Functions

PyFont* PyFreeTypeFont_AsFont(PyObject *obj)

Macro for accessing the pyfont member of the PyFreeTypeFont.

This does not perform any type or argument checks.

int PyFreeTypeFont_Check(PyObject *obj)
Returns true, if the argument is a PyFreeTypeFont or a subclass of PyFreeTypeFont.
PyObject* PyFreeTypeFont_New(const char *font, int ptsize)
Creates a new PyFreeTypeFont object for the given font and default point size ptsize. On failure, this returns NULL.

Table Of Contents

Previous topic

pygame2.base

Next topic

pygame2.mask

This Page