FA-80246 / Typography line breaking / Open access
Hanging-indent list labels: overflowing label start · case 01
Text overprints or abuts long labels.
ROOT CAUSE
An overflowing label still starts the text at the hang column.
VERIFIED REPAIR
Start first-line text after the label and one space when it overflows.
Unsuccessful approach: Starting right after the label without the space runs text into it.
Case contract
Input [label, words, width, hang]. The label starts at column 0; first-line text starts at column hang when label+1 space fits, else right after label plus one space. Continuation lines are indented by hang. Greedy fill with unit spaces measuring absolute columns. Return padded lines.
Why this case matters
Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
label, words, width, hang = x
lines = []
first = True
start = hang if len(label) + 1 <= hang else hang
cur = []
col = start
for w in words:
need = col + len(w) if not cur else col + 1 + len(w)
if cur and need > width:
prefix = label.ljust(start) if first else ' ' * hang
lines.append(prefix + ' '.join(cur))
first = False
cur = [w]
col = hang + len(w)
else:
cur.append(w)
col = need
if cur:
prefix = label.ljust(start) if first else ' ' * hang
lines.append(prefix + ' '.join(cur))
return lines
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('regression: overflowing label start', ['(a)', ['grid', 'measure', 'is', 'the', 'at', 'on', 'a'], 21, 3], ['(a) grid measure is', ' the at on a']), ('regression: overflowing label start', ['Note:', ['on', 'measure', 'type', 'is', 'serif', 'a'], 14, 5], ['Note: on', ' measure', ' type is', ' serif a']), ('regression: overflowing label start', ['Note:', ['measure', 'serif', 'kerning', 'is', 'baseline', 'type', 'at', 'of'], 16, 4], ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['1.', ['is', 'baseline', 'of', 'baseline', 'is', 'measure'], 22, 3], ['1. is baseline of', ' baseline is measure']), ('control layout', ['iv.', ['of', 'ink', 'a', 'type', 'is', 'baseline', 'is', 'kerning'], 12, 4], ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning']), ('control layout', ['(a)', ['baseline', 'grid', 'serif', 'x', 'kerning'], 16, 4], ['(a) baseline', ' grid serif x', ' kerning'])], [('regression: overflowing label start', ['iv.', ['at', 'a', 'measure'], 21, 2], ['iv. at a measure']), ('regression: overflowing label start', ['Note:', ['on', 'grid', 'x', 'a', 'the'], 20, 4], ['Note: on grid x a', ' the']), ('regression: overflowing label start', ['(a)', ['a', 'grid', 'type'], 20, 2], ['(a) a grid type']), ('regression: overflowing label start', ['10.', ['on', 'the'], 18, 2], ['10. on the']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['•', ['type', 'kerning', 'kerning', 'type', 'of', 'measure'], 14, 5], ['• type', ' kerning', ' kerning', ' type of', ' measure']), ('control layout', ['iv.', ['is', 'of', 'of', 'kerning', 'is', 'of', 'type'], 20, 4], ['iv. is of of kerning', ' is of type'])], [('regression: overflowing label start', ['Note:', ['type', 'of'], 12, 2], ['Note: type', ' of']), ('regression: overflowing label start', ['(a)', ['kerning', 'kerning', 'baseline'], 22, 2], ['(a) kerning kerning', ' baseline']), ('regression: overflowing label start', ['(a)', ['type', 'is', 'at', 'the', 'measure'], 16, 2], ['(a) type is at', ' the measure']), ('regression: overflowing label start', ['Note:', ['measure', 'baseline', 'is', 'baseline', 'ink', 'the', 'baseline'], 19, 5], ['Note: measure', ' baseline is', ' baseline ink', ' the baseline']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('control layout', ['(a)', ['on', 'measure', 'at', 'the', 'measure'], 12, 4], ['(a) on', ' measure', ' at the', ' measure']), ('control layout', ['(a)', ['baseline', 'type', 'is'], 22, 5], ['(a) baseline type is'])], [('regression: overflowing label start', ['Note:', ['measure', 'serif', 'kerning', 'is', 'baseline', 'type', 'at', 'of'], 16, 4], ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of']), ('regression: overflowing label start', ['iv.', ['serif', 'a', 'ink'], 17, 3], ['iv. serif a ink']), ('regression: overflowing label start', ['Note:', ['a', 'a', 'type', 'kerning', 'measure'], 15, 2], ['Note: a a type', ' kerning', ' measure']), ('regression: overflowing label start', ['iv.', ['serif', 'is', 'at', 'measure', 'baseline', 'a', 'type'], 12, 2], ['iv. serif is', ' at measure', ' baseline a', ' type']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('control layout', ['1.', ['at', 'type', 'at', 'measure', 'is', 'is', 'is', 'is', 'on'], 12, 3], ['1. at type', ' at', ' measure', ' is is is', ' is on']), ('control layout', ['(a)', ['kerning', 'ink', 'of', 'is', 'kerning'], 15, 5], ['(a) kerning', ' ink of is', ' kerning'])], [('regression: overflowing label start', ['10.', ['kerning', 'grid', 'on', 'at', 'ink', 'on', 'at', 'baseline', 'is'], 14, 2], ['10. kerning', ' grid on at', ' ink on at', ' baseline is']), ('regression: overflowing label start', ['A.1.2', ['x', 'a', 'grid', 'baseline', 'a', 'on', 'x'], 12, 5], ['A.1.2 x a', ' grid', ' baseline', ' a on x']), ('regression: overflowing label start', ['(a)', ['ink', 'kerning', 'kerning', 'grid'], 16, 2], ['(a) ink kerning', ' kerning grid']), ('regression: overflowing label start', ['Note:', ['type', 'type', 'of', 'on', 'on', 'kerning'], 20, 5], ['Note: type type of', ' on on kerning']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['iv.', ['is', 'of', 'of', 'kerning', 'is', 'of', 'type'], 20, 4], ['iv. is of of kerning', ' is of type']), ('control layout', ['•', ['baseline', 'serif', 'x', 'type'], 17, 4], ['• baseline', ' serif x type'])]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| label overflows hang | ['Note:the type', ' grid is on', ' serif'] | ['Note: the type', ' grid is on', ' serif'] | Failed |
| regression: overflowing label start | ['(a)grid measure is', ' the at on a'] | ['(a) grid measure is', ' the at on a'] | Failed |
| regression: overflowing label start | ['Note:on', ' measure', ' type is', ' serif a'] | ['Note: on', ' measure', ' type is', ' serif a'] | Failed |
| regression: overflowing label start | ['Note:measure', ' serif', ' kerning is', ' baseline', ' type at of'] | ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of'] | Failed |
| label exactly one short of hang | ['1. the type', ' grid is', ' on'] | ['1. the type', ' grid is', ' on'] | Passed |
| control layout | ['1. is baseline of', ' baseline is measure'] | ['1. is baseline of', ' baseline is measure'] | Passed |
| control layout | ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning'] | ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning'] | Passed |
| control layout | ['(a) baseline', ' grid serif x', ' kerning'] | ['(a) baseline', ' grid serif x', ' kerning'] | Passed |
SHA-256 / 57bf49eb561099bf14e84c11fe6d67b1d725cc6e612c2584eaa0f70187574ce5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
label, words, width, hang = x
lines = []
first = True
start = hang if len(label) + 1 <= hang else len(label)
cur = []
col = start
for w in words:
need = col + len(w) if not cur else col + 1 + len(w)
if cur and need > width:
prefix = label.ljust(start) if first else ' ' * hang
lines.append(prefix + ' '.join(cur))
first = False
cur = [w]
col = hang + len(w)
else:
cur.append(w)
col = need
if cur:
prefix = label.ljust(start) if first else ' ' * hang
lines.append(prefix + ' '.join(cur))
return lines
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('regression: overflowing label start', ['(a)', ['grid', 'measure', 'is', 'the', 'at', 'on', 'a'], 21, 3], ['(a) grid measure is', ' the at on a']), ('regression: overflowing label start', ['Note:', ['on', 'measure', 'type', 'is', 'serif', 'a'], 14, 5], ['Note: on', ' measure', ' type is', ' serif a']), ('regression: overflowing label start', ['Note:', ['measure', 'serif', 'kerning', 'is', 'baseline', 'type', 'at', 'of'], 16, 4], ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['1.', ['is', 'baseline', 'of', 'baseline', 'is', 'measure'], 22, 3], ['1. is baseline of', ' baseline is measure']), ('control layout', ['iv.', ['of', 'ink', 'a', 'type', 'is', 'baseline', 'is', 'kerning'], 12, 4], ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning']), ('control layout', ['(a)', ['baseline', 'grid', 'serif', 'x', 'kerning'], 16, 4], ['(a) baseline', ' grid serif x', ' kerning'])], [('regression: overflowing label start', ['iv.', ['at', 'a', 'measure'], 21, 2], ['iv. at a measure']), ('regression: overflowing label start', ['Note:', ['on', 'grid', 'x', 'a', 'the'], 20, 4], ['Note: on grid x a', ' the']), ('regression: overflowing label start', ['(a)', ['a', 'grid', 'type'], 20, 2], ['(a) a grid type']), ('regression: overflowing label start', ['10.', ['on', 'the'], 18, 2], ['10. on the']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['•', ['type', 'kerning', 'kerning', 'type', 'of', 'measure'], 14, 5], ['• type', ' kerning', ' kerning', ' type of', ' measure']), ('control layout', ['iv.', ['is', 'of', 'of', 'kerning', 'is', 'of', 'type'], 20, 4], ['iv. is of of kerning', ' is of type'])], [('regression: overflowing label start', ['Note:', ['type', 'of'], 12, 2], ['Note: type', ' of']), ('regression: overflowing label start', ['(a)', ['kerning', 'kerning', 'baseline'], 22, 2], ['(a) kerning kerning', ' baseline']), ('regression: overflowing label start', ['(a)', ['type', 'is', 'at', 'the', 'measure'], 16, 2], ['(a) type is at', ' the measure']), ('regression: overflowing label start', ['Note:', ['measure', 'baseline', 'is', 'baseline', 'ink', 'the', 'baseline'], 19, 5], ['Note: measure', ' baseline is', ' baseline ink', ' the baseline']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('control layout', ['(a)', ['on', 'measure', 'at', 'the', 'measure'], 12, 4], ['(a) on', ' measure', ' at the', ' measure']), ('control layout', ['(a)', ['baseline', 'type', 'is'], 22, 5], ['(a) baseline type is'])], [('regression: overflowing label start', ['Note:', ['measure', 'serif', 'kerning', 'is', 'baseline', 'type', 'at', 'of'], 16, 4], ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of']), ('regression: overflowing label start', ['iv.', ['serif', 'a', 'ink'], 17, 3], ['iv. serif a ink']), ('regression: overflowing label start', ['Note:', ['a', 'a', 'type', 'kerning', 'measure'], 15, 2], ['Note: a a type', ' kerning', ' measure']), ('regression: overflowing label start', ['iv.', ['serif', 'is', 'at', 'measure', 'baseline', 'a', 'type'], 12, 2], ['iv. serif is', ' at measure', ' baseline a', ' type']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('control layout', ['1.', ['at', 'type', 'at', 'measure', 'is', 'is', 'is', 'is', 'on'], 12, 3], ['1. at type', ' at', ' measure', ' is is is', ' is on']), ('control layout', ['(a)', ['kerning', 'ink', 'of', 'is', 'kerning'], 15, 5], ['(a) kerning', ' ink of is', ' kerning'])], [('regression: overflowing label start', ['10.', ['kerning', 'grid', 'on', 'at', 'ink', 'on', 'at', 'baseline', 'is'], 14, 2], ['10. kerning', ' grid on at', ' ink on at', ' baseline is']), ('regression: overflowing label start', ['A.1.2', ['x', 'a', 'grid', 'baseline', 'a', 'on', 'x'], 12, 5], ['A.1.2 x a', ' grid', ' baseline', ' a on x']), ('regression: overflowing label start', ['(a)', ['ink', 'kerning', 'kerning', 'grid'], 16, 2], ['(a) ink kerning', ' kerning grid']), ('regression: overflowing label start', ['Note:', ['type', 'type', 'of', 'on', 'on', 'kerning'], 20, 5], ['Note: type type of', ' on on kerning']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['iv.', ['is', 'of', 'of', 'kerning', 'is', 'of', 'type'], 20, 4], ['iv. is of of kerning', ' is of type']), ('control layout', ['•', ['baseline', 'serif', 'x', 'type'], 17, 4], ['• baseline', ' serif x type'])]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| label overflows hang | ['Note:the type', ' grid is on', ' serif'] | ['Note: the type', ' grid is on', ' serif'] | Failed |
| regression: overflowing label start | ['(a)grid measure is', ' the at on a'] | ['(a) grid measure is', ' the at on a'] | Failed |
| regression: overflowing label start | ['Note:on', ' measure', ' type is', ' serif a'] | ['Note: on', ' measure', ' type is', ' serif a'] | Failed |
| regression: overflowing label start | ['Note:measure', ' serif', ' kerning is', ' baseline', ' type at of'] | ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of'] | Failed |
| label exactly one short of hang | ['1. the type', ' grid is', ' on'] | ['1. the type', ' grid is', ' on'] | Passed |
| control layout | ['1. is baseline of', ' baseline is measure'] | ['1. is baseline of', ' baseline is measure'] | Passed |
| control layout | ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning'] | ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning'] | Passed |
| control layout | ['(a) baseline', ' grid serif x', ' kerning'] | ['(a) baseline', ' grid serif x', ' kerning'] | Passed |
SHA-256 / 3ac52c8ab88a1bf9601c37aa9306492b8a2f261a38352cc4d6bb732df16acb46
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
label, words, width, hang = x
lines = []
first = True
start = hang if len(label) + 1 <= hang else len(label) + 1
cur = []
col = start
for w in words:
need = col + len(w) if not cur else col + 1 + len(w)
if cur and need > width:
prefix = label.ljust(start) if first else ' ' * hang
lines.append(prefix + ' '.join(cur))
first = False
cur = [w]
col = hang + len(w)
else:
cur.append(w)
col = need
if cur:
prefix = label.ljust(start) if first else ' ' * hang
lines.append(prefix + ' '.join(cur))
return lines
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('regression: overflowing label start', ['(a)', ['grid', 'measure', 'is', 'the', 'at', 'on', 'a'], 21, 3], ['(a) grid measure is', ' the at on a']), ('regression: overflowing label start', ['Note:', ['on', 'measure', 'type', 'is', 'serif', 'a'], 14, 5], ['Note: on', ' measure', ' type is', ' serif a']), ('regression: overflowing label start', ['Note:', ['measure', 'serif', 'kerning', 'is', 'baseline', 'type', 'at', 'of'], 16, 4], ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['1.', ['is', 'baseline', 'of', 'baseline', 'is', 'measure'], 22, 3], ['1. is baseline of', ' baseline is measure']), ('control layout', ['iv.', ['of', 'ink', 'a', 'type', 'is', 'baseline', 'is', 'kerning'], 12, 4], ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning']), ('control layout', ['(a)', ['baseline', 'grid', 'serif', 'x', 'kerning'], 16, 4], ['(a) baseline', ' grid serif x', ' kerning'])], [('regression: overflowing label start', ['iv.', ['at', 'a', 'measure'], 21, 2], ['iv. at a measure']), ('regression: overflowing label start', ['Note:', ['on', 'grid', 'x', 'a', 'the'], 20, 4], ['Note: on grid x a', ' the']), ('regression: overflowing label start', ['(a)', ['a', 'grid', 'type'], 20, 2], ['(a) a grid type']), ('regression: overflowing label start', ['10.', ['on', 'the'], 18, 2], ['10. on the']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['•', ['type', 'kerning', 'kerning', 'type', 'of', 'measure'], 14, 5], ['• type', ' kerning', ' kerning', ' type of', ' measure']), ('control layout', ['iv.', ['is', 'of', 'of', 'kerning', 'is', 'of', 'type'], 20, 4], ['iv. is of of kerning', ' is of type'])], [('regression: overflowing label start', ['Note:', ['type', 'of'], 12, 2], ['Note: type', ' of']), ('regression: overflowing label start', ['(a)', ['kerning', 'kerning', 'baseline'], 22, 2], ['(a) kerning kerning', ' baseline']), ('regression: overflowing label start', ['(a)', ['type', 'is', 'at', 'the', 'measure'], 16, 2], ['(a) type is at', ' the measure']), ('regression: overflowing label start', ['Note:', ['measure', 'baseline', 'is', 'baseline', 'ink', 'the', 'baseline'], 19, 5], ['Note: measure', ' baseline is', ' baseline ink', ' the baseline']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('control layout', ['(a)', ['on', 'measure', 'at', 'the', 'measure'], 12, 4], ['(a) on', ' measure', ' at the', ' measure']), ('control layout', ['(a)', ['baseline', 'type', 'is'], 22, 5], ['(a) baseline type is'])], [('regression: overflowing label start', ['Note:', ['measure', 'serif', 'kerning', 'is', 'baseline', 'type', 'at', 'of'], 16, 4], ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of']), ('regression: overflowing label start', ['iv.', ['serif', 'a', 'ink'], 17, 3], ['iv. serif a ink']), ('regression: overflowing label start', ['Note:', ['a', 'a', 'type', 'kerning', 'measure'], 15, 2], ['Note: a a type', ' kerning', ' measure']), ('regression: overflowing label start', ['iv.', ['serif', 'is', 'at', 'measure', 'baseline', 'a', 'type'], 12, 2], ['iv. serif is', ' at measure', ' baseline a', ' type']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('control layout', ['1.', ['at', 'type', 'at', 'measure', 'is', 'is', 'is', 'is', 'on'], 12, 3], ['1. at type', ' at', ' measure', ' is is is', ' is on']), ('control layout', ['(a)', ['kerning', 'ink', 'of', 'is', 'kerning'], 15, 5], ['(a) kerning', ' ink of is', ' kerning'])], [('regression: overflowing label start', ['10.', ['kerning', 'grid', 'on', 'at', 'ink', 'on', 'at', 'baseline', 'is'], 14, 2], ['10. kerning', ' grid on at', ' ink on at', ' baseline is']), ('regression: overflowing label start', ['A.1.2', ['x', 'a', 'grid', 'baseline', 'a', 'on', 'x'], 12, 5], ['A.1.2 x a', ' grid', ' baseline', ' a on x']), ('regression: overflowing label start', ['(a)', ['ink', 'kerning', 'kerning', 'grid'], 16, 2], ['(a) ink kerning', ' kerning grid']), ('regression: overflowing label start', ['Note:', ['type', 'type', 'of', 'on', 'on', 'kerning'], 20, 5], ['Note: type type of', ' on on kerning']), ('label overflows hang', ['Note:', ['the', 'type', 'grid', 'is', 'on', 'serif'], 14, 3], ['Note: the type', ' grid is on', ' serif']), ('label exactly one short of hang', ['1.', ['the', 'type', 'grid', 'is', 'on'], 12, 3], ['1. the type', ' grid is', ' on']), ('control layout', ['iv.', ['is', 'of', 'of', 'kerning', 'is', 'of', 'type'], 20, 4], ['iv. is of of kerning', ' is of type']), ('control layout', ['•', ['baseline', 'serif', 'x', 'type'], 17, 4], ['• baseline', ' serif x type'])]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| label overflows hang | ['Note: the type', ' grid is on', ' serif'] | ['Note: the type', ' grid is on', ' serif'] | Passed |
| regression: overflowing label start | ['(a) grid measure is', ' the at on a'] | ['(a) grid measure is', ' the at on a'] | Passed |
| regression: overflowing label start | ['Note: on', ' measure', ' type is', ' serif a'] | ['Note: on', ' measure', ' type is', ' serif a'] | Passed |
| regression: overflowing label start | ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of'] | ['Note: measure', ' serif', ' kerning is', ' baseline', ' type at of'] | Passed |
| label exactly one short of hang | ['1. the type', ' grid is', ' on'] | ['1. the type', ' grid is', ' on'] | Passed |
| control layout | ['1. is baseline of', ' baseline is measure'] | ['1. is baseline of', ' baseline is measure'] | Passed |
| control layout | ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning'] | ['iv. of ink a', ' type is', ' baseline', ' is', ' kerning'] | Passed |
| control layout | ['(a) baseline', ' grid serif x', ' kerning'] | ['(a) baseline', ' grid serif x', ' kerning'] | Passed |
SHA-256 / f5e781b81d0125f7acac71bf911737e37e574de1f604a8e0aea7c8974415ab8e
Verification & scope
A deterministic toy typesetting model with integer widths and a stipulated rule set; it does not claim conformance to any engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:49:52.196679+00:00.
Case digest / 7bc0c49f5d0154daf4628eb7979f500de0e012686b9dfb981367ddda8c5df719