[hb-draw] Fix PNG image positioning in SVG output

Position PNG images at bottom-left of glyph box for correct rendering.
Uses y_bearing + height to account for negative height values in glyph extents.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Behdad EsfahbodandClaude Sonnet 4.5 committed 2026-02-15 08:05:07 -03:00
1 parent 96884e9e09
commit 882f405e52
1 file changed
+1 -1
+1 -1
View File
@@ -754,7 +754,7 @@ paint_image (hb_paint_funcs_t *, svg_paint_data_t *data,
g_string_append (body, "<g transform=\"translate(");
data->that->append_num_to (body, (float) extents->x_bearing, data->that->precision);
g_string_append_c (body, ',');
data->that->append_num_to (body, (float) extents->y_bearing, data->that->precision);
data->that->append_num_to (body, (float) (extents->y_bearing + extents->height), data->that->precision);
g_string_append (body, ") scale(");
data->that->append_num_to (body, (float) extents->width / width, data->that->precision);
g_string_append_c (body, ',');