text_size()#

Sets the current font size.

Examples#

example picture for text_size()
1def setup():
2    py5.background(0)
3    py5.fill(255)
4    py5.text_size(26)
5    py5.text("WORD", 10, 50)
6    py5.text_size(14)
7    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

Syntax#

text_size(size: float, /) -> None

Parameters#

  • size: float - the size of the letters in units of pixels

Updated on November 12, 2021 11:30:58am UTC