From 7b84f3b553de672e5374e142467f63b10009aeca Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 4 Jan 2020 22:43:26 +0100 Subject: =?UTF-8?q?Adopt=20new=20font=20loading=20engine=20=E2=9A=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/export/pdf.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/export') diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 0d097a33..c5bc6ee8 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -13,7 +13,7 @@ use tide::font::{ use toddle::Error as FontError; use toddle::font::OwnedFont; -use toddle::query::SharedFontLoader; +use toddle::query::{SharedFontLoader, FontIndex}; use toddle::tables::{ CharMap, Header, HorizontalMetrics, MacStyleFlags, Name, NameEntry, Post, OS2 @@ -59,7 +59,7 @@ struct ExportProcess<'d, W: Write> { /// go through all font usages and assign a new index for each used font. /// This remapping is stored here because we need it when converting the /// layout actions in `ExportProcess::write_page`. - font_remap: HashMap, + font_remap: HashMap, /// These are the fonts sorted by their *new* ids, that is, the values of `font_remap`. fonts: Vec, @@ -99,13 +99,13 @@ impl<'d, W: Write> ExportProcess<'d, W> { fn subset_fonts( layouts: &'d MultiLayout, font_loader: &SharedFontLoader - ) -> PdfResult<(Vec, HashMap)> + ) -> PdfResult<(Vec, HashMap)> { let mut fonts = Vec::new(); - let mut font_chars: HashMap> = HashMap::new(); - let mut old_to_new: HashMap = HashMap::new(); - let mut new_to_old: HashMap = HashMap::new(); - let mut active_font = 0; + let mut font_chars: HashMap> = HashMap::new(); + let mut old_to_new: HashMap = HashMap::new(); + let mut new_to_old: HashMap = HashMap::new(); + let mut active_font = FontIndex::MAX; // We want to find out which fonts are used at all and which are chars // are used for these. We use this information to create subsetted fonts. -- cgit v1.2.3