diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-25 13:24:30 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-25 13:24:30 +0200 |
| commit | f2882bf85476cd55eaad0594d983fbcf8a1ef778 (patch) | |
| tree | 8235ec36788e919c8a1ebbcc878231b415636a7f /src/export/pdf.rs | |
| parent | 821536b253bed0753eb031d4cc7fbd407dce9f39 (diff) | |
Support decoding of mac roman names
This allows discovery of Apple fonts without unicode name entries.
Diffstat (limited to 'src/export/pdf.rs')
| -rw-r--r-- | src/export/pdf.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 9b9d0e8e..65c922ab 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -15,7 +15,7 @@ use ttf_parser::{name_id, GlyphId, Tag}; use super::subset; use crate::color::Color; -use crate::font::{FaceId, FontStore}; +use crate::font::{find_name, FaceId, FontStore}; use crate::geom::{self, Em, Length, Size}; use crate::image::{Image, ImageId, ImageStore}; use crate::layout::{Element, Frame, Geometry, Paint}; @@ -289,12 +289,7 @@ impl<'a> PdfExporter<'a> { let face = self.fonts.get(face_id); let ttf = face.ttf(); - let name = ttf - .names() - .find(|entry| { - entry.name_id() == name_id::POST_SCRIPT_NAME && entry.is_unicode() - }) - .and_then(|entry| entry.to_string()) + let name = find_name(ttf.names(), name_id::POST_SCRIPT_NAME) .unwrap_or_else(|| "unknown".to_string()); let base_font = format!("ABCDEF+{}", name); |
