Rasterizer:getBoundingBox

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.


x1, y1, x2, y2 = Rasterizer:getBoundingBox(character)

Arguments

NameTypeDescription
characterstring A character.

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.

x1, y1, x2, y2 = Rasterizer:getBoundingBox(codepoint)

Arguments

NameTypeDescription
codepointnumber A 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.

x1, y1, x2, y2 = Rasterizer:getBoundingBox()

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