Sets or gets the current text size.
The textSize()
function is used to specify the size of the text that will be rendered on the canvas. When called with an argument, it sets the text size to the specified value (which can be a number representing pixels or a CSS-style string, e.g., '32px', '2em'). When called without an argument, it returns the current text size in pixels.
Examples
Syntax
textSize(size)
textSize()
Parameters
Returns
Related References
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.