Expand description
svgtypes is a collection of parsers for SVG types.
§Supported SVG types
<color><number><length><angle><viewBox><path><transform><list-of-numbers><list-of-lengths><list-of-points><filter-value-list><paint><preserveAspectRatio><enable-background><IRI><FuncIRI>paint-order
§Features
- Complete support of paths, so data like
M10-20A5.5.3-4 110-.1will 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.
Modules§
- angle 🔒
- aspect_
ratio 🔒 - color 🔒
- colors 🔒
- directional_
position 🔒 - enable_
background 🔒 - error 🔒
- filter_
functions 🔒 - font 🔒
- funciri 🔒
- length 🔒
- number 🔒
- paint 🔒
- paint_
order 🔒 - path 🔒
- points 🔒
- stream 🔒
- transform 🔒
- transform_
origin 🔒 - viewbox 🔒
Macros§
- matches 🔒
Structs§
- Angle
- Representation of the
<angle>type. - Aspect
Ratio - Representation of the
preserveAspectRatioattribute. - Color
- Representation of the
<color>type. - Filter
Value List Parser - A pull-based
<filter-value-list>parser. - Font
Shorthand - The values of a
fontshorthand. - FuncIRI
- Representation of the
<FuncIRI>type. - IRI
- Representation of the
<IRI>type. - Length
- Representation of the
<length>type. - Length
List Parser - A pull-based
<list-of-length>parser. - Number
- An SVG number.
- Number
List Parser - A pull-based
<list-of-numbers>parser. - Paint
Order - Representation of the
paint-orderproperty. - Path
Parser - A pull-based path data parser.
- Points
Parser - A pull-based
<list-of-points>parser. - Simplifying
Path Parser - A simplifying Path Data parser.
- Transform
- Representation of the
<transform>type. - Transform
List Parser - A pull-based
<transform-list>parser. - Transform
Origin - Representation of the
<transform-origin>type. - ViewBox
- Representation of the
<viewBox>type.
Enums§
- Align
- Representation of the
alignvalue of thepreserveAspectRatioattribute. - Angle
Unit - List of all SVG angle units.
- Directional
Position - List of all SVG directional positions.
- Enable
Background - Representation of the
enable-backgroundattribute. - Error
- List of all errors.
- Filter
Value - Representation of the
<filter-function>|<url>type. - Filter
Value List Parser Error - A list of possible
FilterValueListParsererrors. - Font
Family - A type of font family.
- Length
Unit - List of all SVG length units.
- Paint
- Representation of the
<paint>type. - Paint
Fallback - Representation of the fallback part of the
<paint>type. - Paint
Order Kind paint-orderproperty variants.- Path
Segment - Representation of a path segment.
- Simple
Path Segment - Representation of a simple path segment.
- Transform
List Token - Transform list token.
- Transform
Origin Error - List of possible
TransformOriginparsing errors. - View
BoxError - List of possible
ViewBoxparsing errors.
Functions§
- parse_
font_ families - Parses a list of font families and generic families from a string.