Name
pfont:GetGlyphExtents -- get glyph extents
Synopsis
ink_rect, logical_rect = pfont:GetGlyphExtents(glyph)
Function
Gets the logical and ink extents of a glyph within a font. This function returns two tables that have the fields the x, y, width, and height initialized.

The coordinate system for each rectangle has its origin at the base line and horizontal origin of the character with increasing coordinates extending to the right and down. The macros PANGO_ASCENT(), PANGO_DESCENT(), PANGO_LBEARING(), and PANGO_RBEARING() can be used to convert from the extents rectangle to more traditional font metrics. The units of the rectangles are in 1/#PANGO_SCALE of a device unit.

If the font is a NULL object, this function gracefully sets some sane values in the output variables and returns.

Inputs
glyph
the glyph index
Results
ink_rect
table containing the extents of the glyph as drawn
logical_rect
table containing the logical extents of the glyph

Show TOC