diff options
Diffstat (limited to 'src/cairo-surface.c')
-rw-r--r-- | src/cairo-surface.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 45296fccd..3029e2cf0 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -2614,8 +2614,16 @@ ensure_scaled_glyph (cairo_scaled_font_t *scaled_font, if (*scaled_glyph == NULL || _cairo_scaled_glyph_index (*scaled_glyph) != glyph->index) { status = _cairo_scaled_glyph_lookup (scaled_font, glyph->index, - CAIRO_SCALED_GLYPH_INFO_SURFACE, + CAIRO_SCALED_GLYPH_INFO_COLOR_SURFACE, scaled_glyph); + if (status == CAIRO_INT_STATUS_UNSUPPORTED) { + /* If the color surface not available, ensure scaled_glyph is not NULL. */ + status = _cairo_scaled_glyph_lookup (scaled_font, + glyph->index, + CAIRO_SCALED_GLYPH_INFO_METRICS, + scaled_glyph); + } + if (unlikely (status)) status = _cairo_scaled_font_set_error (scaled_font, status); |