Support ragged-right paragraphs with an infinite rightskip

This commit is contained in:
gloamxun committed 2026-10-23 04:08:32 +08:00
1 parent f488dd3b6c
commit 448152cea4
7 files changed
+81 -10

No files matched your search

+9
View File
@@ -384,6 +384,15 @@ fn hyphen_penalty_inhibits_hyphenation() {
});
}
/// `\raggedright` leaves an infinite `fil` in `\rightskip`, so lines stop at
/// their natural widths instead of stretching to the measure.
#[test]
fn ragged_right_matches_pdftex() {
compare_fixture_with(WORDS, 150, "\\raggedright ", |style| {
style.ragged_right = true;
});
}
/// `\hangindent`/`\hangafter` shift the affected lines and narrow their
/// measure exactly like pdfLaTeX.
#[test]
+4
View File
@@ -16,6 +16,7 @@ fn body_style() -> ParagraphStyle {
right_skip: 0,
centered: false,
right_aligned: false,
ragged_right: false,
hang_indent: 0,
hang_after: 1,
par_shape: Vec::new(),
@@ -185,6 +186,7 @@ fn route_d_page_matches_pdftex_raster_geometry() {
right_skip: 0,
centered: false,
right_aligned: false,
ragged_right: false,
hang_indent: 0,
hang_after: 1,
par_shape: Vec::new(),
@@ -363,6 +365,7 @@ fn route_d_two_pages_match_pdftex_raster_geometry() {
right_skip: 0,
centered: false,
right_aligned: false,
ragged_right: false,
hang_indent: 0,
hang_after: 1,
par_shape: Vec::new(),
@@ -667,6 +670,7 @@ fn route_d_multiline_bands_track_pdftex() {
right_skip: 0,
centered: false,
right_aligned: false,
ragged_right: false,
hang_indent: 0,
hang_after: 1,
par_shape: Vec::new(),