Crate svgtypes

Source
Expand description

svgtypes is a collection of parsers for SVG types.

§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.

Structs§

Angle
Representation of the <angle> type.
AspectRatio
Representation of the preserveAspectRatio attribute.
Color
Representation of the <color> type.
FilterValueListParser
A pull-based <filter-value-list> parser.
FontShorthand
The values of a font shorthand.
FuncIRI
Representation of the <FuncIRI> type.
IRI
Representation of the <IRI> type.
Length
Representation of the <length> type.
LengthListParser
A pull-based <list-of-length> parser.
Number
An SVG number.
NumberListParser
A pull-based <list-of-numbers> parser.
PaintOrder
Representation of the paint-order property.
PathParser
A pull-based path data parser.
PointsParser
A pull-based <list-of-points> parser.
SimplifyingPathParser
A simplifying Path Data parser.
Transform
Representation of the <transform> type.
TransformListParser
A pull-based <transform-list> parser.
TransformOrigin
Representation of the <transform-origin> type.
ViewBox
Representation of the <viewBox> type.

Enums§

Align
Representation of the align value of the preserveAspectRatio attribute.
AngleUnit
List of all SVG angle units.
DirectionalPosition
List of all SVG directional positions.
EnableBackground
Representation of the enable-background attribute.
Error
List of all errors.
FilterValue
Representation of the <filter-function> | <url> type.
FilterValueListParserError
A list of possible FilterValueListParser errors.
FontFamily
A type of font family.
LengthUnit
List of all SVG length units.
Paint
Representation of the <paint> type.
PaintFallback
Representation of the fallback part of the <paint> type.
PaintOrderKind
paint-order property variants.
PathSegment
Representation of a path segment.
SimplePathSegment
Representation of a simple path segment.
TransformListToken
Transform list token.
TransformOriginError
List of possible TransformOrigin parsing errors.
ViewBoxError
List of possible ViewBox parsing errors.

Functions§

parse_font_families
Parses a list of font families and generic families from a string.