Sets the current font that will be drawn with the Py5Graphics.text() function.
Sets the current font that will be drawn with the Py5Graphics.text() function. Fonts must be created for py5 with create_font() or loaded with load_font() before they can be used. The font set through
text_font() will be used in all subsequent calls to the Py5Graphics.text() function. If no
size parameter is specified, the font size defaults to the original size (the size in which it was created with create_font_file()) overriding any previous calls to
text_font() or Py5Graphics.text_size().
When fonts are rendered as an image texture (as is the case with the
P3D renderers as well as with load_font() and vlw files), you should create fonts at the sizes that will be used most commonly. Using
text_font() without the size parameter will result in the cleanest type.
Underlying Java method: PGraphics.textFont
text_font(which: Py5Font, /) -> None text_font(which: Py5Font, size: float, /) -> None
size: float - the size of the letters in units of pixels
which: Py5Font - any variable of the type Py5Font
Updated on September 11, 2021 16:51:34pm UTC