Package: cairo

Function cairo:scaled-font-glyph-extents

Lambda List

cairo:scaled-font-glyph-extents (font glyphs)

Syntax

(cairo:scaled-font-glyph-extents font glyphs) => xbearing, ybearing, width, height, xadvance, yadvance

Arguments

font -- a cairo:scaled-font-t instance
glyphs -- a list of glyphs, each glyph is represented by an item that is a list with the (index x y) glyph values
index -- an unsigned integer for the glyph index in the font
x -- a number coerced to a double float for the offset in the x direction between the origin used for drawing the string and the orgin of this glyph
y -- a number coerced to a double float for the y direction between the orgin used for drawing the string and the origin of this glyph

Return Value

The double floats of the cairo:text-extents-t instance with the extents of glyphs.

Details

Gets the extents for glyphs. The extents describe a user-space rectangle that encloses the "inked" portion of the glyphs, as they would be drawn by the cairo:show-glyphs function if the Cairo graphics state were set to the same font-face, font-matrix, ctm, and font-options as font. Additionally, the xadvance and yadvance values indicate the amount by which the current point would be advanced by the cairo:show-glyphs function.

Note that whitespace glyphs do not contribute to the size of the rectangle width and height values.
 

See also

2025-1-29