When `--glyphs` input omitted advances but still carried `@`
positions, the util-side parser synthesized default advances from the
font. That changed the logical width of `hb-shape --ned` output and
broke same-size round-trips through `hb-view --glyphs`.
Only synthesize advances when the glyph string has neither explicit
advances nor explicit positions.
Tested:
- meson test -C build
Fixes: https://github.com/harfbuzz/harfbuzz/issues/5377
Assisted-by: OpenAI Codex
In file included from ../util/hb-raster.cc:30:
../util/raster-output.hh:828:16: error: a type specifier is required for all declarations
828 | HB_UNUSED (img);
| ^
../util/raster-output.hh:829:16: error: a type specifier is required for all declarations
829 | HB_UNUSED (protocol);
| ^
2 errors generated.
The RGB24-to-ANSI output path was implemented in helper-cairo-ansi.hh,
so hb-raster picked up a Cairo header dependency even though it only
needed the shared image-output code. That broke builds configured with
-Dcairo=disabled.
Move the shared callback, Chafa, and RGB24-to-ANSI helpers into
helper-image-output.hh, keep helper-cairo-ansi.hh focused on adapting
Cairo surfaces, and switch raster-output.hh to include only the shared
image helper.
Testing:
meson test -C build
Assisted-by: OpenAI Codex
Skip the SVG table accelerator and do not define the public
SVG color APIs when HB_NO_SVG is set. Guard internal
callers so SVG-table-dependent code compiles out cleanly,
and add HB_NO_SVG to the HB_TINY profile.
Tested: meson setup build-nosvg -Dc_args=-DHB_NO_SVG -Dcpp_args=-DHB_NO_SVG
Tested: meson compile -C build-nosvg hb-shape hb-info hb-vector main
Tested: meson compile -C build-nosvg (libharfbuzz/libharfbuzz-raster/libharfbuzz-vector linked; full tree stopped on unrelated missing chafa.h in util/hb-raster.cc)
Tested: nm -gU build-nosvg/src/libharfbuzz.0.dylib | grep -E "hb_ot_color_.*svg" (no matches)
Assisted-by: OpenAI Codex