Apply TeX sentence spacing to interword glue

This commit is contained in:
gloamxun committed 2026-10-23 01:26:04 +08:00
1 parent bd109d03c5
commit 295c934438
8 files changed
+137 -23

No files matched your search

+14
View File
@@ -349,6 +349,20 @@ fn parfillskip_without_fil_justifies_the_last_line() {
assert_lines_match("parfillskip 120pt", &ours, &reference);
}
/// Sentence punctuation changes the space factor, so the interword glue and
/// the resulting line breaks must match pdfLaTeX.
#[test]
fn sentence_spacing_matches_pdftex_at_150pt() {
let width = 150;
let text = "alpha. beta gamma, delta; epsilon: zeta eta theta iota kappa lambda mu";
let Some(reference) = pdftex_lines(&paragraph_fixture_with(text, width, "")) else {
eprintln!("skipping: pdflatex/pdftotext are not installed");
return;
};
let ours = route_d_lines_with(text, f64::from(width), |_| {});
assert_lines_match("sentence spacing 150pt", &ours, &reference);
}
#[test]
fn paragraph_breaks_match_pdftex_at_150pt() {
compare_fixture(WORDS, 150);