Apply pdfTeX line box dimensions and restore output penalties

This commit is contained in:
gloamxun committed 2026-11-29 12:49:56 +08:00
1 parent 7f51f01bd4
commit fb557c09c6
13 files changed
+151 -14

No files matched your search

@@ -332,6 +332,45 @@ fn output_groups_can_wrap_drop_and_reinsert_real_box255_material() {
}
}
#[test]
fn insertion_penalties_survive_page_freeze_and_clear_before_aftergroup() {
let output = r"\showbox255\shipout\box255\insertpenalties=19\aftergroup\AfterOutput";
let body = format!(
r"\def\AfterOutput{{{}}}
\count32=1000 \dimen32=20pt \skip32=0pt \insertpenalties=7
\hbox{{A}}{}
\insert32{{\hbox{{Note}}}}\penalty-10000
\hbox{{B}}\penalty-10000",
observe(r"return=\the\insertpenalties"),
observe(r"frozen=\the\insertpenalties"),
);
compare(&body, output);
}
#[test]
fn pdftex_line_box_dimensions_drive_vertical_glue_and_page_geometry() {
let body = format!(
r"\vsize=55pt\hsize=45pt\baselineskip=14pt\lineskiplimit=0pt\lineskip=2pt
\pdfignoreddimen=-21pt
\pdfeachlineheight=8pt\pdfeachlinedepth=2pt
\pdffirstlineheight=13pt\pdflastlinedepth=6pt
\setbox0=\vbox{{{}
\noindent First\hfil\penalty-10000 Middle\hfil\penalty-10000 Last\par
}}
\unvbox0\penalty-10000
\pdffirstlineheight=\pdfignoreddimen\pdflastlinedepth=\pdfignoreddimen
\hrule height1pt {}
\noindent Additional line\par
\penalty-10000",
observe(r"nested=\the\prevdepth"),
observe(r"after-rule=\the\prevdepth"),
);
compare(
&body,
&format!(r"{}\showbox255\shipout\box255", observe(r"output=\the\prevdepth")),
);
}
#[test]
fn actual_page_marks_carry_by_output_attempt_and_remain_separate_from_split_marks() {
let mut jobs = 0;