Basic SDL_ttf wrapper module
Gets the SDL_ttf version pygame2 was compiled against as three-value tuple.
This version is built at compile time. It can be used to detect which features may not be available through Pygame, if it is used as precompiled package using a different version of the SDL_ttf library.
Gets the last pygame2.Error occured.
SDL_ttf maintains an internal error message. This message will usually be given to you when a pygame2.Error is raised. You will rarely need to call this function.
Gets the SDL version pygame2 currently uses as three-value tuple.
This version is detected at runtime. It can be used to detect which features may not be available through Pygame, if it is used as precompiled package using a different version of the SDL library.
Shuts down the SDL_ttf library.
After calling this function, you should not invoke any class, method or function related to the sdlttf module as they are likely to fail or might give unpredictable results.
Creates a new Font from a TTF font file.
Creates a new Font from a TTF font file using the specified size in points. If the font features different faces, they can be chosen using the optional index.
Note
The file object must support binary read and write access. This is especially important for Python 3.x users.
Gets the glyph metrics of a string.
Gets the glyph metrics for each individual character of a string. The metrics returned for each character consist of the xMin, yMin, xMax, yMax and advance values.
http://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html contains a detailed description of those values.
If no suitable character for getting the glyph extents could be found in the font, a None value will be used instead of a 5-value tuple.
Renders a text to a pygame2.sdl.video.Surface.
Renders the specified text to a pygame2.sdl.video.Surface. The text will have the chosen foreground color for the glyphs. The optional bgcolor argument denotes the background color to use for the returned pygame2.sdl.video.Surface, if - and only if - the renderflag is RENDER_SHADED (the default). Otherwise the pygame2.sdl.video.Surface will be transparent except for the rendered glyphs.
The renderflag argument can be set to one of the rendering constants of the pygame2.sdlttf.constants module.