Skip to content

Commit

Permalink
Merge pull request #732 from googlefonts/prune-marks-nop-deltas
Browse files Browse the repository at this point in the history
[marks] Prune nop deltas from marks
  • Loading branch information
cmyr authored Mar 13, 2024
2 parents 4431a72 + f9741b4 commit 8981d4c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fontbe/src/features/marks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,14 @@ fn resolve_anchor(
static_metadata,
y_values.iter().map(|item| (&item.0, &item.1)),
)?;
Ok(fea_rs::compile::Anchor::new(x_default, y_default)
.with_x_device(x_deltas)
.with_y_device(y_deltas))

let mut anchor = fea_rs::compile::Anchor::new(x_default, y_default);
if x_deltas.iter().any(|v| v.1 != 0) {
anchor = anchor.with_x_device(x_deltas);
}
if y_deltas.iter().any(|v| v.1 != 0) {
anchor = anchor.with_y_device(y_deltas);
}

Ok(anchor)
}

0 comments on commit 8981d4c

Please sign in to comment.