Recover XeTeX PDF Unicode from actual OpenType glyph mappings

This commit is contained in:
gloamxun committed 2026-11-25 23:16:13 +08:00
1 parent c52ad71bad
commit 97319d751b
8 files changed
+375 -13

No files matched your search

+7 -1
View File
@@ -27,6 +27,8 @@ pub(crate) mod objects;
mod pk_fonts;
#[path = "pdf_opentype.rs"]
mod opentype_fonts;
#[path = "pdf_opentype_unicode.rs"]
pub(crate) mod opentype_unicode;
const FACE_COUNT: usize = 17;
@@ -2093,7 +2095,11 @@ fn write_pdf(
}
}
}
let opentype = opentype_used.write(&mut objects, final_compression.unwrap_or(0).clamp(0, 9) as u8)?;
let opentype = opentype_used.write(
&mut objects,
final_compression.unwrap_or(0).clamp(0, 9) as u8,
unicode,
)?;
for plan in pages.iter().filter_map(|page| page.pdf_space_plan.as_ref()) {
for id in &plan.in_font {
native_used.get_mut(id).expect("painted space font").2.insert(b' ', ' ');