FAILURE MAP
← Case archive

FA-80150 / Typography line breaking / Member archive

Runt last-line prevention: greedy fill boundary · case 05

Words that exactly fill the measure are wrapped.

Member previewVariant 5 · 3 implementations · 8 checks per implementation

Case contract

Input [words, width, minimum last-line length]. Greedy fill (unit spaces; overwide word alone). Then while there are at least two lines and the last line string is shorter than the minimum, move the last word of the previous line down if that line keeps at least one word and the new last line fits. Return lines.

Why this case matters

Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: greedy fill boundary["grid grid", "measure on", "serif serif", "grid the", "grid", "is type"]["grid grid", "measure on", "serif serif", "grid the", "grid is type"]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗