raqote-usvg-render

Crates.ioraqote-usvg-render
lib.rsraqote-usvg-render
version0.12.0
sourcesrc
created_at2020-11-13 09:33:37.470745
updated_at2020-11-13 10:34:21.537304
descriptionraqote renderer for usvg.
homepage
repositoryhttps://github.com/Yarn/raqote-usvg-render
max_upload_size
id311887
size132,913
Ryan (Yarn)

documentation

README

raqote backend for rendering usvg data

Crate

usvg rendering implementation using the raqote library.

Warning: the raqote library is still in development and pretty unstable. You should prefer other backends.

This backend intentionally doesn't provide a C API.

Build

Right now, this is the only backend that uses Rust-based 2D library, therefore building process is fairly straightforward.

Sadly, you still need a C++ compiler to build harfbuzz.

on Windows using MSVC

Install stable-x86_64-pc-windows-msvc Rust target.

Build using x64 Native Tools Command Prompt for VS 2017 shell:

set PATH=%userprofile%\.cargo\bin;%PATH%
rustup.exe default stable-x86_64-pc-windows-msvc

cargo.exe build --release

on Windows using MSYS2

Install stable-x86_64-pc-windows-gnu Rust target. And then:

pacman -S mingw-w64-x86_64-gcc
rustup default stable-x86_64-pc-windows-gnu

cargo build --release

You can use i686 target in the same way.

on Linux

Install harfbuzz using your distributive's package manager.

On Ubuntu you can install it via:

sudo apt install libharfbuzz-dev

Build resvg:

cargo build --release

on macOS

cargo build --release

Runtime dependencies

harfbuzz on Linux. On other OS'es it will be built statically.

Running resvg CLI

cargo run --release -- in.svg out.png

The resulting binary can be found at: target/release/resvg-raqote

Running examples

A simple SVG to PNG converter:

cargo run --example minimal -- in.svg out.png

Render image using a manually constructed SVG render tree:

cargo run --example custom_rtree

Draw bounding boxes around all shapes on input SVG:

cargo run --example draw_bboxes -- bboxes.svg bboxes.png -z 4

License

MPLv2.0.

Commit count: 1

cargo fmt