pub struct Svg { /* private fields */ }Expand description
resource-backed SVG operations; build/compile uses the same Node path for preview, still and export. Callbacks run synchronously on the CPU.
Implementations§
Source§impl Svg
impl Svg
Sourcepub fn open(source: impl Into<Source>) -> Self
pub fn open(source: impl Into<Source>) -> Self
Captures a source resolved using session resources and fonts during compilation.
Sourcepub fn new(handle: Handle<SvgAsset>) -> Self
pub fn new(handle: Handle<SvgAsset>) -> Self
Captures a lazy resource without reading or parsing it.
Sourcepub fn from_asset(asset: Arc<SvgAsset>) -> Self
pub fn from_asset(asset: Arc<SvgAsset>) -> Self
Captures an already validated immutable vector asset.
Sourcepub fn fit(self, size: Size) -> Self
pub fn fit(self, size: Size) -> Self
Centers a contain mapping in this finite positive viewport.
Sourcepub fn write(self, progress: f64) -> Self
pub fn write(self, progress: f64) -> Self
Uses the common cumulative vector handwriting effect.
Sourcepub fn write_with(self, progress: f64, options: WriteOptions) -> Self
pub fn write_with(self, progress: f64, options: WriteOptions) -> Self
Uses explicit outline geometry for the common cumulative handwriting effect.
Sourcepub fn select(
self,
id: impl Into<Arc<str>>,
callback: impl Fn(Node) -> Node + Send + Sync + 'static,
) -> Self
pub fn select( self, id: impl Into<Arc<str>>, callback: impl Fn(Node) -> Node + Send + Sync + 'static, ) -> Self
Applies a normal modifier callback to an authored ID (# is optional). Unknown IDs fail rather than silently selecting nothing. Callbacks follow declaration order; resource IDs in masks are scoped to their resource.
Sourcepub fn vector_tree(&self) -> Result<Arc<VectorTree>>
pub fn vector_tree(&self) -> Result<Arc<VectorTree>>
Returns the canonical shared vector model for inspection/effects.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Svg
impl !UnwindSafe for Svg
impl Forget for Svg
impl Freeze for Svg
impl Move for Svg
impl Send for Svg
impl Sync for Svg
impl Unpin for Svg
impl UnsafeUnpin for Svg
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Output> IntoSceneOutput for Output
impl<Output> IntoSceneOutput for Output
Source§impl<Value> NodeModifiers for Value
impl<Value> NodeModifiers for Value
Source§fn layered_shadow(self, color: Color, radius: f64, offset: Vector2) -> Node
fn layered_shadow(self, color: Color, radius: f64, offset: Vector2) -> Node
Source§fn elevated(self, elevation: Elevation) -> Node
fn elevated(self, elevation: Elevation) -> Node
Elevation.