Py5Font is the font class for py5.


example picture for Py5Font

def setup():
    font = py5.create_font("DejaVu Sans", 32)
    py5.text("word", 10, 50)


Py5Font is the font class for py5. To create a font to use with py5, use create_font_file(). This will create a font in the format py5 requires. Py5 displays fonts using the .vlw font format, which uses images for each letter, rather than defining them through vector data. The load_font() function constructs a new font and text_font() makes a font active. The Py5Font.list() method creates a list of the fonts installed on the computer, which is useful information to use with the create_font() function for dynamically converting fonts into a format to use with py5.

To create a new font dynamically, use the create_font() function. Do not use the syntax Py5Font().

Underlying Processing class: PFont

The following methods and fields are provided:

Updated on March 06, 2023 02:49:26am UTC