Apply inherited virtual font expansion limits
This commit is contained in:
1 parent
614f09aa9b
commit
45b79fc5a5
4 files changed
+127
-30
No files matched your search
@@ -348,3 +348,33 @@ fn autoexpanded_virtual_shipout_allocates_job_fonts_before_following_commands()
|
||||
let control = source.replace(r"\shipout\copy0", "");
|
||||
assert_eq!(run(&control, &mut host).unwrap().state.fonts().fonts().len(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inherited_virtual_limits_replace_one_bound_and_keep_allocated_slots() {
|
||||
let (root, mut host) = fixture("inherited-limits");
|
||||
let bytes = br"\catcode123=1 \catcode125=2
|
||||
\pdfoutput=1 \pdfpkresolution=600
|
||||
\font\local=ptmr8r \pdffontexpand\local 50 50 25 autoexpand
|
||||
\font\virtual=ptmr7t \pdffontexpand\virtual 75 0 25 autoexpand
|
||||
\pdfadjustspacing=1 \parfillskip=0pt \hsize=31pt
|
||||
\setbox0=\vbox{\virtual \noindent AAAA\par}
|
||||
\shipout\box0
|
||||
\pdffontexpand\local 75 50 25 autoexpand
|
||||
\shipout\vbox{\hsize=27.4pt \local \noindent AAAA\par}
|
||||
\end
|
||||
";
|
||||
let revision = execute(&root, bytes, &mut host);
|
||||
assert_eq!(
|
||||
revision.execution.state.fonts().fonts().iter().map(FontInstance::name).collect::<Vec<_>>(),
|
||||
["nullfont", "ptmr8r", "ptmr8r+50", "ptmr8r-50", "ptmr7t", "ptmr7t+75", "ptmr8r+75", "ptmr8r+75"],
|
||||
);
|
||||
let pages = revision.execution.shipout_display_lists().unwrap();
|
||||
assert_eq!(pages.len(), 2);
|
||||
assert_eq!(
|
||||
pages[1].items.iter().filter(|item| {
|
||||
matches!(item, DisplayItem::NativeGlyph { font, .. }
|
||||
if font.name == "ptmr8r" && font.expansion == -50)
|
||||
}).count(),
|
||||
4,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user