Allocate and share native PDF font objects

This commit is contained in:
gloamxun committed 2026-11-27 16:15:18 +08:00
1 parent d12c4b034b
commit 51451813dc
12 files changed
+345 -20

No files matched your search

+5 -2
View File
@@ -8,9 +8,12 @@ pub(super) fn write_font(
pk: &PkFontProgram,
used: &BTreeMap<u8, char>,
compression: u8,
target: Option<usize>,
) -> usize {
let font = objects.len() + 1;
objects.push(Vec::new());
let font = target.unwrap_or_else(|| {
objects.push(Vec::new());
objects.len()
});
let first = *used.keys().next().unwrap();
let last = *used.keys().next_back().unwrap();
let mut procs = String::new();