pygame / docs / ref / pygame_font.html

<body bgcolor=#dddddd text=#333377 link=#7777bb vlink=#7777bb>

<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=#f5f5f5><tr valign=top>
<td rowspan=2><table border=0 cellpadding=5 cellspacing=0 bgcolor=#333377>
<tr height=86 align=left><td valign=middle><font color=#ffffff size=+5>
	<a href=../index.html><font size=+5 color=#ffffff><i><b>
<td valign=middle><tt><font color=#dddddd><br>
</td></tr></table></td><td width=100% align=center valign=middle>

	<a href=>Home</a> &nbsp;||&nbsp;
	<a href=../index.html>Help Contents</a> &nbsp;||

|| <a href=CD.html>CD</a> || 
<a href=Channel.html>Channel</a> || 
<a href=Font.html>Font</a> || 
<a href=Joystick.html>Joystick</a> || 
<a href=Rect.html>Rect</a> || 
<a href=Sound.html>Sound</a> || 
<a href=Surface.html>Surface</a> ||<br>
|| <a href=pygame.html>pygame</a> || 
<a href=pygame_cdrom.html>cdrom</a> || 
<a href=pygame_constants.html>constants</a> || 
<a href=pygame_display.html>display</a> || 
<a href=pygame_event.html>event</a> || 
<a href=pygame_font.html>font</a> || 
<a href=pygame_image.html>image</a> ||<br>
|| <a href=pygame_joystick.html>joystick</a> || 
<a href=pygame_key.html>key</a> || 
<a href=pygame_mixer.html>mixer</a> || 
<a href=pygame_mixer_music.html>mixer_music</a> || 
<a href=pygame_mouse.html>mouse</a> || 
<a href=pygame_surfarray.html>surfarray</a> || 
<a href=pygame_time.html>time</a> ||<br>

<h2 align=center>pygame.font</h2>
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


<tr><td><a href=#Font>Font</a></td><td> -
create a new font object</td></tr>

<tr><td><a href=#get_init>get_init</a></td><td> -
get status of font module initialization</td></tr>

<tr><td><a href=#init>init</a></td><td> -
initialize the display module</td></tr>

<tr><td><a href=#quit>quit</a></td><td> -
uninitialize the font module</td></tr>



<a name=Font><font size=+2><b>Font
</b></font><br><font size=+1><tt>
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.

<a name=get_init><font size=+2><b>get_init
</b></font><br><font size=+1><tt>
pygame.font.get_init() -> bool
Returns true if the font module is currently intialized.

<a name=init><font size=+2><b>init
</b></font><br><font size=+1><tt>
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.

<a name=quit><font size=+2><b>quit
</b></font><br><font size=+1><tt>
pygame.font.quit() -> none
Manually uninitialize SDL's video subsystem. It is safe to call
this if font is currently not initialized.


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.