Implement cairo_font_face_get_type.

Add font type to font_face_backend.
Also export new CAIRO_FONT_TYPE_TOY.
This commit is contained in:
Carl Worth 2006-02-24 15:32:26 -08:00
parent 5928d03b49
commit 5a3c30eafe
6 changed files with 14 additions and 0 deletions

View file

@ -94,6 +94,7 @@ _cairo_atsui_font_face_scaled_font_create (void *abstract_face,
}
static const cairo_font_face_backend_t _cairo_atsui_font_face_backend = {
CAIRO_FONT_TYPE_ATSUI,
_cairo_atsui_font_face_destroy,
_cairo_atsui_font_face_scaled_font_create
};

View file

@ -130,6 +130,12 @@ cairo_font_face_destroy (cairo_font_face_t *font_face)
free (font_face);
}
cairo_font_type_t
cairo_font_face_get_type (cairo_font_face_t *font_face)
{
return font_face->backend->type;
}
/**
* cairo_font_face_status:
* @font_face: a #cairo_font_face_t
@ -409,6 +415,7 @@ _cairo_toy_font_face_scaled_font_create (void *abstract_font_face
}
static const cairo_font_face_backend_t _cairo_toy_font_face_backend = {
CAIRO_FONT_TYPE_TOY,
_cairo_toy_font_face_destroy,
_cairo_toy_font_face_scaled_font_create
};

View file

@ -2004,6 +2004,7 @@ _cairo_ft_font_face_scaled_font_create (void *abstract_face,
}
static const cairo_font_face_backend_t _cairo_ft_font_face_backend = {
CAIRO_FONT_TYPE_FT,
_cairo_ft_font_face_destroy,
_cairo_ft_font_face_scaled_font_create
};

View file

@ -1398,6 +1398,7 @@ _cairo_win32_font_face_scaled_font_create (void *abstract_face,
}
static const cairo_font_face_backend_t _cairo_win32_font_face_backend = {
CAIRO_FONT_TYPE_WIN32,
_cairo_win32_font_face_destroy,
_cairo_win32_font_face_scaled_font_create
};

View file

@ -928,6 +928,7 @@ cairo_font_face_status (cairo_font_face_t *font_face);
* of the wrong type is undefined.
*/
typedef enum _cairo_font_type {
CAIRO_FONT_TYPE_TOY,
CAIRO_FONT_TYPE_FT,
CAIRO_FONT_TYPE_WIN32,
CAIRO_FONT_TYPE_ATSUI

View file

@ -464,6 +464,7 @@ struct _cairo_scaled_font {
};
struct _cairo_font_face {
/* hash_entry must be first */
cairo_hash_entry_t hash_entry;
cairo_status_t status;
int ref_count;
@ -555,6 +556,8 @@ struct _cairo_scaled_font_backend {
};
struct _cairo_font_face_backend {
cairo_font_type_t type;
/* The destroy() function is allowed to resurrect the font face
* by re-referencing. This is needed for the FreeType backend.
*/