18.17.1Class TTF

Main SDL TTF encapsulation class.

Class TTF

This class is the namespace for TTF functions of the SDL module. It contains the extensions provided by Falcon on the sdlttf module.

Methods
ByteSwappedUNICODESet default UNICODE byte swapping mode.
Compiled_VersionDetermine the version used to compile this SDL TTF module.
InitInitialize the TTF module
InitAutoInitialize the TTF module and prepares for automatic de-initialization.
Linked_VersionDetermine the version of the library that is currently linked.
OpenFontOpen a font file.
QuitTurns off TTF system.
WasInitDetects if the TTF subsystem was initialized.

Methods

ByteSwappedUNICODE

Set default UNICODE byte swapping mode.

TTF.ByteSwappedUNICODE( swap )
swap Swapping mode.

If swap is non-zero then UNICODE data is byte swapped relative to the CPU's native endianness. if swap zero, then do not swap UNICODE data, use the CPU's native endianness.

Compiled_Version

Determine the version used to compile this SDL TTF module.

TTF.Compiled_Version()
Returna three element array containing the major, minor and fix versions.

See also: TTF.

Init

Initialize the TTF module

TTF.Init()
Raise
SDLError on initialization failure

Does not require SDL.Init to be called before.

InitAuto

Initialize the TTF module and prepares for automatic de-initialization.

TTF.InitAuto()
Raise
SDLError on initialization failure

Does not require SDL.Init to be called before.

This method returns an object; when the object is destroyed by the GC, the library is de-initialized. To perform an application wide intialization with automatic de-initialization on quit, just store the return value of this method on a global variable of the main script.

Linked_Version

Determine the version of the library that is currently linked.

TTF.Linked_Version()
Returna three element array containing the major, minor and fix versions.

This function determines the version of the SDL_ttf library that is running on the system. As long as the interface is the same, it may be different from the version used to compile this module.

OpenFont

Open a font file.

TTF.OpenFont( fontname, ptsize, [index] )
fontname File where the font is stored.
ptsize Size of the font that must be loaded.
index Face index in the file.
ReturnAn instance of class TTFFont.
Raise
SDLError if the font cannot be loaded.

Quit

Turns off TTF system.

TTF.Quit()

This call shuts down the TTF extensions for SDL and resets system status. After a TTF quit, it is possible to reinitialize it.

WasInit

Detects if the TTF subsystem was initialized.

TTF.WasInit()
ReturnTrue if the system was initialized, false otherwise.
Made with http://www.falconpl.org