text-ascent

text-descent

text-ascent

Arguments
[]
Docstring

Returns the ascent of the current font at its current size. This information is useful for determining the height of the font above the baseline. For example, adding the text-ascent and text-descent values will give you the total height of the line.

Works only inside sketch functions?
Yes
Original Processing method
textAscent()
Original p5js method
textAscent()
Example
(q/background 255)
(q/fill 0)
(q/text (str "Ascent is " (q/text-ascent)) 20 20)
try example

text-descent

Arguments
[]
Docstring

Returns descent of the current font at its current size. This information is useful for determining the height of the font below the baseline. For example, adding the text-ascent and text-descent values will give you the total height of the line.

Works only inside sketch functions?
Yes
Original Processing method
textDescent()
Original p5js method
textDescent()
Example
(q/background 255)
(q/fill 0)
(q/text (str "Descent is " (q/text-descent)) 20 20)
try example