natiny.font.get_ascent
natiny.font.get_ascent(font) -> ascent
Returns how far the font reaches above the baseline, in drawing units.
Parameters
| Name | Type | Description |
|---|---|---|
font |
number |
Font handle from natiny.font.create |
Returns
| Type | Description |
|---|---|
number |
Non-negative distance above the baseline in drawing units, or 0 for an invalid handle |
Example
local ascent = natiny.font.get_ascent(big)
natiny.render.text(big, x, y, "A")
natiny.render.text(small, x + 30, y + ascent - natiny.font.get_ascent(small), "a")