Returns the ascent of the text.
The textAscent()
function calculates the distance from the baseline to the highest point of the current font. This value represents the ascent, which is essential for determining the overall height of the text along with textDescent()
. If a text string is provided as an argument, the ascent is calculated based on that specific string; otherwise, the ascent of the current font is returned.
Examples
Syntax
textAscent([txt])
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.