[user-font] Let user decide to fall back to unicode_to_glyph in text_to_glyphs

User does this by not setting *num_glyphs.
This commit is contained in:
Behdad Esfahbod 2008-06-05 18:42:50 -04:00
parent 3b1b074695
commit 6702c7edc4

View file

@ -265,6 +265,7 @@ _cairo_user_text_to_glyphs (void *abstract_font,
int i;
*glyphs = NULL;
*num_glyphs = -1;
status = face->scaled_font_methods.text_to_glyphs (&scaled_font->base,
utf8, glyphs, num_glyphs);
@ -278,6 +279,9 @@ _cairo_user_text_to_glyphs (void *abstract_font,
return status;
}
if (*num_glyphs < 0)
return CAIRO_INT_STATUS_UNSUPPORTED;
/* Convert from font space to user space and add x,y */
for (i = 0; i < *num_glyphs; i++) {
double gx = (*glyphs)[i].x;