|
FT_Face | lock_face () |
| Gets the FT_Face object from a FreeType backend font and scales it appropriately for the font. More...
|
|
void | unlock_face () |
| Releases a face obtained with lock_face(). More...
|
|
cobject* | cobj () |
| Provides acces to the underlying C cairo object. More...
|
|
const cobject* | cobj () const |
| Provides acces to the underlying C cairo object. More...
|
|
| ScaledFont (cobject*cobj, bool has_reference=false) |
| Create a C++ wrapper object from the C instance. More...
|
|
| ScaledFont (const ScaledFont&)=delete |
|
ScaledFont& | operator= (const ScaledFont&)=delete |
|
virtual | ~ScaledFont () |
|
void | get_extents (FontExtents&extents) const |
| Gets the metrics for a ScaledFont. More...
|
|
void | extents (FontExtents& extents) const |
|
void | get_text_extents (const std::string& utf8, TextExtents&extents) const |
| Gets the extents for a string of text. More...
|
|
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. More...
|
|
void | glyph_extents (const std::vector< Glyph >& glyphs, TextExtents&extents) |
|
RefPtr< FontFace > | get_font_face () const |
| The FontFace with which this ScaledFont was created. More...
|
|
void | get_font_options (FontOptions& options) const |
| Gets the FontOptions with which the ScaledFont was created. More...
|
|
void | get_font_matrix (Matrix& font_matrix) const |
| Gets the font matrix with which the ScaledFont was created. More...
|
|
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. More...
|
|
void | get_ctm (cairo_matrix_t& ctm) const |
|
FontType | get_type () const |
| Gets the type of scaled Font. More...
|
|
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. More...
|
|
FT_Face Cairo::FtScaledFont::lock_face |
( |
| ) |
|
Gets the FT_Face object from a FreeType backend font and scales it appropriately for the font.
You must release the face with unlock_face() when you are done using it. Since the FT_Face object can be shared between multiple ScaledFont objects, you must not lock any other font objects until you unlock this one. A count is kept of the number of times lock_face() is called. unlock_face() must be called the same number of times.
You must be careful when using this function in a library or in a threaded application, because freetype's design makes it unsafe to call freetype functions simultaneously from multiple threads, (even if using distinct FT_Face objects). Because of this, application code that acquires an FT_Face object with this call must add it's own locking to protect any use of that object, (and which also must protect any other calls into cairo as almost any cairo function might result in a call into the freetype library).
- Returns
- The FT_Face object for font, scaled appropriately, or NULL if scaled_font is in an error state or there is insufficient memory.
- Since
- 1.8