cairo backend for resvg
resvg
backend implementation using the cairo library.
Build
This backend uses the gtk-rs project.
Building on Linux should work out of the box, but others OS'es are more complex.
Note: we are not using the gdk-pixbuf
crate for raster images, because it's way too heavy.
on Windows using MSYS2
Install stable-x86_64-pc-windows-gnu
Rust target.
Build using the MSYS2 shell:
You can use i686 target in the same way.
on Linux
Install cairo
and harfbuzz
using your distributive's package manager.
On Ubuntu you can install them via:
sudo apt install libcairo2-dev libharfbuzz-dev
Build resvg
:
on macOS
Using homebrew:
Runtime dependencies
resvg-cairo
depends only on cairo. pango
is not required.
On Linux, harfbuzz
is also required.
Running resvg CLI
The resulting binary can be found at: target/release/resvg-cairo
Running examples
A simple SVG to PNG converter:
Render image using a manually constructed SVG render tree:
Draw bounding boxes around all shapes on input SVG: