Replace font glue with explicit spaceskip and xspaceskip

This commit is contained in:
gloamxun committed 2026-10-23 02:38:12 +08:00
1 parent 4acccaee86
commit 4be0ff5787
7 files changed
+161 -25

No files matched your search

+19
View File
@@ -363,6 +363,25 @@ fn sentence_spacing_matches_pdftex_at_150pt() {
assert_lines_match("sentence spacing 150pt", &ours, &reference);
}
#[test]
fn spaceskip_matches_pdftex() {
let prefix = "\\spaceskip=6pt plus 1pt minus 0.5pt\\relax ";
compare_fixture_with(WORDS, 150, prefix, |style| {
style.space_skip = Some((6 * 65_536, 65_536, 32_768));
});
}
#[test]
fn xspaceskip_matches_pdftex() {
let text = "alpha. beta gamma, delta; epsilon: zeta eta theta iota kappa lambda mu";
let prefix = "\\spaceskip=6pt plus 1pt minus 0.5pt\\relax \
\\xspaceskip=8pt plus 4pt minus 2pt\\relax ";
compare_fixture_with(text, 150, prefix, |style| {
style.space_skip = Some((6 * 65_536, 65_536, 32_768));
style.xspace_skip = Some((8 * 65_536, 4 * 65_536, 2 * 65_536));
});
}
#[test]
fn explicit_sfcode_matches_pdftex() {
let width = 150;