Skip to main content

Edge

Struct Edge 

Source
pub struct Edge {
    pub(crate) fpos: i16,
    pub(crate) opos: i32,
    pub(crate) pos: i32,
    pub(crate) flags: TopoFlags,
    pub(crate) dir: Direction,
    pub(crate) blue_edge: Option<ScaledWidth>,
    pub(crate) blue_provenance: Option<BlueProvenance>,
    pub(crate) link_ix: Option<u16>,
    pub(crate) serif_ix: Option<u16>,
    pub(crate) scale: i32,
    pub(crate) first_ix: u16,
    pub(crate) last_ix: u16,
}
Expand description

Sequence of segments used for grid-fitting.

Fields§

§fpos: i16

Original, unscaled position in font units.

§opos: i32

Original, scaled position.

§pos: i32

Current position.

§flags: TopoFlags

Edge flags.

§dir: Direction

Edge direction.

§blue_edge: Option<ScaledWidth>

Present if this is a blue edge.

§blue_provenance: Option<BlueProvenance>

Retains which blue zone was selected and whether the overshoot position won so recorders can reproduce CVT references later.

§link_ix: Option<u16>

Index of linked edge.

§serif_ix: Option<u16>

Index of primary edge for serif.

§scale: i32

Used to speed up edge interpolation.

§first_ix: u16

Index of first segment in edge.

§last_ix: u16

Index of last segment in edge.

Implementations§

Source§

impl Edge

Source

pub fn original_position(&self) -> i16

Returns the original unscaled position in font units.

Source

pub fn scaled_position(&self) -> i32

Returns the original scaled position.

Source

pub fn position(&self) -> i32

Returns the hinted position.

Source

pub fn flags(&self) -> TopoFlags

Returns flags that define the properties of the edge.

Source

pub fn direction(&self) -> Direction

Returns the dominant direction of the edge.

Source

pub fn blue_edge(&self) -> Option<ScaledWidth>

Returns the width of the captured blue zone.

Source

pub fn blue_provenance(&self) -> Option<BlueProvenance>

Returns which blue zone was selected and whether the overshoot position won so recorders can reproduce CVT references later.

Returns the index of the linked edge.

Source

pub fn serif_index(&self) -> Option<u16>

Returns the index of the associated serif edge.

Source

pub fn scale(&self) -> i32

Returns the computed scale factor of the edge.

Source

pub fn segment_indices(&self) -> (u16, u16)

Returns the indices of the first and last segments that define the edge.

Use Segment::next_in_edge_index to walk the segment list.

Source§

impl Edge

Source

pub(crate) fn serif<'a>(&self, edges: &'a [Edge]) -> Option<&'a Edge>

Trait Implementations§

Source§

impl Clone for Edge

Source§

fn clone(&self) -> Edge

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Edge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Edge

Source§

fn default() -> Edge

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

impl PartialEq for Edge

Source§

fn eq(&self, other: &Edge) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Edge

Source§

impl Eq for Edge

Source§

impl StructuralPartialEq for Edge

Auto Trait Implementations§

§

impl Freeze for Edge

§

impl RefUnwindSafe for Edge

§

impl Send for Edge

§

impl Sync for Edge

§

impl Unpin for Edge

§

impl UnsafeUnpin for Edge

§

impl UnwindSafe for Edge

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.