summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-02-16 18:34:18 +0100
committerLaurenz <laurmaedje@gmail.com>2019-02-16 18:34:18 +0100
commitf3f82f5f2b35f70d2cad934448c7e159aed2a3df (patch)
tree774943d8db7e8c7d32186353ae64dbd5f3075d5b
parentaba8ea4f7ccbdf74051a07569b99282dd473310a (diff)
Fix pdf code in typesetter 🚧
-rw-r--r--src/pdf.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pdf.rs b/src/pdf.rs
index d3616cb9..14feb2ab 100644
--- a/src/pdf.rs
+++ b/src/pdf.rs
@@ -3,7 +3,7 @@
use std::io::{self, Write};
use crate::doc::{Document, DocumentFont};
use pdf::{PdfWriter, Id, Rect, Size, Version, DocumentCatalog, PageTree,
- Page, PageData, Resource, Font, FontType, Text, Trailer};
+ Page, PageData, Resource, font::Type1Font, Text, Trailer};
/// A type that is a sink for types that can be written conforming
@@ -78,8 +78,7 @@ impl<W: Write> WritePdf<Document> for W {
for font in &doc.fonts {
match font {
DocumentFont::Builtin(font) => {
- writer.write_obj(id, &Font {
- subtype: FontType::Type1,
+ writer.write_obj(id, &Type1Font {
base_font: font.name().to_owned(),
})?;
},
@@ -96,8 +95,8 @@ impl<W: Write> WritePdf<Document> for W {
let string = &content.0;
let mut text = Text::new();
- text.set_font(1, Size::from_points(13.0))
- .move_pos(Size::from_points(108.0), Size::from_points(734.0))
+ text.set_font(1, 13.0)
+ .move_pos(108.0, 734.0)
.write_str(&string);
writer.write_obj(id, &text.as_stream())?;