Skip to content

Commit

Permalink
fontbe/glyphs: must subtract - 1 from contour_ends
Browse files Browse the repository at this point in the history
Fixes googlefonts/fontations#564

requires googlefonts/fontations#565 to be released and write-fonts to be bumped first
  • Loading branch information
anthrotype committed Aug 10, 2023
1 parent 3571696 commit 0db6b49
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fontbe/src/glyphs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,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 0db6b49

Please sign in to comment.