pygame   documentation
||  Home  ||  Help Contents  ||
 
|| pygame || cdrom || constants || cursor || display || draw ||
|| event || font || image || joystick || key || mixer ||
|| mixer_music || mouse || movie || sndarray || surfarray || time ||
|| transform ||
 
|| CD || Channel || Clock || Font || Joystick || Movie ||
|| Overlay || Rect || Sound || Surface ||
 
|| color || 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().
 
You can load fonts from the standard system fonts by using the pygame.font.SysFont() method. There are also other functions to help you work with system fonts.
 

Font - create a new font object
SysFont - create a pygame Font from system font resources
get_default_font - get the name of the default font
get_fonts - get a list of system font names
get_init - get status of font module initialization
init - initialize the display module
match_font - find the filename for the named system font
quit - uninitialize the font module

Font
pygame.font.Font(file, size) -> Font
 
SysFont
pygame.font.SysFont(name, size, bold=False, italic=False) -> Font
 
get_default_font
pygame.font.get_default_font() -> string
 
get_fonts
pygame.font.get_fonts() -> list
 
get_init
pygame.font.get_init() -> bool
 
init
pygame.font.init() -> None
 
match_font
pygame.font.match_font(name, bold=0, italic=0) -> name

 
quit
pygame.font.quit() -> none