From 869c2d3be1172f2b8616dafcfe0da2f86a080641 Mon Sep 17 00:00:00 2001 From: Paulo Coelho <9609090+prscoelho@users.noreply.github.com> Date: Sat, 10 Feb 2024 16:27:25 +0000 Subject: [PATCH] Set default_width to Some(1.0) default_width is never changed from its initial value of None, so for pdfs that end up unwrapping this value, it always results in a panic. Therefore, assume a default_width of 1.0. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 8232fd0..df9ebde 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -589,7 +589,7 @@ impl<'a> PdfSimpleFont<'a> { panic!("no widths"); } - PdfSimpleFont {doc, font, widths: width_map, encoding: encoding_table, default_width: None, unicode_map} + PdfSimpleFont {doc, font, widths: width_map, encoding: encoding_table, default_width: Some(1.0), unicode_map} } #[allow(dead_code)]