Donner is an embeddable browser-grade SVG2 engine in C++20, providing full access to the SVG DOM with complete rendering support including text and filters.

Donner supports:
- SVG2 core functionality, such as shapes, fills, strokes, and gradients.
- Text rendering with <text>, <tspan>, and <textPath>, including WOFF2 web fonts and optional HarfBuzz shaping.
- All 17 SVG filter primitives (feGaussianBlur, feColorMatrix, feComposite, etc.).
- CSS3 parsing and cascading support, with a hand-rolled library.
- Detailed validation and diagnostics, errors point to the exact location.
- A game-engine-inspired EnTT ECS-backed document tree, optimized for performance.
- A SVG DOM-style API to traverse, inspect, and modify documents in memory.
- A two-phase renderer, which builds and caches a rendering tree for efficient frame-based rendering.
- Two renderer backends: tiny-skia (default, a lightweight software renderer) and Skia (Chromium's renderer).
Donner focuses on security and performance, which is validated with code coverage and fuzz testing.
Try It Out: Render an SVG to PNG
bazel run //examples:svg_to_png -- donner_splash.svg

How it works: svg_to_png.cc
API Demo
const std::string_view svgContents(R"(
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 10 10">
<path d="M 1 1 L 4 5" stroke="blue" />
</svg>
)");
std::cerr <<
"Parse Error " << maybeResult.
error() <<
"\n";
std::abort();
}
std::optional<donner::svg::SVGElement> maybePath = document.
querySelector(
"path");
std::cout << "Path: " << *spline << "\n";
std::cout << "Length: " << spline->pathLength() << " userspace units\n";
} else {
std::cout << "Path is empty\n";
}
Detailed docs: svg_tree_interaction.cc
Documentation
Project Goals
- Have minimal dependencies, so it can be integrated into existing applications, assuming a modern compiler.
- Expose the SVG DOM, so that applications can manipulate SVGs dynamically.
- Implement the SVG 2 Specification.
Status
Building
Donner is built using Bazel, and builds are tested on Linux and macOS.
See more details in the Building Donner instructions.