diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-08-27 21:47:26 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-08-27 21:47:26 +0200 |
| commit | 2a92428ff6986d8e564b7c223f3d0c5ca0eacaf1 (patch) | |
| tree | 4545b5b598aa95cb23b6737884b5b6e2ee8c0a33 /src/export/pdf.rs | |
| parent | 37835e4d8e5029c857ba4f11b8c2a09563423746 (diff) | |
Do as Dolores says ⚡
Diffstat (limited to 'src/export/pdf.rs')
| -rw-r--r-- | src/export/pdf.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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<W: Write>( - layout: &MultiLayout, + layout: &[BoxLayout], loader: &SharedFontLoader, target: W, ) -> io::Result<usize> { @@ -36,7 +36,7 @@ pub fn export<W: Write>( struct PdfExporter<'a, W: Write> { writer: PdfWriter<W>, - 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<Self> { @@ -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<FaceId, usize>, Vec<FaceId>) { +fn remap_fonts(layouts: &[BoxLayout]) -> (HashMap<FaceId, usize>, Vec<FaceId>) { let mut to_pdf = HashMap::new(); let mut to_layout = vec![]; |
