FA-80147 / Typography line breaking / Member archive
Runt last-line prevention: greedy fill boundary · case 02
Words that exactly fill the measure are wrapped.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: greedy fill boundary | ["is the serif", "grid serif", "of serif"] | ["is the serif", "grid serif of", "serif"] | 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 ↗