Use physical Type 1 glyph widths in XeTeX PDF output
This commit is contained in:
1 parent
885911485e
commit
b22e127e93
11 files changed
+210
-33
No files matched your search
@@ -38,6 +38,8 @@ pub struct NativeFontPaint {
|
||||
pub(crate) descriptor_flags: Option<i32>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub(crate) xdv_descriptor: Option<XdvDescriptor>,
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub(crate) xdv_widths: BTreeMap<u8, i64>,
|
||||
pub resources: Vec<crate::resources::ResourceVersion>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
program_index: Option<usize>,
|
||||
@@ -551,6 +553,7 @@ fn resolve_physical_fonts(
|
||||
subset: false,
|
||||
descriptor_flags: None,
|
||||
xdv_descriptor: None,
|
||||
xdv_widths: BTreeMap::new(),
|
||||
resources: entry.as_ref().and_then(|entry| entry.version.as_ref())
|
||||
.or(default_version).cloned().into_iter()
|
||||
.chain(std::iter::once(resource.version)).collect(),
|
||||
@@ -626,6 +629,7 @@ fn resolve_physical_fonts(
|
||||
} else {
|
||||
None
|
||||
},
|
||||
xdv_widths: BTreeMap::new(),
|
||||
resources,
|
||||
program_index,
|
||||
},
|
||||
@@ -646,7 +650,11 @@ fn resolve_physical_fonts(
|
||||
font.name
|
||||
));
|
||||
}
|
||||
paint.glyph_paths.insert(slot, outlines.glyph_path(name)?);
|
||||
let (path, width) = outlines.glyph_path_and_width(name)?;
|
||||
paint.glyph_paths.insert(slot, path);
|
||||
if paint.xdv_descriptor.is_some() {
|
||||
paint.xdv_widths.insert(slot, width);
|
||||
}
|
||||
}
|
||||
resolved.insert(id, key);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user