pub(crate) struct PointsFromPath<'a, S: ?Sized> {
sink: &'a mut S,
open: bool,
last_start: Option<(f32, f32)>,
pending: Option<PendingElement>,
}Expand description
A PathSink that converts a path into points and sends them to an
UnscaledOutlineSink.
This is used for sources that can only draw a path. The path must be in font units. Each segment’s end point is held until the next command. When a contour closes at its start point, that point is not repeated. This matches how FreeType builds a TrueType outline from a charstring.
Fields§
§sink: &'a mut S§open: boolTrue while a contour is open.
last_start: Option<(f32, f32)>§pending: Option<PendingElement>Implementations§
Source§impl<S: UnscaledOutlineSink + ?Sized> PointsFromPath<'_, S>
impl<S: UnscaledOutlineSink + ?Sized> PointsFromPath<'_, S>
fn push(&mut self, x: f32, y: f32, flags: PointFlags)
fn flush_pending(&mut self, for_close: bool)
fn close_contour(&mut self)
Trait Implementations§
Source§impl<S: UnscaledOutlineSink + ?Sized> PathSink for PointsFromPath<'_, S>
impl<S: UnscaledOutlineSink + ?Sized> PathSink for PointsFromPath<'_, S>
Source§fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32)
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).
Auto Trait Implementations§
impl<'a, S> !UnwindSafe for PointsFromPath<'a, S>
impl<'a, S> Freeze for PointsFromPath<'a, S>where
S: ?Sized,
impl<'a, S> RefUnwindSafe for PointsFromPath<'a, S>where
S: RefUnwindSafe + ?Sized,
impl<'a, S> Send for PointsFromPath<'a, S>
impl<'a, S> Sync for PointsFromPath<'a, S>
impl<'a, S> Unpin for PointsFromPath<'a, S>where
S: ?Sized,
impl<'a, S> UnsafeUnpin for PointsFromPath<'a, S>where
S: ?Sized,
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
Mutably borrows from an owned value. Read more
Source§impl<P> CommandSink for Pwhere
P: PathSink,
impl<P> CommandSink for Pwhere
P: PathSink,
fn move_to(&mut self, x: Fixed, y: Fixed)
fn line_to(&mut self, x: Fixed, y: Fixed)
fn curve_to( &mut self, cx0: Fixed, cy0: Fixed, cx1: Fixed, cy1: Fixed, x: Fixed, y: Fixed, )
fn close(&mut self)
Source§fn hint_mask(&mut self, mask: &[u8])
fn hint_mask(&mut self, mask: &[u8])
Bitmask defining the hints that should be made active for the
commands that follow.
Source§fn counter_mask(&mut self, mask: &[u8])
fn counter_mask(&mut self, mask: &[u8])
Bitmask defining the counter hints that should be made active for the
commands that follow.
Source§fn clear_hints(&mut self)
fn clear_hints(&mut self)
Clear accumulated stem hints and all data derived from them.