25 releases (14 breaking)

0.15.3 Jan 20, 2025
0.15.2 Aug 20, 2024
0.15.1 May 7, 2024
0.14.0 Feb 5, 2024
0.1.1 May 23, 2018

#74 in Parser implementations

Download history 49424/week @ 2024-10-09 59421/week @ 2024-10-16 59597/week @ 2024-10-23 62820/week @ 2024-10-30 58450/week @ 2024-11-06 50118/week @ 2024-11-13 56948/week @ 2024-11-20 62877/week @ 2024-11-27 63521/week @ 2024-12-04 67329/week @ 2024-12-11 49466/week @ 2024-12-18 34341/week @ 2024-12-25 50036/week @ 2025-01-01 72139/week @ 2025-01-08 75411/week @ 2025-01-15 67382/week @ 2025-01-22

269,866 downloads per month
Used in 435 crates (28 directly)

Apache-2.0 OR MIT

195KB
4.5K SLoC

SVG Types

A collection of parsers for SVG types.

Linebender Zulip, #resvg channel dependency status Apache 2.0 or MIT license. Build status Crates.io Docs

Supported SVG types

Features

  • Complete support of paths, so data like M10-20A5.5.3-4 110-.1 will be parsed correctly.
  • Implicit path commands will be automatically converted into explicit one.
  • Some SVG2 data types support.
  • Pretty fast.

Limitations

  • Accepts only normalized values, e.g. an input text should not contain   or &data;.
  • All keywords must be lowercase. Case-insensitive parsing is supported only for colors (requires allocation for named colors).
  • The <color> followed by the <icccolor> is not supported. As the <icccolor> itself.
  • System colors, like fill="AppWorkspace", are not supported. They were deprecated anyway.

Safety

  • The library should not panic. Any panic considered as a critical bug and should be reported.
  • The library forbids unsafe code.

Alternatives

None.

Minimum supported Rust Version (MSRV)

This version of SVG Types has been verified to compile with Rust 1.65 and later.

Future versions of SVG Types might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.

Click here if compiling fails.

As time has passed, some of SVG Types's dependencies could have released versions with a higher Rust requirement. If you encounter a compilation issue due to a dependency and don't want to upgrade your Rust toolchain, then you could downgrade the dependency.

# Use the problematic dependency's name and version
cargo update -p package_name --precise 0.1.1

Community

Linebender Zulip, #resvg channel

Discussion of SVG Types development happens in the Linebender Zulip at https://xi.zulipchat.com/, specifically the #resvg channel. All public content can be read without logging in.

License

Licensed under either of

at your option.

Contribution

Contributions are welcome by pull request. The Rust code of conduct applies. Please feel free to add your name to the AUTHORS file in any substantive pull request.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Dependencies

~655KB
~14K SLoC