Honour explicit sfcode assignments

This commit is contained in:
gloamxun committed 2026-10-23 02:29:40 +08:00
1 parent b5ec36ae2a
commit 4acccaee86
7 files changed
+99 -18

No files matched your search

+12
View File
@@ -363,6 +363,18 @@ fn sentence_spacing_matches_pdftex_at_150pt() {
assert_lines_match("sentence spacing 150pt", &ours, &reference);
}
#[test]
fn explicit_sfcode_matches_pdftex() {
let width = 150;
let text = "alpha. beta gamma, delta; epsilon: zeta eta theta iota kappa lambda mu";
// `\sfcode`.=1000` makes the period behave like an ordinary character for
// the following interword glue, so the sentence space shrinks.
let prefix = "\\sfcode`.=1000\\relax ";
compare_fixture_with(text, width, prefix, |style| {
style.space_factor_codes = vec![('.', 1000)];
});
}
#[test]
fn paragraph_breaks_match_pdftex_at_150pt() {
compare_fixture(WORDS, 150);