## svgrtypes ![Build Status](https://github.com/RazrFalcon/svgrtypes/workflows/svgrtypes/badge.svg) [![Crates.io](https://img.shields.io/crates/v/svgrtypes.svg)](https://crates.io/crates/svgrtypes) [![Documentation](https://docs.rs/svgrtypes/badge.svg)](https://docs.rs/svgrtypes) [![Rust 1.31+](https://img.shields.io/badge/rust-1.31+-orange.svg)](https://www.rust-lang.org) ![](https://img.shields.io/badge/unsafe-forbidden-brightgreen.svg) *svgrtypes* is a collection of parsers for [SVG](https://www.w3.org/TR/SVG2/) types. ### Supported SVG types - [``](https://www.w3.org/TR/css-color-3/) - [``](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumber) - [``](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGLength) - [``](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGAngle) - [``](https://www.w3.org/TR/SVG2/coords.html#ViewBoxAttribute) - [``](https://www.w3.org/TR/SVG2/paths.html#PathData) - [``](https://www.w3.org/TR/SVG11/types.html#DataTypeTransformList) - [``](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumberList) - [``](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGLengthList) - [``](https://www.w3.org/TR/SVG11/shapes.html#PointsBNF) - [``](https://www.w3.org/TR/filter-effects-1/#typedef-filter-value-list) - [``](https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint) - [``](https://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute) - [``](https://www.w3.org/TR/SVG11/filters.html#EnableBackgroundProperty) - [``](https://www.w3.org/TR/SVG11/types.html#DataTypeIRI) - [``](https://www.w3.org/TR/SVG11/types.html#DataTypeFuncIRI) - [`paint-order`](https://www.w3.org/TR/SVG2/painting.html#PaintOrder) ### 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](https://www.w3.org/TR/REC-xml/#AVNormalize) 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 `` followed by the `` is not supported. As the `` itself. - [System colors](https://www.w3.org/TR/css3-color/#css2-system), 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. ### License Licensed under either of - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution 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 dual licensed as above, without any additional terms or conditions.