Name | textDescent() |
---|---|
Processing.js Behavior | Font support for the Canvas element varies across browsers. FireFox currently has the best support, but still uses a pre-defined set of fonts. (Documentation to follow soon.) Good alternatives to the browser's Canvas-font functions are available: such as the Glyph method. See also: Canvas Text, BurntToys Bauhaus.
Please use the following demos to learn how fonts can be rendered in Firefox with Processing.js: Letters, Words, width() |
Examples | PFont font; font = loadFont("FFScala.ttf"); textFont(font); textSize(32); float descent = textDescent(); text("dp", 0, 70); line(0, 70+descent, 100, 70+descent); textSize(64); descent = textDescent(); text("dp", 35, 70); line(35, 70+descent, 100, 70+descent); |
Description | 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 textAscent() and textDescent() values will give you the total height of the line. |
Syntax | textDescent() |
Returns | Float |
Usage | Web & Application |
Related | textAscent() |