cairo_font_face_t

cairo_font_face_t — Base class for fonts

Synopsis

typedef             cairo_font_face_t;
cairo_font_face_t*  cairo_font_face_reference           (cairo_font_face_t *font_face);
void                cairo_font_face_destroy             (cairo_font_face_t *font_face);
cairo_status_t      cairo_font_face_status              (cairo_font_face_t *font_face);
void*               cairo_font_face_get_user_data       (cairo_font_face_t *font_face,
                                                         const cairo_user_data_key_t *key);
cairo_status_t      cairo_font_face_set_user_data       (cairo_font_face_t *font_face,
                                                         const cairo_user_data_key_t *key,
                                                         void *user_data,
                                                         cairo_destroy_func_t destroy);

Description

Details

cairo_font_face_t

typedef struct _cairo_font_face cairo_font_face_t;

A cairo_font_face_t specifies all aspects of a font other than the size or font matrix (a font matrix is used to distort a font by sheering it or scaling it unequally in the two directions) . A font face can be set on a cairo_t by using cairo_set_font_face(); the size and font matrix are set with cairo_set_font_size() and cairo_set_font_matrix().


cairo_font_face_reference ()

cairo_font_face_t*  cairo_font_face_reference           (cairo_font_face_t *font_face);

Increases the reference count on font_face by one. This prevents font_face from being destroyed until a matching call to cairo_font_face_destroy() is made.

font_face :

a cairo_font_face_t, (may be NULL in which case this function does nothing).

Returns :

the referenced cairo_font_face_t.

cairo_font_face_destroy ()

void                cairo_font_face_destroy             (cairo_font_face_t *font_face);

Decreases the reference count on font_face by one. If the result is zero, then font_face and all associated resources are freed. See cairo_font_face_reference().

font_face :

a cairo_font_face_t

cairo_font_face_status ()

cairo_status_t      cairo_font_face_status              (cairo_font_face_t *font_face);

Checks whether an error has previously occurred for this font face

font_face :

a cairo_font_face_t

Returns :

CAIRO_STATUS_SUCCESS or another error such as CAIRO_STATUS_NO_MEMORY.

cairo_font_face_get_user_data ()

void*               cairo_font_face_get_user_data       (cairo_font_face_t *font_face,
                                                         const cairo_user_data_key_t *key);

Return user data previously attached to font_face using the specified key. If no user data has been attached with the given key this function returns NULL.

font_face :

a cairo_font_face_t

key :

the address of the cairo_user_data_key_t the user data was attached to

Returns :

the user data previously attached or NULL.

cairo_font_face_set_user_data ()

cairo_status_t      cairo_font_face_set_user_data       (cairo_font_face_t *font_face,
                                                         const cairo_user_data_key_t *key,
                                                         void *user_data,
                                                         cairo_destroy_func_t destroy);

Attach user data to font_face. To remove user data from a font face, call this function with the key that was used to set it and NULL for data.

font_face :

a cairo_font_face_t

key :

the address of a cairo_user_data_key_t to attach the user data to

user_data :

the user data to attach to the font face

destroy :

a cairo_destroy_func_t which will be called when the font face is destroyed or when new user data is attached using the same key.

Returns :

CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY if a slot could not be allocated for the user data.