Reload letterspaced font metrics independently of generated packets

This commit is contained in:
gloamxun committed 2026-11-28 02:08:44 +08:00
1 parent 65204a7dae
commit aa780a800b
6 files changed
+154 -3

No files matched your search

@@ -1683,6 +1683,7 @@ impl State {
self.pdf_info.clear();
self.pdf_pages_attributes.clear();
self.fonts.reset_format_font_state();
self.discard_format_letterspace_programs();
self
}
pub(super) fn rebind_format_images(
@@ -1730,6 +1731,16 @@ impl State {
}
}
pub(super) fn discard_format_letterspace_programs(&mut self) {
// The format retains the widened TeX metrics. The generated virtual
// packets belong to the job that defined the letter-spaced font.
if self.fonts.discard_letterspace_programs() {
self.visit_format_fonts_mut(|font| {
crate::native_font::NativeFont::discard_letterspace_program(font);
});
}
}
pub(super) fn rebind_format_font_resources(
&mut self,
bindings: &BTreeMap<std::path::PathBuf, std::path::PathBuf>,