text_size()

text_size()#

Sets the current font size.

Examples#

example picture for text_size()

def setup():
    py5.background(0)
    py5.fill(255)
    py5.text_size(26)
    py5.text("WORD", 10, 50)
    py5.text_size(14)
    py5.text("WORD", 10, 70)

Description#

Sets the current font size. This size will be used in all subsequent calls to the text() function. Font size is measured in units of pixels.

Underlying Processing method: textSize

Signatures#

text_size(
    size: float,  # the size of the letters in units of pixels
    /,
) -> None

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