mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 00:38:06 +02:00
[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:
parent
3b1b074695
commit
6702c7edc4
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue