From e550176a494ccaf59389b5a82b44bf60da9ec320 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 26 Feb 2026 21:08:00 -0300 Subject: [PATCH] [docs] Normalize custom palette API wording across paint/raster/vector --- src/hb-paint.cc | 12 ++++++------ src/hb-paint.h | 37 +++++++++++++++++++------------------ src/hb-raster-paint.cc | 3 +++ 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/hb-paint.cc b/src/hb-paint.cc index 5dd97d5bb..ffdd3c3a5 100644 --- a/src/hb-paint.cc +++ b/src/hb-paint.cc @@ -742,14 +742,14 @@ hb_paint_pop_group (hb_paint_funcs_t *funcs, void *paint_data, /** * hb_paint_custom_palette_color: - * @funcs: paint functions - * @paint_data: associated data passed by the caller - * @color_index: color index - * @color: (out): fetched color + * @funcs: paint functions. + * @paint_data: associated data passed by the caller. + * @color_index: color index to fetch. + * @color: (out): fetched color. * - * Gets the custom palette color for @color_index. + * Gets the custom palette override color for @color_index. * - * Return value: `true` if found, `false` otherwise + * Return value: `true` if a custom color is provided, `false` otherwise. * * Since: 7.0.0 */ diff --git a/src/hb-paint.h b/src/hb-paint.h index 378507729..787118c46 100644 --- a/src/hb-paint.h +++ b/src/hb-paint.h @@ -684,23 +684,24 @@ typedef void (*hb_paint_pop_group_func_t) (hb_paint_funcs_t *funcs, /** * hb_paint_custom_palette_color_func_t: - * @funcs: paint functions object - * @paint_data: The data accompanying the paint functions in hb_font_paint_glyph() - * @color_index: the color index - * @color: (out): fetched color - * @user_data: User data pointer passed to hb_paint_funcs_set_pop_group_func() + * @funcs: paint functions object. + * @paint_data: data accompanying the paint functions in hb_font_paint_glyph(). + * @color_index: color index to fetch. + * @color: (out): fetched color. + * @user_data: user data pointer passed to hb_paint_funcs_set_custom_palette_color_func(). * - * A virtual method for the #hb_paint_funcs_t to fetch a color from the custom - * color palette. + * A virtual method for #hb_paint_funcs_t to fetch a custom palette override + * color for @color_index. * - * Custom palette colors override the colors from the fonts selected color - * palette. It is not necessary to override all palette entries; for entries - * that should be taken from the font palette, return `false`. + * Custom palette colors override colors from the font's selected color palette. + * It is not necessary to override all palette entries; return `false` for + * entries that should be taken from the font palette. * - * This function might get called multiple times, but the custom palette is - * expected to remain unchanged for duration of a hb_font_paint_glyph() call. + * This function might be called multiple times, but the custom palette is + * expected to remain unchanged for the duration of one + * hb_font_paint_glyph() call. * - * Return value: `true` if found, `false` otherwise + * Return value: `true` if a custom color is provided, `false` otherwise. * * Since: 7.0.0 */ @@ -934,12 +935,12 @@ hb_paint_funcs_set_pop_group_func (hb_paint_funcs_t *funcs, /** * hb_paint_funcs_set_custom_palette_color_func: - * @funcs: A paint functions struct - * @func: (closure user_data) (destroy destroy) (scope notified): The custom-palette-color callback - * @user_data: Data to pass to @func - * @destroy: (nullable): Function to call when @user_data is no longer needed + * @funcs: a paint functions struct. + * @func: (closure user_data) (destroy destroy) (scope notified): custom-palette-color callback. + * @user_data: data to pass to @func. + * @destroy: (nullable): function to call when @user_data is no longer needed. * - * Sets the custom-palette-color callback on the paint functions struct. + * Sets the custom-palette-color callback on @funcs. * * Since: 7.0.0 */ diff --git a/src/hb-raster-paint.cc b/src/hb-raster-paint.cc index 67af5b33c..6f7b9e2a4 100644 --- a/src/hb-raster-paint.cc +++ b/src/hb-raster-paint.cc @@ -1881,6 +1881,9 @@ hb_raster_paint_clear_custom_palette_colors (hb_raster_paint_t *paint) * Overrides are keyed by @color_index and persist on @paint until cleared * (or replaced for the same index). * + * These overrides are consulted by paint operations that resolve CPAL + * entries. + * * Return value: `true` if the override was set; `false` on allocation failure. * * XSince: REPLACEME