summaryrefslogtreecommitdiff
path: root/src/export/pdf.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-03-10 10:20:01 +0100
committerLaurenz <laurmaedje@gmail.com>2021-03-10 10:20:01 +0100
commitbbb9ed07ffe8a2a0ea0a232f6cfc52f82f7f7afe (patch)
tree2b106b63e104652b66efc74a0ffa3080a8b0a134 /src/export/pdf.rs
parentb2b8d37ce03de60582230e03c03efa356b6f31d3 (diff)
Better line spacing calculations ↕
- Only add line spacing between lines. Previously, line spacing was added below every line, making `#box[word]` higher than just `word`. - Compute box height of text as `ascender - descender` so that the full word is contained in the box.
Diffstat (limited to 'src/export/pdf.rs')
-rw-r--r--src/export/pdf.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs
index 9f355278..c30222b2 100644
--- a/src/export/pdf.rs
+++ b/src/export/pdf.rs
@@ -195,7 +195,7 @@ impl<'a> PdfExporter<'a> {
}
let x = pos.x.to_pt() as f32;
- let y = (page.size.height - pos.y - size).to_pt() as f32;
+ let y = (page.size.height - pos.y).to_pt() as f32;
text.matrix(1.0, 0.0, 0.0, 1.0, x, y);
text.show(&shaped.encode_glyphs_be());
}