pygame documentation | || Home || Help Contents || || pygame || cdrom || constants || display || draw || event || || font || image || joystick || key || mixer || mixer_music || || mouse || movie || sndarray || surfarray || time || transform || || CD || Channel || Clock || Font || Joystick || Movie || || Rect || Sound || Surface || || cursors || sprite ||

## pygame.font

The font module allows for rendering TrueType fonts into a new Surface object. This module is optional and requires SDL_ttf as a dependency. You may want to check for pygame.font to import and initialize before attempting to use the module.
Most of the work done with fonts are done by using the actual Font objects. The module by itself only has routines to initialize the module and create Font objects with pygame.font.Font().

Font | - create a new font object
get_default_font | - get the name of the default font
get_init | - get status of font module initialization
init | - initialize the display module
quit | - uninitialize the font module

Font
`pygame.font.Font(file, size) -> Font`

This will create a new font object. The given file must be a filename to a TTF file. The font loader does not work with python file-like objects. The size represents the height of the font in pixels. The file argument can be 'None', which will use a plain default font.

get_default_font
`pygame.font.get_default_font() -> string`

returns the name for the default truetype font.

get_init
`pygame.font.get_init() -> bool`

Returns true if the font module is currently intialized.

init
`pygame.font.init() -> None`

Manually initialize the font module. Will raise an exception if it cannot be initialized. It is safe to call this function if font is currently initialized.

quit
`pygame.font.quit() -> none`

Manually uninitialize SDL's video subsystem. It is safe to call this if font is currently not initialized.