mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 08:21:32 +01:00
[fontations] Use fill_glyph for solid glyph fills
This commit is contained in:
1 parent
b4ed968183
commit
bc00cd8fb5
1 file changed
+26
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user