From 5f527aeea151f8f4eb7aec88a79fb0e387c62545 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 13 Apr 2026 13:53:48 -0600 Subject: [PATCH] [gpu] Drop hb_paint_funcs_get_empty from hb_gpu_paint_glyph stub The stub called hb_font_paint_glyph_or_fail() with the empty paint funcs just to get a truthful has-paint return value. That pulls in hb_paint_funcs_get_empty from hb-paint.cc, which HB_LEAN strips out of the wasm build, breaking the web demo link step. Since the encoder is still a stub that accumulates nothing, there is no reason to actually invoke the paint callback walk. Stash the font scale and return false directly. When the real encoder lands it will naturally pull in whichever paint symbols it needs. Assisted-by: Claude Opus 4.6 (1M context) --- src/hb-gpu-paint.cc | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/hb-gpu-paint.cc b/src/hb-gpu-paint.cc index 526790d46..e11fb5b96 100644 --- a/src/hb-gpu-paint.cc +++ b/src/hb-gpu-paint.cc @@ -129,30 +129,25 @@ hb_gpu_paint_get_user_data (const hb_gpu_paint_t *paint, * @font: font to paint from * @glyph: glyph ID to paint * - * Convenience wrapper that feeds a color glyph's paint tree into - * the encoder via hb_font_paint_glyph_or_fail(). The font's scale - * is stashed on @paint for later use by the encoder. + * Convenience wrapper that will feed a color glyph's paint tree + * into the encoder via hb_font_paint_glyph_or_fail(). * - * Palette index and foreground color are fixed at 0 and opaque - * black for now; future versions will expose setters. + * The paint encoder is currently a stub; this function stashes the + * font scale on @paint for the future encoder and returns `false` + * for every glyph until the real encoder is implemented. * * Return value: `true` if the glyph was successfully painted into - * the encoder, `false` if the glyph has no color paint or painting - * failed. + * the encoder, `false` otherwise (including the stub state). * * XSince: REPLACEME **/ hb_bool_t hb_gpu_paint_glyph (hb_gpu_paint_t *paint, hb_font_t *font, - hb_codepoint_t glyph) + hb_codepoint_t glyph HB_UNUSED) { hb_font_get_scale (font, &paint->x_scale, &paint->y_scale); - return hb_font_paint_glyph_or_fail (font, glyph, - hb_paint_funcs_get_empty (), - paint, - 0, - HB_COLOR (0, 0, 0, 255)); + return false; } /**