1/*!
2*svgtypes* is a collection of parsers for [SVG](https://www.w3.org/TR/SVG2/) types.
3
4## Supported SVG types
5
6- [`<color>`](https://www.w3.org/TR/css-color-3/)
7- [`<number>`](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumber)
8- [`<length>`](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGLength)
9- [`<angle>`](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGAngle)
10- [`<viewBox>`](https://www.w3.org/TR/SVG2/coords.html#ViewBoxAttribute)
11- [`<path>`](https://www.w3.org/TR/SVG2/paths.html#PathData)
12- [`<transform>`](https://www.w3.org/TR/SVG11/types.html#DataTypeTransformList)
13- [`<list-of-numbers>`](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumberList)
14- [`<list-of-lengths>`](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGLengthList)
15- [`<list-of-points>`](https://www.w3.org/TR/SVG11/shapes.html#PointsBNF)
16- [`<filter-value-list>`](https://www.w3.org/TR/filter-effects-1/#typedef-filter-value-list)
17- [`<paint>`](https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint)
18- [`<preserveAspectRatio>`](https://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute)
19- [`<enable-background>`](https://www.w3.org/TR/SVG11/filters.html#EnableBackgroundProperty)
20- [`<IRI>`](https://www.w3.org/TR/SVG11/types.html#DataTypeIRI)
21- [`<FuncIRI>`](https://www.w3.org/TR/SVG11/types.html#DataTypeFuncIRI)
22- [`paint-order`](https://www.w3.org/TR/SVG2/painting.html#PaintOrder)
23
24## Features
25
26- Complete support of paths, so data like `M10-20A5.5.3-4 110-.1` will be parsed correctly.
27- Implicit path commands will be automatically converted into explicit one.
28- Some SVG2 data types support.
29- Pretty fast.
30
31## Limitations
32
33- Accepts only [normalized](https://www.w3.org/TR/REC-xml/#AVNormalize) values,
34 e.g. an input text should not contain `&#x20;` or `&data;`.
35- All keywords must be lowercase.
36 Case-insensitive parsing is supported only for colors (requires allocation for named colors).
37- The `<color>` followed by the `<icccolor>` is not supported. As the `<icccolor>` itself.
38- [System colors](https://www.w3.org/TR/css3-color/#css2-system), like `fill="AppWorkspace"`,
39 are not supported. They were deprecated anyway.
40
41## Safety
42
43- The library should not panic. Any panic considered as a critical bug and should be reported.
44- The library forbids unsafe code.
45
46## Alternatives
47
48None.
49*/
50
51#![forbid(unsafe_code)]
52#![deny(missing_docs)]
53#![deny(missing_debug_implementations)]
54#![deny(missing_copy_implementations)]
55
56macro_rules! matches {
57 ($expression:expr, $($pattern:tt)+) => {
58 match $expression {
59 $($pattern)+ => true,
60 _ => false
61 }
62 }
63}
64
65mod angle;
66mod aspect_ratio;
67mod color;
68#[rustfmt::skip] mod colors;
69mod directional_position;
70mod enable_background;
71mod error;
72mod filter_functions;
73mod font;
74mod funciri;
75mod length;
76mod number;
77mod paint;
78mod paint_order;
79mod path;
80mod points;
81mod stream;
82mod transform;
83mod transform_origin;
84mod viewbox;
85
86use crate::stream::{ByteExt, Stream};
87
88pub use crate::angle::*;
89pub use crate::aspect_ratio::*;
90pub use crate::color::*;
91pub use crate::directional_position::*;
92pub use crate::enable_background::*;
93pub use crate::error::*;
94pub use crate::filter_functions::*;
95pub use crate::font::*;
96pub use crate::funciri::*;
97pub use crate::length::*;
98pub use crate::number::*;
99pub use crate::paint::*;
100pub use crate::paint_order::*;
101pub use crate::path::*;
102pub use crate::points::*;
103pub use crate::transform::*;
104pub use crate::transform_origin::*;
105pub use crate::viewbox::*;
106