pub enum PathCommand {
MoveTo {
x: f64,
y: f64,
},
LineTo {
x: f64,
y: f64,
},
QuadTo {
x1: f64,
y1: f64,
x: f64,
y: f64,
},
CurveTo {
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x: f64,
y: f64,
},
Close,
}Expand description
A path command in the opentype.js Path.commands vocabulary.
Close exists because Glyph.path (the Y-up path the bbox is measured on)
contains Z; Glyph.getPath(0, 0, unitsPerEm) drops it (it only emits Z
when the path is stroked), so the rasteriser never sees one.
Variants§
MoveTo
Starts a new subpath at (x, y).
LineTo
A straight segment to (x, y).
QuadTo
Quadratic: one control point.
CurveTo
Cubic: two control points. TrueType never produces these; CFF does.
Fields
Close
Closes the current subpath.
Implementations§
Source§impl PathCommand
impl PathCommand
Sourcepub fn type_letter(&self) -> &'static str
pub fn type_letter(&self) -> &'static str
The opentype.js cmd.type letter, for golden comparison.
Trait Implementations§
Source§impl Clone for PathCommand
impl Clone for PathCommand
impl Copy for PathCommand
Source§impl Debug for PathCommand
impl Debug for PathCommand
Source§impl PartialEq for PathCommand
impl PartialEq for PathCommand
impl StructuralPartialEq for PathCommand
Auto Trait Implementations§
impl Freeze for PathCommand
impl RefUnwindSafe for PathCommand
impl Send for PathCommand
impl Sync for PathCommand
impl Unpin for PathCommand
impl UnsafeUnpin for PathCommand
impl UnwindSafe for PathCommand
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