Struct GlyphPainter

Source
pub(crate) struct GlyphPainter<'a> {
    pub(crate) face: &'a Face<'a>,
    pub(crate) svg: &'a mut XmlWriter,
    pub(crate) path_buf: &'a mut String,
    pub(crate) gradient_index: usize,
    pub(crate) clip_path_index: usize,
    pub(crate) palette_index: u16,
    pub(crate) transform: Transform,
    pub(crate) outline_transform: Transform,
    pub(crate) transforms_stack: Vec<Transform>,
}

Fields§

§face: &'a Face<'a>§svg: &'a mut XmlWriter§path_buf: &'a mut String§gradient_index: usize§clip_path_index: usize§palette_index: u16§transform: Transform§outline_transform: Transform§transforms_stack: Vec<Transform>

Implementations§

Source§

impl<'a> GlyphPainter<'a>

Source

fn write_gradient_stops(&mut self, stops: GradientStopsIter<'_, '_>)

Source

fn paint_solid(&mut self, color: RgbaColor)

Source

fn paint_linear_gradient(&mut self, gradient: LinearGradient<'a>)

Source

fn paint_radial_gradient(&mut self, gradient: RadialGradient<'a>)

Source

fn paint_sweep_gradient(&mut self, _: SweepGradient<'a>)

Source§

impl GlyphPainter<'_>

Source

fn clip_with_path(&mut self, path: &str)

Trait Implementations§

Source§

impl<'a> Painter<'a> for GlyphPainter<'a>

Source§

fn outline_glyph(&mut self, glyph_id: GlyphId)

Outline a glyph and store it.
Source§

fn push_layer(&mut self, mode: CompositeMode)

Push a new layer with the given composite mode.
Source§

fn pop_layer(&mut self)

Pop the last layer.
Source§

fn push_transform(&mut self, transform: Transform)

Push a transform.
Source§

fn paint(&mut self, paint: Paint<'a>)

Paint the stored outline using the provided color.
Source§

fn pop_transform(&mut self)

Pop the last transform.
Source§

fn push_clip(&mut self)

Push a new clip path using the currently stored outline.
Source§

fn pop_clip(&mut self)

Pop the last clip path.
Source§

fn push_clip_box(&mut self, clipbox: ClipBox)

Push a new clip path using the clip box.

Auto Trait Implementations§

§

impl<'a> Freeze for GlyphPainter<'a>

§

impl<'a> RefUnwindSafe for GlyphPainter<'a>

§

impl<'a> Send for GlyphPainter<'a>

§

impl<'a> Sync for GlyphPainter<'a>

§

impl<'a> Unpin for GlyphPainter<'a>

§

impl<'a> !UnwindSafe for GlyphPainter<'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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.