Reference for set_text_font
Set the type and size of text to draw. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
set_text_font
Transform
Purpose
Set the size and font to use for drawing text.
Snippet
Draw "Hello World" in 12 point IBM Plex Mono at x coordinate 50 and y coordinate 100.
sketch.set_text_font('./IBMPlexMono-Regular.ttf', 12) sketch.draw_text(50, 100, 'Hello World')
Parameters
- font: Path to the TTF or OTF font file. For web renderer, name of web font can be used.
- size: Size of the font (px).
Examples
Availability
Available for all platforms. On static and app renderers, will interpret path as a local file path using the operating system's conventions. For web, it will interpret path as a URL. Filenames like "example.ttf" will assume the same directory.