Skip to content

Commit

Permalink
[read-fonts] glyf: mask out cubic off-curve bit
Browse files Browse the repository at this point in the history
We don't want to ship experimental functionality in Chrome. Resolved per #1221 to mask out the bit and re-enable later. Also ignores two tests for this.
  • Loading branch information
dfrg committed Nov 12, 2024
1 parent 2d4c742 commit f57ba07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion read-fonts/src/tables/glyf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ impl<'a> SimpleGlyph<'a> {
}
y = y.wrapping_add(delta);
point.y = C::from_i32(y);
*point_flags = PointFlags::from_bits(point_flags.0);
// Ignore the cubic off curve bit until the cubic glyf portion of
// the spec is finalized
// See <https://github.com/googlefonts/fontations/issues/1221>
//*point_flags = PointFlags::from_bits(point_flags.0);
*point_flags = PointFlags(point_flags.0 & PointFlags::ON_CURVE);
}
Ok(())
}
Expand Down
3 changes: 3 additions & 0 deletions skrifa/src/outline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,9 @@ mod tests {
const CUBIC_GLYPH: GlyphId = GlyphId::new(2);

#[test]
// Ignore test until cubic glyf spec finalizes
// See <https://github.com/googlefonts/fontations/issues/1221>
#[ignore]
fn draw_cubic() {
let font = FontRef::new(font_test_data::CUBIC_GLYF).unwrap();
assert_glyph_path_start_with(
Expand Down
3 changes: 3 additions & 0 deletions skrifa/src/outline/unscaled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ mod tests {
}

#[test]
// Ignore test until cubic glyf spec finalizes
// See <https://github.com/googlefonts/fontations/issues/1221>
#[ignore]
fn read_cubic_glyf_outline() {
let font = FontRef::new(font_test_data::CUBIC_GLYF).unwrap();
let glyph = font.outline_glyphs().get(GlyphId::new(2)).unwrap();
Expand Down

0 comments on commit f57ba07

Please sign in to comment.