#include <cairomm/fontface.h>
|
static RefPtr< FtFontFace > | create (FT_Face face, int load_flags) |
| Creates a new font face for the FreeType font backend from a pre-opened FreeType face. More...
|
|
◆ FtFontFace()
Cairo::FtFontFace::FtFontFace |
( |
FT_Face |
face, |
|
|
int |
load_flags |
|
) |
| |
|
protected |
◆ create()
static RefPtr<FtFontFace> Cairo::FtFontFace::create |
( |
FT_Face |
face, |
|
|
int |
load_flags |
|
) |
| |
|
static |
Creates a new font face for the FreeType font backend from a pre-opened FreeType face.
This font can then be used with Context::set_font_face() or FtScaledFont::create().
As an example, here is how one might correctly couple the lifetime of the FreeType face object to the FtFontFace:
static const cairo_user_data_key_t key;
font_face = cairo_ft_font_face_create_for_ft_face (ft_face, 0);
status = cairo_font_face_set_user_data (font_face, &key,
ft_face, (cairo_destroy_func_t) FT_Done_Face);
if (status) {
cairo_font_face_destroy (font_face);
FT_Done_Face (ft_face);
return ERROR;
}
- Parameters
-
face | A FreeType face object, already opened. This must be kept around until the face's ref_count drops to zero and it is freed. Since the face may be referenced internally to Cairo, the best way to determine when it is safe to free the face is to pass a cairo_destroy_func_t to cairo_font_face_set_user_data(). |
load_flags | flags to pass to FT_Load_Glyph when loading glyphs from the font. These flags are OR'ed together with the flags derived from the cairo_font_options_t passed to cairo_scaled_font_create(), so only a few values such as FT_LOAD_VERTICAL_LAYOUT, and FT_LOAD_FORCE_AUTOHINT are useful. You should not pass any of the flags affecting the load target, such as FT_LOAD_TARGET_LIGHT. |
- Since
- 1.8
◆ get_synthesize()
Returns currently activy FreeType glyph synthesis options.
- Since
- 1.12
◆ set_synthesize()
void Cairo::FtFontFace::set_synthesize |
( |
FtSynthesize |
synth_flags | ) |
|
Sets synthesis options to control how FreeType renders the glyphs for a particular font face.
The given options are ORed with the currently active options.
- Parameters
-
synth_flags | A set of synthesis options to enable |
- Since
- 1.12
◆ unset_synthesize()
void Cairo::FtFontFace::unset_synthesize |
( |
FtSynthesize |
synth_flags | ) |
|
Unsets the specified FreeType glypth synthesis options.
- Parameters
-
synth_flags | A set of synthesis options to disable |
- Since
- 1.12
The documentation for this class was generated from the following file: