From a6952e65235754b239d35b401cd13bda5b3173df Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 22 Feb 2026 01:29:53 -0300 Subject: [PATCH] raster: add hb_raster_paint_set_foreground() API Co-Authored-By: Claude Opus 4.6 --- src/hb-raster-paint.cc | 18 ++++++++++++++++++ src/hb-raster.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/src/hb-raster-paint.cc b/src/hb-raster-paint.cc index 6ad0036ed..20643fcac 100644 --- a/src/hb-raster-paint.cc +++ b/src/hb-raster-paint.cc @@ -1177,6 +1177,24 @@ hb_raster_paint_set_extents (hb_raster_paint_t *paint, paint->fixed_extents.stride = paint->fixed_extents.width * 4; } +/** + * hb_raster_paint_set_foreground: + * @paint: a paint context + * @foreground: the foreground color + * + * Sets the foreground color used when paint callbacks request it + * (e.g. `is_foreground` in color stops or solid fills). + * + * XSince: REPLACEME + **/ +void +hb_raster_paint_set_foreground (hb_raster_paint_t *paint, + hb_color_t foreground) +{ + if (unlikely (!paint)) return; + paint->foreground = foreground; +} + /** * hb_raster_paint_get_funcs: * diff --git a/src/hb-raster.h b/src/hb-raster.h index 3687c0435..4220caa1d 100644 --- a/src/hb-raster.h +++ b/src/hb-raster.h @@ -222,6 +222,10 @@ HB_EXTERN void hb_raster_paint_set_extents (hb_raster_paint_t *paint, const hb_raster_extents_t *extents); +HB_EXTERN void +hb_raster_paint_set_foreground (hb_raster_paint_t *paint, + hb_color_t foreground); + HB_EXTERN hb_paint_funcs_t * hb_raster_paint_get_funcs (void);