pub struct SvgConfig {
pub viewbox: (u32, u32),
pub preserve_aspect_ratio: bool,
pub embed_fonts: bool,
pub compression: SvgCompression,
pub include_xml_declaration: bool,
pub title: Option<String>,
pub description: Option<String>,
}Expand description
Configuration for SVG export
Fields§
§viewbox: (u32, u32)Viewbox dimensions (width, height)
preserve_aspect_ratio: boolPreserve aspect ratio
embed_fonts: boolEmbed fonts as base64
compression: SvgCompressionOutput compression level
include_xml_declaration: boolInclude XML declaration
title: Option<String>Title for accessibility
description: Option<String>Description for accessibility
Implementations§
Source§impl SvgConfig
impl SvgConfig
Sourcepub const fn new(width: u32, height: u32) -> Self
pub const fn new(width: u32, height: u32) -> Self
Create a new SVG config with viewbox dimensions
Sourcepub const fn with_viewbox(self, width: u32, height: u32) -> Self
pub const fn with_viewbox(self, width: u32, height: u32) -> Self
Set viewbox dimensions
Sourcepub const fn with_preserve_aspect_ratio(self, preserve: bool) -> Self
pub const fn with_preserve_aspect_ratio(self, preserve: bool) -> Self
Set preserve aspect ratio
Sourcepub const fn with_compression(self, compression: SvgCompression) -> Self
pub const fn with_compression(self, compression: SvgCompression) -> Self
Set compression level
Sourcepub const fn with_xml_declaration(self, include: bool) -> Self
pub const fn with_xml_declaration(self, include: bool) -> Self
Set XML declaration inclusion
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set title
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set description
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SvgConfig
impl RefUnwindSafe for SvgConfig
impl Send for SvgConfig
impl Sync for SvgConfig
impl Unpin for SvgConfig
impl UnsafeUnpin for SvgConfig
impl UnwindSafe for SvgConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().