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
Implement a minimal SVG parser/renderer that translates OpenType SVG
table documents into paint commands through the existing hb_paint_funcs_t
interface. All pixel-level rendering (gradients, compositing, clipping)
is handled by the existing hb_raster_paint_t infrastructure.
Features:
- XML tokenizer and SVG path data parser (all commands including arcs)
- Shape-to-path converters (rect, circle, ellipse, line, polyline, polygon)
- Gradient support (linearGradient, radialGradient with stops and transforms)
- SVG color parser (#RGB, #RRGGBB, rgb(), named colors, currentColor)
- CPAL palette colors via var(--colorN) with fallback support
- Transform parser (matrix, translate, scale, rotate, skewX, skewY)
- Defs/use resolution, clipPath support, group opacity
- Hook into hb-raster utility for SVG font rendering
New files: hb-raster-svg.cc, hb-raster-svg.hh, hb-raster-paint.hh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both hb-raster and hb-ft-raster now always produce PPM (color) output,
compositing alpha over foreground/background colors. This makes the
output format consistent regardless of whether the font has color data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement a software paint backend (hb_raster_paint_t) that renders
COLRv0/v1 color glyphs into BGRA32 pixel buffers with no external
dependencies. Implements all 14 hb_paint_funcs_t callbacks including
solid fills, linear/radial/sweep gradients, glyph clipping, rectangle
clipping, group compositing, and BGRA image blitting.
Update hb-raster utility to detect color fonts and use the paint path,
outputting PPM (RGB) instead of PGM (greyscale).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Renders shaped text into a single auto-sized A8 PGM raster image,
written to stdout or --output-file. Mirrors util/hb-draw in structure.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>