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-.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.
Structs§
- Angle
- Representation of the
<angle>
type. - Aspect
Ratio - Representation of the
preserveAspectRatio
attribute. - Color
- Representation of the
<color>
type. - Filter
Value List Parser - A pull-based
<filter-value-list>
parser. - Font
Shorthand - The values of a
font
shorthand. - 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-order
property. - 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
align
value of thepreserveAspectRatio
attribute. - Angle
Unit - List of all SVG angle units.
- Directional
Position - List of all SVG directional positions.
- Enable
Background - Representation of the
enable-background
attribute. - Error
- List of all errors.
- Filter
Value - Representation of the
<filter-function>
|<url>
type. - Filter
Value List Parser Error - A list of possible
FilterValueListParser
errors. - 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-order
property 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
TransformOrigin
parsing errors. - View
BoxError - List of possible
ViewBox
parsing errors.
Functions§
- parse_
font_ families - Parses a list of font families and generic families from a string.