Skip to main content

PathSink

Trait PathSink 

Source
pub trait PathSink {
    // Required methods
    fn move_to(&mut self, x: f32, y: f32);
    fn line_to(&mut self, x: f32, y: f32);
    fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32);
    fn curve_to(
        &mut self,
        cx0: f32,
        cy0: f32,
        cx1: f32,
        cy1: f32,
        x: f32,
        y: f32,
    );
    fn close(&mut self);
}
Expand description

Receives the path commands for an outline.

To receive the outline’s points in font units, use UnscaledOutlineSink.

Required Methods§

Source

fn move_to(&mut self, x: f32, y: f32)

Emit a command to begin a new subpath at (x, y).

Source

fn line_to(&mut self, x: f32, y: f32)

Emit a line segment from the current point to (x, y).

Source

fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32)

Emit a quadratic bezier segment from the current point with a control point at (cx0, cy0) and ending at (x, y).

Source

fn curve_to(&mut self, cx0: f32, cy0: f32, cx1: f32, cy1: f32, x: f32, y: f32)

Emit a cubic bezier segment from the current point with control points at (cx0, cy0) and (cx1, cy1) and ending at (x, y).

Source

fn close(&mut self)

Emit a command to close the current subpath.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PathSink for Vec<PathElement>

Source§

fn move_to(&mut self, x: f32, y: f32)

Source§

fn line_to(&mut self, x: f32, y: f32)

Source§

fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32)

Source§

fn curve_to(&mut self, cx0: f32, cy0: f32, cx1: f32, cy1: f32, x: f32, y: f32)

Source§

fn close(&mut self)

Source§

impl<P: PathSink + ?Sized> PathSink for &mut P

Source§

fn move_to(&mut self, x: f32, y: f32)

Source§

fn line_to(&mut self, x: f32, y: f32)

Source§

fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32)

Source§

fn curve_to(&mut self, cx0: f32, cy0: f32, cx1: f32, cy1: f32, x: f32, y: f32)

Source§

fn close(&mut self)

Implementors§