diff --git a/src/hb-vector-svg.cc b/src/hb-vector-svg.cc index 41d9ec2cc..8efd584a8 100644 --- a/src/hb-vector-svg.cc +++ b/src/hb-vector-svg.cc @@ -2315,13 +2315,8 @@ hb_vector_paint_glyph (hb_vector_paint_t *paint, hb_codepoint_t glyph, float pen_x, float pen_y, - hb_vector_extents_mode_t extents_mode, - unsigned palette, - hb_color_t foreground) + hb_vector_extents_mode_t extents_mode) { - paint->palette = (int) palette; - paint->foreground = foreground; - float xx = paint->transform.xx; float yx = paint->transform.yx; float xy = paint->transform.xy; @@ -2350,7 +2345,9 @@ hb_vector_paint_glyph (hb_vector_paint_t *paint, hb_vector_paint_ensure_initialized (paint); bool can_cache = !paint->flat; - hb_svg_color_glyph_cache_key_t cache_key = hb_svg_color_glyph_cache_key (glyph, palette, foreground); + hb_svg_color_glyph_cache_key_t cache_key = hb_svg_color_glyph_cache_key (glyph, + (unsigned) paint->palette, + paint->foreground); if (can_cache) { if (paint->defined_color_glyphs.has (cache_key)) @@ -2392,7 +2389,8 @@ hb_vector_paint_glyph (hb_vector_paint_t *paint, paint->current_face = hb_font_get_face (font); hb_bool_t ret = hb_font_paint_glyph_or_fail (font, glyph, hb_vector_paint_get_funcs (), paint, - palette, foreground); + (unsigned) paint->palette, + paint->foreground); paint->current_svg_image_glyph = old_gid; paint->current_face = old_face; if (unlikely (!ret)) @@ -2452,7 +2450,8 @@ hb_vector_paint_glyph (hb_vector_paint_t *paint, paint->current_face = hb_font_get_face (font); hb_bool_t ret = hb_font_paint_glyph_or_fail (font, glyph, hb_vector_paint_get_funcs (), paint, - palette, foreground); + (unsigned) paint->palette, + paint->foreground); paint->current_svg_image_glyph = old_gid; paint->current_face = old_face; hb_svg_append_str (&body, "\n"); diff --git a/src/hb-vector.h b/src/hb-vector.h index 85f4dbe7b..d06328c37 100644 --- a/src/hb-vector.h +++ b/src/hb-vector.h @@ -512,8 +512,6 @@ hb_vector_paint_get_funcs (void); * @pen_x: glyph x origin before context transform. * @pen_y: glyph y origin before context transform. * @extents_mode: extents update mode. - * @palette: color palette index. - * @foreground: fallback foreground color. * * Paints one color glyph into @paint. * @@ -527,9 +525,7 @@ hb_vector_paint_glyph (hb_vector_paint_t *paint, hb_codepoint_t glyph, float pen_x, float pen_y, - hb_vector_extents_mode_t extents_mode, - unsigned palette, - hb_color_t foreground); + hb_vector_extents_mode_t extents_mode); /** * hb_vector_svg_paint_set_flat: diff --git a/util/hb-vector-svg-all.c b/util/hb-vector-svg-all.c index ae7af7b33..4b0b14ae5 100644 --- a/util/hb-vector-svg-all.c +++ b/util/hb-vector-svg-all.c @@ -49,13 +49,15 @@ main (int argc, char **argv) return 1; } + hb_vector_paint_set_palette (paint, 0); + hb_vector_paint_set_foreground (paint, HB_COLOR (0, 0, 0, 255)); + unsigned glyph_count = hb_face_get_glyph_count (face); for (unsigned gid = 0; gid < glyph_count; gid++) { hb_vector_paint_set_transform (paint, 1.f, 0.f, 0.f, 1.f, 0.f, 0.f); if (hb_vector_paint_glyph (paint, font, gid, 0.f, 0.f, - HB_VECTOR_EXTENTS_MODE_EXPAND, - 0, HB_COLOR (0, 0, 0, 255))) + HB_VECTOR_EXTENTS_MODE_EXPAND)) { hb_blob_t *blob = hb_vector_paint_render (paint); hb_vector_paint_recycle_blob (paint, blob); diff --git a/util/vector-output.hh b/util/vector-output.hh index 0b872a089..8caf82343 100644 --- a/util/vector-output.hh +++ b/util/vector-output.hh @@ -262,8 +262,7 @@ struct vector_output_t : output_options_t<> hb_vector_paint_set_transform (paint, 1.f, 0.f, 0.f, 1.f, 0.f, 0.f); if (hb_vector_paint_glyph (paint, upem_font, g.gid, pen_x, pen_y, - extents_mode, - palette, foreground)) + extents_mode)) { had_paint = true; continue;