diff --git a/sparse_strips/vello_common/src/glyph.rs b/sparse_strips/vello_common/src/glyph.rs index 766c2aaac..aaeef26ec 100644 --- a/sparse_strips/vello_common/src/glyph.rs +++ b/sparse_strips/vello_common/src/glyph.rs @@ -149,11 +149,18 @@ impl<'a, T: GlyphRenderer + 'a> GlyphRunBuilder<'a, T> { local_transform *= glyph_transform; } + // When hinting, ensure the y-offset is integer. The x-offset doesn't matter, as we + // perform vertical-only hinting. + let mut total_transform = (transform * local_transform).as_coeffs(); + if hinting_instance.is_some() { + total_transform[5] = total_transform[5].round(); + } + render_glyph( self.renderer, PreparedGlyph::Outline(OutlineGlyph { path: &path.0, - transform: transform * local_transform, + transform: Affine::new(total_transform), }), ); } diff --git a/sparse_strips/vello_cpu/snapshots/glyphs_scaled.png b/sparse_strips/vello_cpu/snapshots/glyphs_scaled.png index 6e3611855..58b60c4aa 100644 --- a/sparse_strips/vello_cpu/snapshots/glyphs_scaled.png +++ b/sparse_strips/vello_cpu/snapshots/glyphs_scaled.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5305569218595bbe61303802b495c4a2104b96daf228d9fd3cb2ac6c9d9a5fe5 -size 2434 +oid sha256:ffd1d0af41fe4a40ce858737a182bf2a95b993a5664acc9d8ac96e6cfd3f3029 +size 2376