usvg (micro SVG) is an [SVG] simplification tool.
Imagine, that you have to extract some data from the [SVG] file, but your library/framework/language doesn't have a good SVG library. And all you need is paths data.
You can try to export it by yourself (how hard can it be, right). All you need is an XML library (I'll hope that your language has one). But soon you realize that paths data has a pretty complex format and a lot of edge-cases. And we didn't mention attributes propagation, transforms, visibility flags, attribute values validation, XML quirks, etc. It will take a lot of time and code to implement this stuff correctly.
So, instead of creating a library that can be used from any language (impossible), usvg takes a different approach. It converts an input SVG into an extremely simple representation, which is still a valid SVG. And now, all you need is an XML library with some small amount of code.
use
will be resolvedrect
with negative/zero size) will be removedstyle
attribute will be resolvedinherit
attribute value will be resolvedcurrentColor
attribute value will be resolvedscript
(simply ignoring it)Full spec can be found here.
a
, view
, cursor
, script
and animations.The latest stable Rust.
You can't. The idea is that you should not store files produced by usvg. You should use them immediately. Like an intermediate data.
usvg is licensed under the MPLv2.0.