|  | 
| cobject * | cobj () | 
|  | Provides acces to the underlying C cairo object. 
 | 
|  | 
| const cobject * | cobj () const | 
|  | Provides acces to the underlying C cairo object. 
 | 
|  | 
|  | ScaledFont (cobject *cobj, bool has_reference=false) | 
|  | Create a C++ wrapper object from the C instance. 
 | 
|  | 
|  | ScaledFont (const ScaledFont &)=delete | 
|  | 
| ScaledFont & | operator= (const ScaledFont &)=delete | 
|  | 
| virtual | ~ScaledFont () | 
|  | 
| void | get_extents (FontExtents &extents) const | 
|  | Gets the metrics for a ScaledFont. 
 | 
|  | 
| void | extents (FontExtents & extents) const | 
|  | 
| void | get_text_extents (const std::string &utf8, TextExtents &extents) const | 
|  | Gets the extents for a string of text. 
 | 
|  | 
| void | text_extents (const std::string &utf8, TextExtents &extents) const | 
|  | 
| void | get_glyph_extents (const std::vector< Glyph > &glyphs, TextExtents &extents) | 
|  | Gets the extents for an array of glyphs. 
 | 
|  | 
| void | glyph_extents (const std::vector< Glyph > &glyphs, TextExtents &extents) | 
|  | 
| RefPtr< FontFace > | get_font_face () const | 
|  | The FontFace with which this ScaledFont was created. 
 | 
|  | 
| void | get_font_options (FontOptions &options) const | 
|  | Gets the FontOptions with which the ScaledFont was created. 
 | 
|  | 
| void | get_font_matrix (Matrix &font_matrix) const | 
|  | Gets the font matrix with which the ScaledFont was created. 
 | 
|  | 
| void | get_font_matrix (cairo_matrix_t &font_matrix) const | 
|  | 
| void | get_ctm (Matrix &ctm) const | 
|  | Gets the CTM with which the ScaledFont was created. 
 | 
|  | 
| void | get_ctm (cairo_matrix_t &ctm) const | 
|  | 
| FontType | get_type () const | 
|  | Gets the type of scaled Font. 
 | 
|  | 
| void | text_to_glyphs (double x, double y, const std::string &utf8, std::vector< Glyph > &glyphs, std::vector< TextCluster > &clusters, TextClusterFlags &cluster_flags) | 
|  | 
| void | get_scale_matrix (Matrix &scale_matrix) const | 
|  | Stores the scale matrix of this scaled font into matrix. 
 | 
|  | 
A ScaledFont is a font scaled to a particular size and device resolution. 
It is most useful for low-level font usage where a library or application wants to cache a reference to a scaled font to speed up the computation of metrics. 
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 the ScaledFont object). 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 (extents.width and extents.height).
- Parameters
- 
  
    | glyphs | A vector of glyphs to calculate the extents of. |  | extents | Returns the extents for the array of glyphs. |  
 
- Since
- 1.8 
 
 
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 Context::show_text() if the cairo graphics state were set to the same font_face, font_matrix, ctm, and font_options as the ScaledFont object). Additionally, the x_advance and y_advance values indicate the amount by which the current point would be advanced by Context::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.
- Parameters
- 
  
    | utf8 | a string of text, encoded in UTF-8. |  | extents | Returns the extents of the given string. |  
 
- Since
- 1.8