libresvg ![Build Status]

libresvg is an SVG rendering library.

The name

It's called lib-re-svg and not libre-svg, because it's an alternative to [librsvg].

New name suggestions are welcome.

Purpose

libresvg can be used to render SVG files based on a static SVG Full 1.1 subset, excluding fonts support. In simple terms: no animations, scripting and fonts.

The core idea is to make a fast, portable, small, multiple backend library.

It can be used as a simple SVG to PNG converted. And as an embeddable library to paint SVG on an application native canvas.

Why a new library?

libresvg is trying to compete with [librsvg], [QtSvg] and [Inkscape] (only as a CLI SVG to PNG converter).

One of the main difference from other rendering libraries is that libresvg do a lot of preprocessing before rendering. It converts shapes to paths, resolves attributes, ungroups groups, removes invisible elements, fixes a lot of issues in malformed SVG files and only then starts the rendering. So it's very easy to implement a new rendering backend.

More details here.

libresvg vs librsvg

librsvg is the main competitor to the libresvg. And even though that librsvg itself is being rewritten in Rust, as libresvg, the architecture of the library is completely different:

libresvg vs Inkscape

Inkscape is often used to convert SVG to PNG, but it's not an actual competitor to libresvg, because it's still a complete SVG editor, not a tiny library. But it has the best SVG support amongst other.

libresvg vs QtSvg

Without a doubt, [QtSvg] is heavily used in [Qt] applications. But [QtSvg] itself is very limited. It officially supports only a tiny portion of the SVG Tiny 1.2 subset. In simple terms - it correctly renders only very simple SVG images.

SVG support

Test results using tests/images:

![Chart]

You can see chart's underling data here.

You can find a complete table of supported features here. It also includes alternative libraries.

TL;DR

Backends

libresvg supports [Qt] and [cairo] backends.

[Skia] backend is planned.

Build

See doc/build.md for details.

License

libresvg is licensed under the MPLv2.0.