summaryrefslogtreecommitdiff
path: root/src/pdf
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-04-05 22:32:09 +0200
committerLaurenz <laurmaedje@gmail.com>2021-04-05 22:32:09 +0200
commitde20a21a584a90da682a64e9a79cd18a95195b70 (patch)
tree2c7ade7d1078111ebbce889a0fca8cee388d6135 /src/pdf
parenta86cf7bd8c58b0ec26f8f53eb90f0dc6c95a1070 (diff)
Reshaping with unsafe-to-break ⚡
Co-Authored-By: Martin <mhaug@live.de>
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pdf/mod.rs b/src/pdf/mod.rs
index a97dfa2c..656635fc 100644
--- a/src/pdf/mod.rs
+++ b/src/pdf/mod.rs
@@ -50,7 +50,7 @@ impl<'a> PdfExporter<'a> {
for frame in frames {
for (_, element) in &frame.elements {
match element {
- Element::Text(shaped) => fonts.insert(shaped.face),
+ Element::Text(shaped) => fonts.insert(shaped.face_id),
Element::Image(image) => {
let img = env.resources.loaded::<ImageResource>(image.res);
if img.buf.color().has_alpha() {
@@ -187,11 +187,11 @@ impl<'a> PdfExporter<'a> {
// Then, also check if we need to issue a font switching
// action.
- if shaped.face != face || shaped.size != size {
- face = shaped.face;
+ if shaped.face_id != face || shaped.size != size {
+ face = shaped.face_id;
size = shaped.size;
- let name = format!("F{}", self.fonts.map(shaped.face));
+ let name = format!("F{}", self.fonts.map(shaped.face_id));
text.font(Name(name.as_bytes()), size.to_pt() as f32);
}