[hb-view] Update to alternative cairo custom-palette API

This commit is contained in:
Behdad Esfahbod 2023-01-20 13:38:22 -07:00
parent 638e0ed4fd
commit f21b15dcc3
3 changed files with 5 additions and 3 deletions

View File

@ -214,6 +214,7 @@ if cairo_dep.found()
else
check_funcs += [['cairo_user_font_face_set_render_color_glyph_func', {'deps': cairo_dep}]]
endif
check_funcs += [['cairo_font_options_get_custom_palette_color', {'deps': cairo_dep}]]
endif
if cairo_ft_dep.found()

View File

@ -313,7 +313,7 @@ hb_cairo_paint_custom_palette_color (hb_paint_funcs_t *funcs,
hb_color_t *color,
void *user_data HB_UNUSED)
{
#ifdef CAIRO_COLOR_PALETTE_CUSTOM
#ifdef HAVE_CAIRO_FONT_OPTIONS_GET_CUSTOM_PALETTE_COLOR
cairo_t *cr = (cairo_t *) paint_data;
cairo_font_options_t *options;
@ -321,7 +321,8 @@ hb_cairo_paint_custom_palette_color (hb_paint_funcs_t *funcs,
options = cairo_font_options_create ();
cairo_get_font_options (cr, options);
if (cairo_font_options_get_custom_palette_color (options, color_index,
if (CAIRO_STATUS_SUCCESS ==
cairo_font_options_get_custom_palette_color (options, color_index,
&red, &green, &blue, &alpha))
{
cairo_font_options_destroy (options);

View File

@ -126,7 +126,7 @@ helper_cairo_create_scaled_font (const font_options_t *font_opts,
#ifdef CAIRO_COLOR_PALETTE_DEFAULT
cairo_font_options_set_color_palette (font_options, view_opts->palette);
#endif
#ifdef CAIRO_COLOR_PALETTE_CUSTOM
#ifdef HAVE_CAIRO_FONT_OPTIONS_GET_CUSTOM_PALETTE_COLOR
if (view_opts->custom_palette)
{
char **entries = g_strsplit (view_opts->custom_palette, ",", -1);