summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-04-06 15:13:20 +0200
committerLaurenz <laurmaedje@gmail.com>2021-04-06 15:13:20 +0200
commit464a6ff75e198253ba4128d4820e9ad09458a22d (patch)
treedd9f5e0760c5fa08cd142f00308073f6506362cb /tests
parentde20a21a584a90da682a64e9a79cd18a95195b70 (diff)
Deduplicate ttf-parser and rustybuzz face 🥞
Diffstat (limited to 'tests')
-rw-r--r--tests/typeset.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/typeset.rs b/tests/typeset.rs
index 771c86da..6aef2746 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -418,9 +418,8 @@ fn draw_text(canvas: &mut Pixmap, env: &Env, ts: Transform, shaped: &Text) {
let mut x = 0.0;
for glyph in &shaped.glyphs {
- let units_per_em = ttf.units_per_em().unwrap_or(1000);
-
- let s = (shaped.size / units_per_em as f64).to_pt() as f32;
+ let units_per_em = ttf.units_per_em();
+ let s = shaped.size.to_pt() as f32 / units_per_em as f32;
let dx = glyph.x_offset.to_pt() as f32;
let ts = ts.pre_translate(x + dx, 0.0);