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);
+4
View File
@@ -23,6 +23,7 @@ fn body_style() -> ParagraphStyle {
par_fillskip_stretch: 0,
par_fillskip_fil: true,
frenchspacing: false,
space_factor_codes: Vec::new(),
baselineskip: 12 * 65_536,
lineskip: 65_536,
lineskiplimit: 0,
@@ -189,6 +190,7 @@ fn route_d_page_matches_pdftex_raster_geometry() {
par_fillskip_stretch: 0,
par_fillskip_fil: true,
frenchspacing: false,
space_factor_codes: Vec::new(),
baselineskip: 12 * 65_536,
lineskip: 65_536,
lineskiplimit: 0,
@@ -364,6 +366,7 @@ fn route_d_two_pages_match_pdftex_raster_geometry() {
par_fillskip_stretch: 0,
par_fillskip_fil: true,
frenchspacing: false,
space_factor_codes: Vec::new(),
baselineskip: 12 * 65_536,
lineskip: 65_536,
lineskiplimit: 0,
@@ -665,6 +668,7 @@ fn route_d_multiline_bands_track_pdftex() {
par_fillskip_stretch: 0,
par_fillskip_fil: true,
frenchspacing: false,
space_factor_codes: Vec::new(),
baselineskip: 12 * 65_536,
lineskip: 65_536,
lineskiplimit: 0,