Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner-svg CLI Tool

Overview

donner-svg is a command line utility for rendering SVG files to PNG and previewing output in terminal environments. A convenience wrapper is checked in at tools/donner-svg, which is the recommended way to invoke it from inside the repository.

Build and run:

tools/donner-svg input.svg

Rendering backend

donner-svg always renders with Donner's CPU (tiny-skia) backend, under every build configuration. A one-shot command-line render cannot amortize the GPU backend's fixed device and shader setup cost, so the CPU backend is strictly better for single-frame output. The GPU (Geode) backend is Donner's interactive renderer, used by long-lived surfaces such as the editor where that setup cost is paid once across many frames.

Common flags

  • --output <png>: Output filename (default output.png).
  • --width <px> / --height <px>: Override render size.
  • --preview: Show a terminal preview.
  • --interactive: Enable mouse-driven terminal selection mode (implies --preview).
  • --quiet: Suppress parser warnings.
  • --verbose: Enable verbose renderer logs.
  • --experimental: Enable experimental parser features.
  • --help: Print usage.

Examples

# Render to PNG
tools/donner-svg input.svg --output output.png
# Terminal preview mode
tools/donner-svg input.svg --preview
# Interactive mode
tools/donner-svg input.svg --interactive
Note
tools/donner-svg is a thin shell wrapper that invokes bazel run //donner/svg/tool:donner-svg -- <args> with Bazel's progress/info output suppressed so the tool behaves like a normal CLI. You can invoke the underlying Bazel target directly if you prefer.

Terminal preview

--preview renders the SVG directly in your terminal using Unicode quadrant block characters with 24-bit truecolor foreground/background, giving 2×2 sub-pixels per character cell.

Interactive mode

--interactive implies --preview and additionally enables mouse-driven selection: hover over the terminal image to see the element under the cursor, and click to lock the selection. The right-hand pane shows the DOM path and computed style of the selected element.