Struct write_fonts::pens::ReverseContourPen
source · pub struct ReverseContourPen<'a, T: Pen> { /* private fields */ }Expand description
Buffers commands until a close is seen, then plays in reverse on inner pen.
Reverses the winding direction of the contour. Keeps the first point unchanged. In FontTools terms we implement only reversedContour(…, outputImpliedClosingLine=True) as this appears to be necessary to ensure retention of interpolation.
Implementations§
source§impl<'a, T: Pen> ReverseContourPen<'a, T>
impl<'a, T: Pen> ReverseContourPen<'a, T>
pub fn new(inner_pen: &'a mut T) -> ReverseContourPen<'_, T>
sourcepub fn flush(&mut self) -> Result<(), ContourReversalError>
pub fn flush(&mut self) -> Result<(), ContourReversalError>
Flush buffer into inner, reversing the winding order.
If start == end, as is typically in a [move, …, close] structure, start point is unchanged.
Requires an explicit call to afford the client the opportunity to receive errors.
Trait Implementations§
source§impl<'a, T: Pen> Pen for ReverseContourPen<'a, T>
impl<'a, T: Pen> Pen for ReverseContourPen<'a, T>
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, T> RefUnwindSafe for ReverseContourPen<'a, T>where T: RefUnwindSafe,
impl<'a, T> Send for ReverseContourPen<'a, T>where T: Send,
impl<'a, T> Sync for ReverseContourPen<'a, T>where T: Sync,
impl<'a, T> Unpin for ReverseContourPen<'a, T>
impl<'a, T> !UnwindSafe for ReverseContourPen<'a, T>
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<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere U: FromObjRef<T>,
source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.