mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 14:01:10 +01:00
hb-vector-paint emitted (2*x1 - x2, 2*y1 - y2) as the SVG end point -- the reflection of P2 about P1, not the projection. For COLR linear gradients the SVG end should be P1 projected onto the line through P0 perpendicular to (P2 - P0); that's the gradient's actual axis (perpendicular to the rotation line). With the old formula, fonts with rotation references far from the color line ended up with massively over-scaled gradient axes -- e.g. BungeeSpice's ABC showed solid red where raster shows a full red->yellow gradient. Add hb_paint_reduce_linear_anchors() to hb-paint.hh as the shared canonical implementation (matches hb-raster-paint and hb-cairo) and use it from hb-vector-paint. Regenerate the two affected basic.tests expected SVGs; the new gradient endpoints are now consistent with the cairo / raster outputs. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>