summaryrefslogtreecommitdiff
path: root/src/cairo-font-face.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-12-17 18:05:51 -0500
committerBehdad Esfahbod <behdad@behdad.org>2008-12-17 18:19:24 -0500
commit5ee6aad471d460f960a5e7a5a8e35aca0f0af60e (patch)
tree43592a767b5da3bfb3f1ed07c7fcf802721b0054 /src/cairo-font-face.c
parenteb069094ea4471b3e63881fe0f8b958ad8924c7d (diff)
[toy] Use twin font if font backend returns UNSUPPORTED
Diffstat (limited to 'src/cairo-font-face.c')
-rw-r--r--src/cairo-font-face.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c
index 8a1b292c..88e782b9 100644
--- a/src/cairo-font-face.c
+++ b/src/cairo-font-face.c
@@ -402,26 +402,23 @@ _cairo_toy_font_face_create_impl_face (cairo_toy_font_face_t *font_face)
{
const cairo_font_face_backend_t * backend = CAIRO_FONT_FACE_BACKEND_DEFAULT;
cairo_font_face_t *impl_font_face;
- cairo_status_t status;
+ cairo_int_status_t status = CAIRO_INT_STATUS_UNSUPPORTED;
if (font_face->base.status)
return NULL;
- if (backend->create_for_toy == NULL ||
- (CAIRO_FONT_FACE_BACKEND_DEFAULT != &_cairo_user_font_face_backend &&
- 0 == strncmp (font_face->family, CAIRO_USER_FONT_FAMILY_DEFAULT,
- strlen (CAIRO_USER_FONT_FAMILY_DEFAULT))))
+ if (backend->create_for_toy != NULL &&
+ 0 != strncmp (font_face->family, CAIRO_USER_FONT_FAMILY_DEFAULT,
+ strlen (CAIRO_USER_FONT_FAMILY_DEFAULT)))
{
- backend = &_cairo_user_font_face_backend;
+ status = backend->create_for_toy (font_face, &impl_font_face);
}
- if (backend->create_for_toy == NULL) {
- ASSERT_NOT_REACHED;
- return NULL;
+ if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
+ backend = &_cairo_user_font_face_backend;
+ status = backend->create_for_toy (font_face, &impl_font_face);
}
- status = backend->create_for_toy (font_face, &impl_font_face);
-
if (_cairo_font_face_set_error (&font_face->base, status))
return NULL;