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
size
Number: The size to set for the text.
Returns
Number: If no arguments are provided, the current text size in pixels.
Notice any errors or typos? Please let us know. Please feel free to edit src/type/textCore.js and open a pull request!