From 98c3788cf150a31f34d5ef20e1fd375f4d79480c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurenz=20M=C3=A4dje?= Date: Fri, 5 Apr 2019 14:01:10 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20PDF=20conformance=20bugs=20=F0=9F=9A=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /DocumentCatalog -> /Catalog - BT/ -> BT - OpenType -> TrueType (for now) --- src/export/pdf.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 4b42f5c2b..4bb75a0df 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; }