Method Cairo.ScaledFont()->glyph_extents()
- Method
glyph_extents
TextExtentsglyph_extents(array(Glyph|array(int|float))glyphs)- Description
Gets the extents for an array of glyphs. The extents describe a user-space rectangle that encloses the "inked" portion of the glyphs, (as they would be drawn by Context->show_glyphs() if the cairo graphics state were set to the same font_face, font_matrix, ctm, and font_options as this ScaledFont). Additionally, the x_advance and y_advance values indicate the amount by which the current point would be advanced by Context->show_glyphs().
Note that whitespace glyphs do not contribute to the size of the rectangle (TextExtents->width and TextExtents->height).
- Parameter
glyphs an array of glyph IDs with X and Y offsets, with each glyph being represented either as a Glyph object or as an array having the following format:
Array int0glyph index in the font. The exact interpretation of the glyph index depends on the font technology being used.
float|int1the offset in the X direction between the origin used for drawing the string and the origin of this glyph
float|int2the offset in the Y direction between the origin used for drawing the string and the origin of this glyph
- Returns
a TextExtents object which stores the retrieved extents.