pygame2.sdlttf.base

The pygame2.sdlttf.base C API contains objects and functions for accessing TrueType font rendering on SDL surfaces.

Import

Include headers:

pygame2/pgsdlttf.h
int import_pygame2_sdlttf_base(void)
Imports the pygame2.sdlttf.base module. This returns 0 on success and -1 on failure.

Macros

ASSERT_TTF_INIT(retval)
Checks, whether the ttf subsystem was properly initialised. If not, this will set a PyExc_PyGameError and return retval.

PySDLFont_TTF

PySDLFont_TTF
PySDLFont_TTF_Type

The PySDLFont_TTF object is used for rendering text to a PySDLSurface.

Members

PyFont PySDLFont_TTF.pyfont
The parent PyFont class the PySDLFont_TTF inherits from.
TTF_Font* PySDLFont_TTF.font
The TTF_Font pointer to access the underlying font.

Functions

int PySDLFont_TTF_Check(PyObject *obj)
Returns true, if the argument is a PySDLFont_TTF or a subclass of PySDLFont_TTF.
PyObject* PySDLFont_TTF_New(char *filename, int ptsize)
Creates a new PySDLFont_TTF object from the passed TrueType font file. ptsize specifies the font size (height) in points. On failure, this returns NULL.
TTF_Font* PySDLFont_TTF_AsFont(PyObject *obj)
Macro for accessing the font member of the PyFont. This does not perform any type or argument checks.

Table Of Contents

Previous topic

pygame2.sdlgfx.base

Next topic

Extending Pygame2

This Page