Glyph

Struct Glyph 

Source
pub struct Glyph {
    pub master_name: String,
    pub master_index: usize,
    pub curves: Vec<BezPath>,
    pub points: Vec<Vec<GlyfPoint>>,
    /* private fields */
}
Expand description

A glyph at a given location, containing per-contour information

The easiest way to construct a glyph for testing is to start with a BezGlyph and call into() on it, then modify its master name and index.

Once you have two glyphs, you can test their interpolability by passing them to run_tests.

Fields§

§master_name: String

The name of the master

§master_index: usize

The index of the master

§curves: Vec<BezPath>

The glyph’s contours

§points: Vec<Vec<GlyfPoint>>

The glyph’s points

Trait Implementations§

Source§

impl Default for Glyph

Source§

fn default() -> Glyph

Returns the “default value” for a type. Read more
Source§

impl From<BezGlyph> for Glyph

Source§

fn from(val: BezGlyph) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Glyph

§

impl RefUnwindSafe for Glyph

§

impl Send for Glyph

§

impl Sync for Glyph

§

impl Unpin for Glyph

§

impl UnwindSafe for Glyph

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.