[cairo-commit] 2 commits - src/cairo-ft-font.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Apr 30 08:35:21 UTC 2023
src/cairo-ft-font.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
New commits:
commit 8d6586f49f1c977318af7f7f9e4f24221c9122fc
Merge: 17ed34781 b86f24634
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Apr 30 08:35:19 2023 +0000
Merge branch 'issue-777' into 'master'
Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is defined
Closes #777
See merge request cairo/cairo!475
commit b86f24634c2ef495f62623c60d6ff0ac9c7fcbbf
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Apr 30 17:15:45 2023 +0930
Don't assume HAVE_FT_PALETTE_SELECT is defined when HAVE_FT_SVG_DOCUMENT is defined
Fixes #777
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 89af6193d..834e4ba31 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -2518,19 +2518,17 @@ _cairo_ft_glyph_fini (cairo_scaled_glyph_private_t *glyph_private,
}
-#ifdef HAVE_FT_PALETTE_SELECT
static void
_cairo_ft_scaled_glyph_set_palette (cairo_ft_scaled_font_t *scaled_font,
FT_Face face,
unsigned int *num_entries_ret,
FT_Color **entries_ret)
{
- FT_Palette_Data palette_data;
- unsigned int num_entries;
- FT_Color *entries;
+ unsigned int num_entries = 0;
+ FT_Color *entries = NULL;
- num_entries = 0;
- entries = NULL;
+#ifdef HAVE_FT_PALETTE_SELECT
+ FT_Palette_Data palette_data;
if (FT_Palette_Data_Get (face, &palette_data) == 0 && palette_data.num_palettes > 0) {
FT_UShort palette_index = CAIRO_COLOR_PALETTE_DEFAULT;
@@ -2552,13 +2550,14 @@ _cairo_ft_scaled_glyph_set_palette (cairo_ft_scaled_font_t *scaled_font,
}
}
}
+#endif
+
if (num_entries_ret)
*num_entries_ret = num_entries;
if (entries_ret)
*entries_ret = entries;
}
-#endif
/* returns TRUE if foreground color used */
static cairo_bool_t
@@ -2628,9 +2627,7 @@ _cairo_ft_scaled_glyph_init_surface (cairo_ft_scaled_font_t *scaled_font,
scaled_glyph,
face,
foreground_color);
-#ifdef HAVE_FT_PALETTE_SELECT
_cairo_ft_scaled_glyph_set_palette (scaled_font, face, NULL, NULL);
-#endif
load_flags &= ~FT_LOAD_MONOCHROME;
/* clear load target mode */
More information about the cairo-commit
mailing list