From 8c3c41ca737e35740cd2fd7ddf09533f0453dc91 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sat, 14 Aug 2021 18:14:44 +0930 Subject: Add cairo_user_font_face_get_render_color_glyph_func --- src/cairo-user-font.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/cairo-user-font.c') diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c index 9b8872db5..089b64ad2 100644 --- a/src/cairo-user-font.c +++ b/src/cairo-user-font.c @@ -870,6 +870,34 @@ cairo_user_font_face_get_init_func (cairo_font_face_t *font_face) return user_font_face->scaled_font_methods.init; } +/** + * cairo_user_font_face_get_render_color_glyph_func: + * @font_face: A user font face + * + * Gets the color glyph rendering function of a user-font. + * + * Return value: The render_glyph callback of @font_face + * or %NULL if none set or an error has occurred. + * + * Since: 1.18 + **/ +cairo_user_scaled_font_render_glyph_func_t +cairo_user_font_face_get_render_color_glyph_func (cairo_font_face_t *font_face) +{ + cairo_user_font_face_t *user_font_face; + + if (font_face->status) + return NULL; + + if (! _cairo_font_face_is_user (font_face)) { + if (_cairo_font_face_set_error (font_face, CAIRO_STATUS_FONT_TYPE_MISMATCH)) + return NULL; + } + + user_font_face = (cairo_user_font_face_t *) font_face; + return user_font_face->scaled_font_methods.render_color_glyph; +} + /** * cairo_user_font_face_get_render_glyph_func: * @font_face: A user font face -- cgit v1.2.1