Struct svgdom::WriteOptionsPaths
[−]
[src]
pub struct WriteOptionsPaths { pub use_compact_notation: bool, pub join_arc_to_flags: bool, pub remove_duplicated_commands: bool, pub use_implicit_lineto_commands: bool, pub coordinates_precision: u8, }
Options that defines SVG paths writing.
Fields
use_compact_notation: bool
Use compact path notation.
SVG allow us to remove some symbols from path notation without breaking parsing.
Example:
M 10 -20 A 5.5 0.3 -4 1 1 0 -0.1
-> M10-20A5.5.3-4 1 1 0-.1
Default: disabled
join_arc_to_flags: bool
Join ArcTo flags.
Elliptical arc curve segment has flags parameters, which can have values of 0
or 1
.
Since we have fixed-width values, we can skip spaces between them.
Example:
A 5 5 30 1 1 10 10
-> A 5 5 30 1110 10
Default: disabled
Note: Sadly, but most of the viewers doesn't support such notation, even throw it's valid by SVG spec.
remove_duplicated_commands: bool
Remove duplicated commands.
If the segment has the same type as previous - we can skip command specifier.
Example:
M 10 10 L 20 20 L 30 30 L 40 40
-> M 10 10 L 20 20 30 30 40 40
Default: disabled
use_implicit_lineto_commands: bool
Use implicit LineTo commands.
'If a MoveTo is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit LineTo commands.'
Example:
M 10 10 L 20 20 L 30 30
-> M 10 10 20 20 30 30
Default: disabled
coordinates_precision: u8
Specify a numeric precision for coordinates.
Range: 1..12
Example:
Set to 4:
M 10.00000001 10.00002 L 20.123456789 20.9999999
-> M 10 10 L 20.1235 21
Default: 12
Note: Values less than 5 will probably break your file.