Rasterizer:getBoundingBox

Edit

Returns the bounding box of a glyph, or the bounding box surrounding all glyphs. Note that font coordinates use a cartesian "y up" coordinate system.



Get the bounding box of a single glyph.

Arguments

NameTypeDescription
glyphstring | number A character or codepoint.

Returns

NameTypeDescription
x1number The left edge of the bounding box, in pixels.
y1number The bottom edge of the bounding box, in pixels.
x2number The right edge of the bounding box, in pixels.
y2number The top edge of the bounding box, in pixels.

Get the bounding box around all glyphs in the font.

Arguments

None

Returns

NameTypeDescription
x1number The left edge of the bounding box, in pixels.
y1number The bottom edge of the bounding box, in pixels.
x2number The right edge of the bounding box, in pixels.
y2number The top edge of the bounding box, in pixels.

See also