cairomm  1.16.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Cairo::FtFontFace Class Reference

#include <cairomm/fontface.h>

Inheritance diagram for Cairo::FtFontFace:
Inheritance graph
[legend]

Public Member Functions

void set_synthesize (FtSynthesize synth_flags)
 Sets synthesis options to control how FreeType renders the glyphs for a particular font face. More...
 
void unset_synthesize (FtSynthesize synth_flags)
 Unsets the specified FreeType glypth synthesis options. More...
 
FtSynthesize get_synthesize () const
 Returns currently activy FreeType glyph synthesis options. More...
 
- Public Member Functions inherited from Cairo::FontFace
 FontFace (cairo_font_face_t *cobject, bool has_reference=false)
 Create a C++ wrapper for the C instance. More...
 
 FontFace (const FontFace &)=delete
 
FontFaceoperator= (const FontFace &)=delete
 
virtual ~FontFace ()
 
FontType get_type () const
 Returns the type of the backend used to create a font face. More...
 
cobjectcobj ()
 
const cobjectcobj () const
 
void reference () const
 
void unreference () const
 

Static Public Member Functions

static RefPtr< FtFontFacecreate (FT_Face face, int load_flags)
 Creates a new font face for the FreeType font backend from a pre-opened FreeType face. More...
 

Protected Member Functions

 FtFontFace (FT_Face face, int load_flags)
 

Additional Inherited Members

- Public Types inherited from Cairo::FontFace
typedef cairo_font_face_t cobject
 
- Protected Attributes inherited from Cairo::FontFace
cobjectm_cobject
 

Constructor & Destructor Documentation

◆ FtFontFace()

Cairo::FtFontFace::FtFontFace ( FT_Face  face,
int  load_flags 
)
protected

Member Function Documentation

◆ 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
faceA 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_flagsflags 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()

FtSynthesize Cairo::FtFontFace::get_synthesize ( ) const

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_flagsA 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_flagsA set of synthesis options to disable
Since
1.12

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