Fonts - JakeTurner616/pygame-lua-bindings GitHub Wiki
init_font_module()
Initialize the Pygame font module.
Maps to::
pygame.font.init()
: This function initializes the Pygame font module.
quit_font_module()
Quit the Pygame font module.
Maps to::
pygame.font.quit()
: This function quits the Pygame font module.
is_font_initialized()
Check if the Pygame font module is initialized.
Returns::
True
if the font module is initialized,False
otherwise.
Maps to::
pygame.font.get_init()
: This function returns whether the Pygame font module is initialized.
get_default_font()
Get the default system font.
Returns::
- The path to the default system font.
Maps to::
pygame.font.get_default_font()
: This function returns the path to the default system font.
get_fonts()
Get a list of available font names.
Returns::
- A list of available font names.
Maps to::
pygame.font.get_fonts()
: This function returns a list of available font names.
match_font(name, bold=False, italic=False)
Find a font that matches the given name, bold, and italic style.
Parameters::
name
: The name of the font to match.bold
: Whether the font should be bold. Default isFalse
.italic
: Whether the font should be italic. Default isFalse
.
Returns::
- The path to the matched font file.
Maps to::
pygame.font.match_font()
: This function finds a font that matches the given parameters.
create_sys_font(name, size, bold=False, italic=False)
Create a system font with the specified name, size, bold, and italic style.
Parameters::
name
: The name of the font.size
: The size of the font.bold
: Whether the font should be bold. Default isFalse
.italic
: Whether the font should be italic. Default isFalse
.
Returns::
- A font object.
Maps to::
pygame.font.SysFont()
: This function creates a system font with the specified parameters.
create_font(file_path=None, size=12)
Create a font from a file with the specified path and size.
Parameters::
file_path
: The path to the font file. IfNone
, the default system font is used. Default isNone
.size
: The size of the font. Default is12
.
Returns::
- A font object.
Maps to::
pygame.font.Font()
: This function creates a font from a file with the specified path and size.