From bc00cd8fb5871a874263c39fceb10e6fba47f8f7 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 12 Jul 2026 21:16:46 +0300 Subject: [PATCH] [fontations] Use fill_glyph for solid glyph fills --- src/rust/font.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/rust/font.rs b/src/rust/font.rs index 84bc79b57..247bcdf0c 100644 --- a/src/rust/font.rs +++ b/src/rust/font.rs @@ -701,6 +701,32 @@ impl ColorPainter for HbColorPainter<'_> { ) { unsafe { hb_paint_push_inverse_font_transform(self.paint_funcs, self.paint_data, self.font); + } + + if brush_transform.is_none() { + if let Brush::Solid { + palette_index: color_index, + alpha, + } = brush + { + let is_foreground = color_index == 0xFFFF; + let color = self.lookup_color(color_index, alpha); + unsafe { + hb_paint_fill_glyph( + self.paint_funcs, + self.paint_data, + glyph_id.to_u32() as hb_codepoint_t, + self.font, + is_foreground as hb_bool_t, + color, + ); + } + self.pop_transform(); + return; + } + } + + unsafe { hb_paint_push_clip_glyph( self.paint_funcs, self.paint_data,