From 8ed9cc3ff5dbbb669e0bbfac9a2409a7dcd7e76f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 16 Apr 2026 17:17:58 -0600 Subject: [PATCH] [vector-draw] Fix SVG show-extents: flush path before next glyph Free-form draw ops (extents overlay rectangles/circles) emitted via hb_vector_draw_get_funcs() accumulate in draw->path. But the SVG glyph emission clears draw->path when drawing each new glyph outline, discarding the overlay from the previous glyph. Flush any accumulated path data to body (wrapped in the Y-flip ) before clearing for the next glyph outline, so overlays for all glyphs survive to the final SVG. Assisted-by: Claude Opus 4.6 (1M context) --- src/hb-vector-draw.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hb-vector-draw.cc b/src/hb-vector-draw.cc index 44f551ed9..3c53caa58 100644 --- a/src/hb-vector-draw.cc +++ b/src/hb-vector-draw.cc @@ -647,6 +647,14 @@ hb_vector_draw_glyph_or_fail (hb_vector_draw_t *draw, case HB_VECTOR_FORMAT_SVG: { + if (draw->path.length) + { + hb_buf_append_str (&draw->body, "body, draw->path.arrayZ, draw->path.length); + hb_buf_append_str (&draw->body, "\"/>\n"); + draw->path.shrink (0); + } + if (!hb_set_has (draw->defined_glyphs, glyph)) { draw->path.clear ();