[−][src]Struct norad::glyph::builder::OutlineBuilder
An OutlineBuilder is a consuming builder for crate::glyph::Outline
, not unlike a fontTools point pen.
Primarily to be used in conjunction with GlyphBuilder
.
Implementations
impl OutlineBuilder
[src]
pub fn new() -> Self
[src]
pub fn begin_path(
&mut self,
identifier: Option<Identifier>
) -> Result<&mut Self, ErrorKind>
[src]
&mut self,
identifier: Option<Identifier>
) -> Result<&mut Self, ErrorKind>
Start a new path to be added to the glyph with end_path()
.
Errors when:
- a path has been begun already but not ended yet.
- the identifier is not unique within the glyph.
pub fn add_point(
&mut self,
point: (f32, f32),
segment_type: PointType,
smooth: bool,
name: Option<String>,
identifier: Option<Identifier>
) -> Result<&mut Self, ErrorKind>
[src]
&mut self,
point: (f32, f32),
segment_type: PointType,
smooth: bool,
name: Option<String>,
identifier: Option<Identifier>
) -> Result<&mut Self, ErrorKind>
Add a point to the path begun by begin_path()
.
Errors when:
begin_path()
wasn't called first.- the identifier is not unique within the outline.
- the point is an off-curve with the smooth attribute set.
- the point sequence is forbidden by the specification.
pub fn end_path(&mut self) -> Result<&mut Self, ErrorKind>
[src]
Ends the path begun by begin_path()
and adds the contour it to the glyph's outline.
Discards path in case of error.
Errors when:
begin_path()
wasn't called first.- the point sequence is forbidden by the specification.
pub fn add_component(
&mut self,
base: GlyphName,
transform: AffineTransform,
identifier: Option<Identifier>
) -> Result<&mut Self, ErrorKind>
[src]
&mut self,
base: GlyphName,
transform: AffineTransform,
identifier: Option<Identifier>
) -> Result<&mut Self, ErrorKind>
Add a component to the glyph.
Errors when the identifier is not unique within the glyph.
pub fn finish(self) -> Result<(Outline, HashSet<Identifier>), ErrorKind>
[src]
Consume the builder and return the final Outline
with the set of hashed indetifiers.
Errors when a path has been begun but not ended.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for OutlineBuilder
[src]
impl Send for OutlineBuilder
[src]
impl Sync for OutlineBuilder
[src]
impl Unpin for OutlineBuilder
[src]
impl UnwindSafe for OutlineBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,