cairomm 1.16.2

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Cairo::FtScaledFont Class Reference

`#include <cairomm/scaledfont.h>`

Inheritance diagram for Cairo::FtScaledFont:
[legend]

## Public Member Functions
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...
Public Member Functions inherited from Cairo::ScaledFont
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 | get_text_extents (const std::string & utf8, TextExtents & extents) const
| Gets the extents for a string of text. More...
void | get_glyph_extents (const std::vector< Glyph > & glyphs, TextExtents & extents)
| Gets the extents for an array of glyphs. More...
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_ctm (Matrix & ctm) const
| Gets the CTM with which the ScaledFont was created. More...
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...

## Static Public Member Functions
static RefPtr< FtScaledFont > | create (const RefPtr< FtFontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())
| Creates a ScaledFont From a FtFontFace. More...
Static Public Member Functions inherited from Cairo::ScaledFont
static RefPtr< ScaledFont > | create (const RefPtr< FontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())
| Creates a ScaledFont object from a font face and matrices that describe the size of the font and the environment in which it will be used. More...

## Protected Member Functions
| FtScaledFont (const RefPtr< FtFontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())
Protected Member Functions inherited from Cairo::ScaledFont
| ScaledFont (const RefPtr< FontFace > & font_face, const Matrix & font_matrix, const Matrix & ctm, const FontOptions & options=FontOptions())

## Additional Inherited Members
Public Types inherited from Cairo::ScaledFont
typedef cairo_scaled_font_t | cobject
| The underlying C cairo object type. More...
Protected Attributes inherited from Cairo::ScaledFont
cobject * | m_cobject
| The underlying C cairo object that is wrapped by this ScaledFont. More...

## Detailed Description

Since
  1.8

## Constructor & Destructor Documentation

## ◆ FtScaledFont()

Cairo::FtScaledFont::FtScaledFont | ( | const RefPtr< FtFontFace > & | font_face,
|  | const Matrix & | font_matrix,
|  | const Matrix & | ctm,
|  | const FontOptions & | options = `FontOptions()`
| ) |  |
| protected

## Member Function Documentation

## ◆ create()

static RefPtr< FtScaledFont > Cairo::FtScaledFont::create | ( | const RefPtr< FtFontFace > & | font_face,
|  | const Matrix & | font_matrix,
|  | const Matrix & | ctm,
|  | const FontOptions & | options = `FontOptions()`
| ) |  |
| static

Creates a ScaledFont From a FtFontFace.

Since
  1.8

## ◆ lock_face()

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

## ◆ unlock_face()

void Cairo::FtScaledFont::unlock_face | ( |  | ) |

Releases a face obtained with lock_face().

Since
  1.8

The documentation for this class was generated from the following file:

- cairomm/scaledfont.h