cairomm: Cairo::FtScaledFont Class Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions

# Cairo::FtScaledFont Class Reference

Inheritance diagram for Cairo::FtScaledFont:
[legend]

List of all members.

## Public Member Functions
FT_Face | lock_face ()
| Gets the FT_Face object from a FreeType backend font and scales it appropriately for the font.
void | unlock_face ()
| Releases a face obtained with lock_face().
## 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.
## Protected Member Functions
| FtScaledFont (const RefPtr< FtFontFace >& font_face, const Matrix& font_matrix, const Matrix& ctm, const FontOptions& options=FontOptions())

## Detailed Description

Since:
  1.8

## Constructor & Destructor Documentation

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

## Member Function Documentation

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

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

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