Support native PDF font dictionaries and running link controls
This commit is contained in:
1 parent
60d7411dfe
commit
b647bd8dcd
19 files changed
+180
-13
No files matched your search
@@ -44,6 +44,31 @@ impl Executor {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
pub(super) fn pdf_font_settings(
|
||||
&mut self,
|
||||
primitive: Primitive,
|
||||
files: &mut impl SourceProvider,
|
||||
) -> Result<(), Error> {
|
||||
if self.read_parameter(Parameter::Pdfoutput).width() <= 0 {
|
||||
return self.fail("native PDF font settings are unavailable in DVI mode");
|
||||
}
|
||||
let font = self.font_identifier(files)?;
|
||||
if font == FontId::NULL {
|
||||
return self.fail("invalid PDF font identifier");
|
||||
}
|
||||
match primitive {
|
||||
Primitive::Pdffontattr => {
|
||||
let tokens = self.scan_expanded_group(files)?;
|
||||
let attributes = self.pdf_token_bytes(&tokens)?;
|
||||
self.state.fonts.pdf_settings.entry(font).or_default().attributes = attributes;
|
||||
}
|
||||
Primitive::Pdfnobuiltintounicode => {
|
||||
self.state.fonts.pdf_settings.entry(font).or_default().omit_builtin_unicode = true;
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
pub(super) fn pdf_page_data(
|
||||
&mut self,
|
||||
files: &mut impl SourceProvider,
|
||||
|
||||
Reference in new issue
Block a user