Embed hinted Type 1C subsets for XeTeX PDF output

This commit is contained in:
gloamxun committed 2026-11-28 11:07:18 +08:00
1 parent 4ae4275cf3
commit 01c6f1d4bd
9 files changed
+629 -26

No files matched your search

+19
View File
@@ -746,6 +746,25 @@ fn xetex_type1_widths_follow_the_encoded_glyph_program() {
.is_ok_and(|base_font| base_font.rsplit(|&byte| byte == b'+').next() == Some(name))
})
.unwrap();
assert!(font.get(b"Encoding").is_err());
assert!(font.get(b"ToUnicode").is_err());
let descriptor = pdf
.dereference(font.get(b"FontDescriptor").unwrap())
.unwrap()
.1
.as_dict()
.unwrap();
assert!(descriptor.get(b"FontFile").is_err());
let embedded = pdf
.dereference(descriptor.get(b"FontFile3").unwrap())
.unwrap()
.1
.as_stream()
.unwrap();
assert_eq!(
embedded.dict.get(b"Subtype").and_then(Object::as_name).unwrap(),
b"Type1C"
);
let first = font.get(b"FirstChar").unwrap().as_i64().unwrap();
let widths = pdf.dereference(font.get(b"Widths").unwrap()).unwrap().1;
match widths.as_array().unwrap()[(i64::from(slot) - first) as usize] {