pub struct SegmentCollector<'a> { /* private fields */ }Expand description
State for processing glyph’s outline segment.
This can process incoming glyph segment by splitting quadratic and cubic bezier into flat lines, and also tag each segment with at least two R, G or B color (according to Chlumsky’s algorithm).
It is necessary to store collected segments in a Vec. This type does not allocate the vec directly, but instead accepts an exclusive reference to the Vec, so the vec can be reused between different glyphs.
Implementations§
Source§impl<'a> SegmentCollector<'a>
impl<'a> SegmentCollector<'a>
Sourcepub fn line_to(&mut self, x: f32, y: f32)
pub fn line_to(&mut self, x: f32, y: f32)
Emit a line segment from the current point to (x, y).
Sourcepub fn quad_to(&mut self, cx0: f32, cy0: f32, x: f32, y: f32)
pub 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).
Sourcepub fn curve_to(
&mut self,
cx0: f32,
cy0: f32,
cx1: f32,
cy1: f32,
x: f32,
y: f32,
)
pub 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).
Sourcepub fn set_reversed(&mut self, reversed: bool)
pub fn set_reversed(&mut self, reversed: bool)
Reverse the direction of all subsequently collected subpaths.
Set this before collecting the outline. Pass in true for CFF/CFF2 glyphs and false for GLYF.
Trait Implementations§
Source§impl OutlinePen for SegmentCollector<'_>
Available on crate feature skrifa only.
impl OutlinePen for SegmentCollector<'_>
skrifa only.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).