Skip to main content

SvgText

Struct SvgText 

Source
pub struct SvgText<'a> {
    pub text: &'a mut Text,
    pub fonts: &'a SvgFonts,
}
Expand description

an img_svg::TextHook on a text engine

Fields§

§text: &'a mut Text§fonts: &'a SvgFonts

Trait Implementations§

Source§

impl TextHook for SvgText<'_>

Source§

fn outline( &mut self, path: &mut Path, s: &str, font: &FontSpec<'_>, px: f32, x: f32, y: f32, ) -> f32

append the outline of s to path (flattened closed contours in path pixels): the baseline starts at (x, y), px pixels per em; returns the advance in pixels
Source§

fn advance(&mut self, s: &str, font: &FontSpec<'_>, px: f32) -> f32

the advance of s in pixels at px pixels per em

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for SvgText<'a>

§

impl<'a> !UnwindSafe for SvgText<'a>

§

impl<'a> Forget for SvgText<'a>

§

impl<'a> Freeze for SvgText<'a>

§

impl<'a> Send for SvgText<'a>

§

impl<'a> Sync for SvgText<'a>

§

impl<'a> Unpin for SvgText<'a>

§

impl<'a> UnsafeUnpin for SvgText<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.