Struct svgdom::WriteOptions [] [src]

pub struct WriteOptions {
    pub indent: Indent,
    pub attributes_indent: Indent,
    pub use_single_quote: bool,
    pub trim_hex_colors: bool,
    pub write_hidden_attributes: bool,
    pub remove_leading_zero: bool,
    pub paths: WriteOptionsPaths,
    pub simplify_transform_matrices: bool,
}

Options that defines SVG writing.

Fields

Set XML nodes indention.

Examples

Indent::None

Before:

<svg>
    <rect fill="red"/>
</svg>

After:

<svg><rect fill="red"/></svg>

Default: 4 spaces

Set XML attributes indention.

Examples

Indent::Spaces(2)

Before:

<svg>
    <rect fill="red" stroke="black"/>
</svg>

After:

<svg>
    <rect
      fill="red"
      stroke="black"/>
</svg>

Default: None

Use single quote marks instead of double quote.

Examples

Before:

<rect fill="red"/>

After:

<rect fill='red'/>

Default: disabled

Use #RGB color notation when possible.

By default all colors written using #RRGGBB notation.

Examples

#ff0000 -> #f00, #000000 -> #000, #00aa00 -> #0a0

Default: disabled

Write hidden attributes.

libsvgdom support invisible attributes, which can be dumped to output using this option.

See Attribute documentation.

Default: disabled

Remove leading zero from numbers.

Examples

  • 0.1 -> .1
  • -0.1 -> -.1

Default: disabled

Paths options.

See WriteOptionsPaths documentation.

Simplify transform matrices into short equivalent when possible.

If not set - all transform will be saved as 'matrix'.

Examples

matrix(1 0 0 1 10 20) -> translate(10 20)
matrix(1 0 0 1 10 0)  -> translate(10)
matrix(2 0 0 3 0 0)   -> scale(2 3)
matrix(2 0 0 2 0 0)   -> scale(2)
matrix(0 1 -1 0 0 0)  -> rotate(-90)

Default: disabled

Trait Implementations

impl Default for WriteOptions
[src]

[src]

Returns the "default value" for a type. Read more