Skip to content

Commit

Permalink
[skrifa] autohint: CJK edges (#1134)
Browse files Browse the repository at this point in the history
This was similar enough to latin that changes were folded into the current code with some branches.
  • Loading branch information
dfrg authored Sep 7, 2024
1 parent 6d01f74 commit f2735a4
Show file tree
Hide file tree
Showing 5 changed files with 490 additions and 119 deletions.
9 changes: 9 additions & 0 deletions skrifa/src/outline/autohint/axis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ impl Segment {
edges.get(self.edge_ix.map(|ix| ix as usize)?)
}

/// Returns the next segment in this segment's parent edge.
pub fn next_in_edge<'a>(&self, segments: &'a [Segment]) -> Option<&'a Segment> {
segments.get(self.edge_next_ix.map(|ix| ix as usize)?)
}

pub fn link<'a>(&self, segments: &'a [Segment]) -> Option<&'a Segment> {
segments.get(self.link_ix.map(|ix| ix as usize)?)
}
Expand Down Expand Up @@ -232,6 +237,10 @@ impl Edge {
}

impl Edge {
pub fn first_segment<'a>(&self, segments: &'a [Segment]) -> Option<&'a Segment> {
segments.get(self.first_ix as usize)
}

pub fn link<'a>(&self, edges: &'a [Edge]) -> Option<&'a Edge> {
edges.get(self.link_ix.map(|ix| ix as usize)?)
}
Expand Down
Loading

0 comments on commit f2735a4

Please # to comment.