natiny.font.get_descent
natiny.font.get_descent(font) -> descent
Returns how far the font reaches below the baseline, in drawing units.
Parameters
| Name | Type | Description |
|---|---|---|
font |
number |
Font handle from natiny.font.create |
Returns
| Type | Description |
|---|---|
number |
Non-negative distance below the baseline in drawing units, or 0 for an invalid handle |
Example
local ascent = natiny.font.get_ascent(font)
local descent = natiny.font.get_descent(font)
local w = natiny.font.measure_text(font, text)
natiny.render.line(x, y + ascent + descent, x + w, y + ascent + descent, 1)