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: i16Original, unscaled position in font units.
opos: i32Original, scaled position.
pos: i32Current position.
flags: TopoFlagsEdge flags.
dir: DirectionEdge 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: i32Used to speed up edge interpolation.
first_ix: u16Index of first segment in edge.
last_ix: u16Index of last segment in edge.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn original_position(&self) -> i16
pub fn original_position(&self) -> i16
Returns the original unscaled position in font units.
Sourcepub fn scaled_position(&self) -> i32
pub fn scaled_position(&self) -> i32
Returns the original scaled position.
Sourcepub fn blue_edge(&self) -> Option<ScaledWidth>
pub fn blue_edge(&self) -> Option<ScaledWidth>
Returns the width of the captured blue zone.
Sourcepub fn blue_provenance(&self) -> Option<BlueProvenance>
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.
Sourcepub fn link_index(&self) -> Option<u16>
pub fn link_index(&self) -> Option<u16>
Returns the index of the linked edge.
Sourcepub fn serif_index(&self) -> Option<u16>
pub fn serif_index(&self) -> Option<u16>
Returns the index of the associated serif edge.
Sourcepub fn segment_indices(&self) -> (u16, u16)
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.