diff options
Diffstat (limited to 'src/export')
| -rw-r--r-- | src/export/pdf.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 811583e5..639d18b9 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -270,10 +270,18 @@ impl PdfFont { } // Subset the font using the selected characters. - let subsetted = font.subsetted( + let subset_result = font.subsetted( chars.iter().cloned(), &["head", "hhea", "hmtx", "maxp", "cmap", "cvt ", "fpgm", "prep", "loca", "glyf"][..] - )?; + ); + + // Check if the subsetting was successful and if it could not handle this + // font we just copy it plainly. + let subsetted = match subset_result { + Ok(font) => font, + Err(FontError::UnsupportedFont(_)) => font.clone(), + Err(err) => return Err(err.into()), + }; // Specify flags for the font. let mut flags = FontFlags::empty(); |
