Trait zng::font::OutlineSink

source ·
pub trait OutlineSink {
    // Required methods
    fn move_to(&mut self, to: Point2D<f32, Px>);
    fn line_to(&mut self, to: Point2D<f32, Px>);
    fn quadratic_curve_to(
        &mut self,
        ctrl: Point2D<f32, Px>,
        to: Point2D<f32, Px>,
    );
    fn cubic_curve_to(
        &mut self,
        ctrl: (Point2D<f32, Px>, Point2D<f32, Px>),
        to: Point2D<f32, Px>,
    );
    fn close(&mut self);
}
Expand description

Receives Bézier path rendering commands from Font::outline.

The points are relative to the baseline, negative values under, positive over.

Required Methods§

source

fn move_to(&mut self, to: Point2D<f32, Px>)

Moves the pen to a point.

source

fn line_to(&mut self, to: Point2D<f32, Px>)

Draws a line to a point.

source

fn quadratic_curve_to(&mut self, ctrl: Point2D<f32, Px>, to: Point2D<f32, Px>)

Draws a quadratic Bézier curve to a point.

source

fn cubic_curve_to( &mut self, ctrl: (Point2D<f32, Px>, Point2D<f32, Px>), to: Point2D<f32, Px>, )

Draws a cubic Bézier curve to a point.

The ctrl is a line (from, to).

source

fn close(&mut self)

Closes the path, returning to the first point in it.

Implementors§