Rasterizer:getBearing
EditReturns the bearing metric for a glyph, in pixels. The bearing is the horizontal distance from the cursor to the edge of the glyph.
bearing = Rasterizer:getBearing(glyph)Arguments
| Name | Type | Description |
| glyph | string | number | A character or codepoint. |
Returns
| Name | Type | Description |
| bearing | number | The bearing of the glyph, in pixels. |
Example
local rasterizer = lovr.data.newRasterizer()
-- In the default font, H is wider than i
assert(rasterizer:getBearing('H') > rasterizer:getBearing('i'))