Name
cscaledfont:GlyphExtents -- get glyph extents
Synopsis
t = cscaledfont:GlyphExtents(glyphs[, offset, num_glyphs])
Function
Gets the extents for a glyphs array. The extents describe a user-space rectangle that encloses the "inked" portion of the glyphs as they would be drawn by ccontext:ShowGlyphs() if the cairo graphics state were set to the same font face, font matrix, ctm, and font options as the scaled font. Additionally, the XAdvance and YAdvance values indicate the amount by which the current point would be advanced by ccontext:ShowGlyphs().

Note that whitespace glyphs do not contribute to the size of the rectangle as returned in the Width and Height members of the extents.

This function returns a table containing the glyph extents. See ccontext:TextExtents() for a description of all table members.

Inputs
glyphs
a glyphs array containinig glyph IDs with X and Y offsets
offset
optional: offset into the array that specifies the starting glyph (defaults to 0 which means first glyph)
num_glyphs
optional: number of glyphs to show (defaults to -1 which means all glyphs)
Results
t
table containing the glyph extents (see above)

Show TOC