Add skewed tests with more text
diff --git a/sparse_strips/vello_cpu/snapshots/glyphs_skewed_long.png b/sparse_strips/vello_cpu/snapshots/glyphs_skewed_long.png new file mode 100644 index 0000000..b3c5b25 --- /dev/null +++ b/sparse_strips/vello_cpu/snapshots/glyphs_skewed_long.png
@@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8b1e407fd2e43b3954bbb4dd3e2b956327bdcc8f4ff0c7b0559b8453a936246 +size 5447
diff --git a/sparse_strips/vello_cpu/snapshots/glyphs_skewed_long_unhinted.png b/sparse_strips/vello_cpu/snapshots/glyphs_skewed_long_unhinted.png new file mode 100644 index 0000000..a703751 --- /dev/null +++ b/sparse_strips/vello_cpu/snapshots/glyphs_skewed_long_unhinted.png
@@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9f09a8159a0cea0fd5029245547001b6b3bc3d01b09d9d2971a352d75052d15 +size 5838
diff --git a/sparse_strips/vello_cpu/tests/glyph.rs b/sparse_strips/vello_cpu/tests/glyph.rs index 16e3888..227c198 100644 --- a/sparse_strips/vello_cpu/tests/glyph.rs +++ b/sparse_strips/vello_cpu/tests/glyph.rs
@@ -106,6 +106,46 @@ } #[test] +fn glyphs_skewed_long() { + let mut ctx = get_ctx(250, 75, false); + let font_size: f32 = 20_f32; + let (font, glyphs) = layout_glyphs( + "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit.\nSed ornare arcu lectus.", + font_size, + ); + + ctx.set_transform(Affine::translate((0., f64::from(font_size)))); + ctx.set_paint(REBECCA_PURPLE.into()); + ctx.glyph_run(&font) + .font_size(font_size) + .glyph_transform(Affine::skew(-10_f64.to_radians().tan(), 0.)) + .hint(true) + .fill_glyphs(glyphs.into_iter()); + + check_ref(&ctx, "glyphs_skewed_long"); +} + +#[test] +fn glyphs_skewed_long_unhinted() { + let mut ctx = get_ctx(250, 75, false); + let font_size: f32 = 20_f32; + let (font, glyphs) = layout_glyphs( + "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit.\nSed ornare arcu lectus.", + font_size, + ); + + ctx.set_transform(Affine::translate((0., f64::from(font_size)))); + ctx.set_paint(REBECCA_PURPLE.into()); + ctx.glyph_run(&font) + .font_size(font_size) + .glyph_transform(Affine::skew(-10_f64.to_radians().tan(), 0.)) + .hint(false) + .fill_glyphs(glyphs.into_iter()); + + check_ref(&ctx, "glyphs_skewed_long_unhinted"); +} + +#[test] fn glyphs_skewed_unskewed() { let mut ctx = get_ctx(150, 125, false); let font_size: f32 = 50_f32;