Next: Font Options, Previous: cairo_font_face_t, Up: Top
Caching metrics for a particular font size
<cairo-font-face-t>) (font-matrix <cairo-matrix-t>) (ctm <cairo-matrix-t>) (options <cairo-font-options-t>) => (ret <cairo-scaled-font-t>)Creates a
<cairo-scaled-font-t>object from a font face and matrices that describe the size of the font and the environment in which it will be used.
- font-face
- a
<cairo-font-face-t>- font-matrix
- font space to user space transformation matrix for the font. In the simplest case of a N point font, this matrix is just a scale by N, but it can also be used to shear the font or stretch it unequally along the two axes. See
cairo-set-font-matrix.- ctm
- user to device transformation matrix with which the font will be used.
- options
- options to use when getting metrics for the font and rendering with it.
- ret
- a newly created
<cairo-scaled-font-t>. Destroy withcairo-scaled-font-destroy
<cairo-scaled-font-t>) (extents <cairo-font-extents-t>)Gets the metrics for a
<cairo-scaled-font-t>.
- scaled-font
- a
<cairo-scaled-font-t>- extents
- a
<cairo-font-extents-t>which to store the retrieved extents.
<cairo-scaled-font-t>) (utf8 <char>) (extents <cairo-text-extents-t>)Gets the extents for a string of text. The extents describe a user-space rectangle that encloses the "inked" portion of the text drawn at the origin (0,0) (as it would be drawn by
cairo-show-textif the cairo graphics state were set to the same font_face, font_matrix, ctm, and font_options as scaled-font). Additionally, the x_advance and y_advance values indicate the amount by which the current point would be advanced bycairo-show-text.Note that whitespace characters do not directly contribute to the size of the rectangle (extents.width and extents.height). They do contribute indirectly by changing the position of non-whitespace characters. In particular, trailing whitespace characters are likely to not affect the size of the rectangle, though they will affect the x_advance and y_advance values.
- scaled-font
- a
<cairo-scaled-font-t>- utf8
- a string of text, encoded in UTF-8
- extents
- a
<cairo-text-extents-t>which to store the retrieved extents.Since 1.2
<cairo-scaled-font-t>) (glyphs <cairo-glyph-t>) (num-glyphs <int>) (extents <cairo-text-extents-t>)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
cairo-show-glyphsif the cairo graphics state were set to the same font_face, font_matrix, ctm, and font_options as scaled-font). Additionally, the x_advance and y_advance values indicate the amount by which the current point would be advanced by cairo_show_glyphs.Note that whitespace glyphs do not contribute to the size of the rectangle (extents.width and extents.height).
- scaled-font
- a
<cairo-scaled-font-t>- glyphs
- an array of glyph IDs with X and Y offsets.
- num-glyphs
- the number of glyphs in the glyphs array
- extents
- a
<cairo-text-extents-t>which to store the retrieved extents.
<cairo-scaled-font-t>) => (ret <cairo-font-face-t>)Gets the font face that this scaled font was created for.
- scaled-font
- a
<cairo-scaled-font-t>- ret
- The
<cairo-font-face-t>with which scaled-font was created.Since 1.2
<cairo-scaled-font-t>) (options <cairo-font-options-t>)Stores the font options with which scaled-font was created into options.
- scaled-font
- a
<cairo-scaled-font-t>- options
- return value for the font options
Since 1.2
<cairo-scaled-font-t>) (font-matrix <cairo-matrix-t>)Stores the font matrix with which scaled-font was created into matrix.
- scaled-font
- a
<cairo-scaled-font-t>- font-matrix
- return value for the matrix
Since 1.2