Skip to content

Commit

Permalink
Merge pull request #390 from googlefonts/fix-iup-contour-ends
Browse files Browse the repository at this point in the history
iup_delta_optimize' contour_ends wants endpoint indices, must -1 lengths
  • Loading branch information
anthrotype authored Aug 10, 2023
2 parents 908b35d + 6031744 commit 65cee59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ env_logger = "0.10.0"

parking_lot = "0.12.1"

fea-rs = "0.12.0"
fea-rs = "0.13.0"
font-types = { version = "0.3.3", features = ["serde"] }
read-fonts = "0.10.0"
write-fonts = "0.13.0"
write-fonts = "0.14.0"
skrifa = "0.9.0"

bitflags = "2.0"
Expand Down
7 changes: 4 additions & 3 deletions fontbe/src/glyphs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,12 @@ impl Work<Context, AnyWorkId, Error> for GlyphWork {
.glyphs
.set_unconditionally(Glyph::new_simple(name.clone(), base_glyph.clone()));

let mut contour_end = 0;
let mut num_points = 0;
let mut contour_ends = Vec::with_capacity(base_glyph.contours().len());
for contour in base_glyph.contours() {
contour_end += contour.len();
contour_ends.push(contour_end);
assert!(!contour.is_empty());
num_points += contour.len();
contour_ends.push(num_points - 1);
}
(
name,
Expand Down

0 comments on commit 65cee59

Please sign in to comment.