From 2a92428ff6986d8e564b7c223f3d0c5ca0eacaf1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 27 Aug 2020 21:47:26 +0200 Subject: =?UTF-8?q?Do=20as=20Dolores=20says=20=E2=9A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/export/pdf.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/export') diff --git a/src/export/pdf.rs b/src/export/pdf.rs index cd417a9c..e8220b54 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -14,7 +14,7 @@ use tide::{PdfWriter, Rect, Ref, Trailer, Version}; use ttf_parser::{name_id, GlyphId}; use crate::layout::elements::LayoutElement; -use crate::layout::{BoxLayout, MultiLayout}; +use crate::layout::BoxLayout; use crate::length::Length; use crate::SharedFontLoader; @@ -27,7 +27,7 @@ use crate::SharedFontLoader; /// The raw _PDF_ is written into the `target` writable, returning the number of /// bytes written. pub fn export( - layout: &MultiLayout, + layout: &[BoxLayout], loader: &SharedFontLoader, target: W, ) -> io::Result { @@ -36,7 +36,7 @@ pub fn export( struct PdfExporter<'a, W: Write> { writer: PdfWriter, - layouts: &'a MultiLayout, + layouts: &'a [BoxLayout], loader: &'a SharedFontLoader, /// We need to know exactly which indirect reference id will be used for /// which objects up-front to correctly declare the document catalogue, page @@ -60,7 +60,7 @@ const NUM_OBJECTS_PER_FONT: u32 = 5; impl<'a, W: Write> PdfExporter<'a, W> { fn new( - layouts: &'a MultiLayout, + layouts: &'a [BoxLayout], loader: &'a SharedFontLoader, target: W, ) -> io::Result { @@ -289,7 +289,7 @@ impl<'a, W: Write> PdfExporter<'a, W> { /// Assigns a new PDF-internal index to each used face and returns two mappings: /// - Forwards from the old face ids to the new pdf indices (hash map) /// - Backwards from the pdf indices to the old face ids (vec) -fn remap_fonts(layouts: &MultiLayout) -> (HashMap, Vec) { +fn remap_fonts(layouts: &[BoxLayout]) -> (HashMap, Vec) { let mut to_pdf = HashMap::new(); let mut to_layout = vec![]; -- cgit v1.2.3