Home

Class lib2d.Font

A TrueType font that can render text.

Examples

>>> lib2d.init()
>>> font = lib2d.Font("demos/04_text/FreeSans.ttf")
>>> font.text("Hello Lib2D!", font_size=80)

Methods

def __init__(self, path)

Load a TrueType font from the file system at path.

def text(self, text, font_size=20, x=0, y=0, color=0x000000ff)

Schedules UTF-8 text to be rendered to the screen when lib2d_render() is called.