Files
harfbuzz/util
Behdad Esfahbod d60ffa956f [util/vector] Emit SVG/PDF in pixel units, not upem
vector-output.hh fed upem-space coordinates to the draw/paint
context and then set scale_factor=1, so the resulting SVG's
viewBox / width / height were in upem (e.g. ~2500×1400 for a
48 px "Hello" in a 1000-upem font).  Browsers sized the
inline SVG at 1 upem-unit-per-CSS-pixel, rendering it ~20×
too large.

Fix: compute the upem→pixel ratio from x_scale / y_scale
(already available) and

  * scale the explicit extents by that ratio before calling
    set_extents (so viewBox and width/height come out in
    pixels), and
  * pass its inverse as set_scale_factor so upem-space input
    coordinates (pen position, glyph outline points) get
    divided to pixels internally.

No test expected-output changes -- the vector tests render
at FONT_SIZE_UPEM where upem_to_pixel = 1 and the patch is a
no-op.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:31:37 -06:00
..
2020-07-29 08:44:23 +04:30
2023-01-16 12:38:53 -07:00
2015-04-09 19:16:57 -07:00
2026-03-03 17:19:15 -03:00
2023-01-12 17:04:24 -07:00
2026-03-03 17:19:15 -03:00
2026-03-03 17:19:15 -03:00