diff --git a/sparse_strips/vello_cpu/snapshots/glyphs_small.png b/sparse_strips/vello_cpu/snapshots/glyphs_small.png new file mode 100644 index 000000000..29bc7133b --- /dev/null +++ b/sparse_strips/vello_cpu/snapshots/glyphs_small.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90bdb6e7991c6ec4e1c4d2a370f4ba93c1f6c36540cf1a9df524ff948a492cb0 +size 630 diff --git a/sparse_strips/vello_cpu/snapshots/glyphs_small_unhinted.png b/sparse_strips/vello_cpu/snapshots/glyphs_small_unhinted.png new file mode 100644 index 000000000..f1ea57f26 --- /dev/null +++ b/sparse_strips/vello_cpu/snapshots/glyphs_small_unhinted.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64567320e8e9de17cd186400c613ebf8612e044565fe5e56a0437a7c61bb3cfb +size 721 diff --git a/sparse_strips/vello_cpu/tests/glyph.rs b/sparse_strips/vello_cpu/tests/glyph.rs index e024d1b9f..9ac4f200f 100644 --- a/sparse_strips/vello_cpu/tests/glyph.rs +++ b/sparse_strips/vello_cpu/tests/glyph.rs @@ -170,3 +170,35 @@ fn glyphs_glyph_transform_unhinted() { check_ref(&ctx, "glyphs_glyph_transform_unhinted"); } + +#[test] +fn glyphs_small() { + let mut ctx = get_ctx(60, 12, false); + let font_size: f32 = 10_f32; + let (font, glyphs) = layout_glyphs("Hello, world!", 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) + .hint(true) + .fill_glyphs(glyphs.into_iter()); + + check_ref(&ctx, "glyphs_small"); +} + +#[test] +fn glyphs_small_unhinted() { + let mut ctx = get_ctx(60, 12, false); + let font_size: f32 = 10_f32; + let (font, glyphs) = layout_glyphs("Hello, world!", 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) + .hint(false) + .fill_glyphs(glyphs.into_iter()); + + check_ref(&ctx, "glyphs_small_unhinted"); +}