summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz Mädje <laurmaedje@gmail.com>2019-04-05 14:01:10 +0200
committerLaurenz Mädje <laurmaedje@gmail.com>2019-04-05 14:01:10 +0200
commit98c3788cf150a31f34d5ef20e1fd375f4d79480c (patch)
tree8bd337308752e8e768d431794a49241320c4282a
parent6c29e45ce2c848fe88003b62aaf8aacf7c0b8da6 (diff)
Fix PDF conformance bugs 🚧
- /DocumentCatalog -> /Catalog - BT/ -> BT - OpenType -> TrueType (for now)
-rw-r--r--src/export/pdf.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs
index 4b42f5c2..4bb75a0d 100644
--- a/src/export/pdf.rs
+++ b/src/export/pdf.rs
@@ -5,7 +5,7 @@ use std::io::{self, Write};
use pdf::{PdfWriter, Ref, Rect, Version, Trailer, Content};
use pdf::doc::{Catalog, PageTree, Page, Resource, Text};
use pdf::font::{Type0Font, CIDFont, CIDFontType, CIDSystemInfo, FontDescriptor, FontFlags};
-use pdf::font::{GlyphUnit, CMap, CMapEncoding, WidthRecord, FontStream, EmbeddedFontType};
+use pdf::font::{GlyphUnit, CMap, CMapEncoding, WidthRecord, FontStream};
use crate::doc::{Document, Text as DocText, TextCommand};
use crate::font::{Font, FontError};
use crate::engine::Size;
@@ -203,7 +203,7 @@ impl<'d, W: Write> PdfEngine<'d, W> {
.descent(font.descender)
.cap_height(font.cap_height)
.stem_v(font.stem_v)
- .font_file_3(id + 4)
+ .font_file_2(id + 4)
)?;
// The CMap, which maps glyphs to unicode codepoints.
@@ -211,10 +211,7 @@ impl<'d, W: Write> PdfEngine<'d, W> {
self.writer.write_obj(id + 3, &CMap::new("Custom", system_info, mapping))?;
// Finally write the subsetted font program.
- self.writer.write_obj(id + 4, &FontStream::new(
- &font.program,
- EmbeddedFontType::OpenType,
- ))?;
+ self.writer.write_obj(id + 4, &FontStream::new(&font.program))?;
id += 5;
}