From 0806af4aecc9414962b13894a2a3c4befd2ca3c8 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 23 Aug 2021 13:18:20 +0200 Subject: Kerned PDF output --- tests/typeset.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/typeset.rs b/tests/typeset.rs index ac5ab9e4..80eb9da4 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -444,7 +444,7 @@ fn draw_text(canvas: &mut sk::Pixmap, ts: sk::Transform, ctx: &Context, text: &T for glyph in &text.glyphs { let units_per_em = ttf.units_per_em(); let s = text.size.to_pt() as f32 / units_per_em as f32; - let dx = glyph.x_offset.to_pt() as f32; + let dx = glyph.x_offset.to_length(text.size).to_pt() as f32; let ts = ts.pre_translate(x + dx, 0.0); // Try drawing SVG if present. @@ -481,7 +481,7 @@ fn draw_text(canvas: &mut sk::Pixmap, ts: sk::Transform, ctx: &Context, text: &T } } - x += glyph.x_advance.to_pt() as f32; + x += glyph.x_advance.to_length(text.size).to_pt() as f32; } } -- cgit v1.2.3