FA-80176 / Typography line breaking / Open access
Kerning and ligature line measure: non-joiner handling · case 01
Compound words marked with a non-joiner still form ligatures.
ROOT CAUSE
Non-joiners are stripped before measuring, letting ligatures form across them.
VERIFIED REPAIR
Treat the non-joiner as an invisible barrier that blocks ligatures and kerning.
Unsuccessful approach: Skipping the non-joiner without resetting the kerning state still kerns across it.
Case contract
Input [words, width]. Glyph widths: i,l,j,.,, 4; t,f 6; m 15; w 14; M 16; W 18; other lowercase 10; other uppercase 13; space 5. Within a word, fi/fl/ff form ligatures (11/11/12) with no kerning into or out of them; case-sensitive kern pairs apply between adjacent glyphs; "|" is a non-joiner (invisible, blocks ligatures and kerning). No kerning across spaces. Greedy fill. Return [[text, width]].
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):
words, width = x
W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}
LIG = {'fi': 11, 'fl': 11, 'ff': 12}
KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}
SPACE = 5
def glyph(c):
return W.get(c, 13 if c.isupper() else 10)
def measure(w):
w = w.replace('|', '')
total, prev, i = 0, None, 0
while i < len(w):
if w[i] == '|':
prev = None
i += 1
continue
pair = w[i:i + 2]
if pair in LIG:
total += LIG[pair]
prev = None
i += 2
continue
g = w[i]
total += glyph(g)
if prev is not None:
total += KERN.get(prev + g, 0)
prev = g
i += 1
return total
def line_width(ws):
return sum(measure(t) for t in ws) + SPACE * (len(ws) - 1)
lines, cur = [], []
for w in words:
cand = cur + [w]
if not cur or line_width(cand) <= width:
cur = cand
else:
lines.append(cur)
cur = [w]
if cur:
lines.append(cur)
return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: non-joiner handling', [['LA', 'fl.', 'av', 'LA|VALLE', 'Vat', 'Wavy'], 112], [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]]), ('regression: non-joiner handling', [['LA|VALLE', 'LA', 'y.'], 128], [['LAVALLE LA', 119], ['y.', 12]]), ('regression: non-joiner handling', [['Tofu', 'LA|VALLE', 'flow'], 134], [['Tofu LAVALLE', 130], ['flow', 35]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['fly.', 'fi', 'fl.', 'av'], 74], [['fly. fi fl.', 59], ['av', 19]]), ('control layout', [['LA', 'VIA'], 102], [['LA VIA', 70]])], [('regression: non-joiner handling', [['shelf|life', 'AVAIL', 'LA|VALLE', 'Wavy', 'Tofu', 'Vat', 'y.'], 131], [['shelflife AVAIL', 128], ['LAVALLE', 88], ['Wavy Tofu Vat', 119], ['y.', 12]]), ('regression: non-joiner handling', [['office', 'wolf|like', 'fl.', 'y.', 'fl.'], 72], [['office', 46], ['wolflike', 62], ['fl. y. fl.', 52]]), ('regression: non-joiner handling', [['office', 'LT', 'Wavy', 'AT', 'Vat', 'LA|VALLE', 'our'], 65], [['office', 46], ['LT', 23], ['Wavy', 45], ['AT Vat', 58], ['LAVALLE', 88], ['our', 30]]), ('regression: non-joiner handling', [['LA|VALLE', 'VIA', 'raffle', 'dry.'], 97], [['LAVALLE', 88], ['VIA raffle', 90], ['dry.', 32]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['fly.', 'flow', 'Wavy', 'av', 'LT'], 132], [['fly. flow Wavy', 113], ['av LT', 47]]), ('control layout', [['LA', 'office', 'fl.', 'VIA', 'LA'], 96], [['LA office', 77], ['fl. VIA LA', 90]])], [('regression: non-joiner handling', [['LA|VALLE', 'fl.'], 138], [['LAVALLE fl.', 108]]), ('regression: non-joiner handling', [['LA', 'fl.', 'av', 'LA|VALLE', 'Vat', 'Wavy'], 112], [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]]), ('regression: non-joiner handling', [['LA|VALLE', 'shelf|life', 'office', 'AT', 'wolf|like'], 116], [['LAVALLE', 88], ['shelflife office', 115], ['AT wolflike', 93]]), ('regression: non-joiner handling', [['Yo', 'LA|VALLE', 'Tofu', 'Ta', 'Av'], 56], [['Yo', 21], ['LAVALLE', 88], ['Tofu', 37], ['Ta Av', 49]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['our', 'av', 'AT', 'Yo'], 92], [['our av AT', 85], ['Yo', 21]]), ('control layout', [['fl.', 'Yo', 'Tofu'], 112], [['fl. Yo Tofu', 83]])], [('regression: non-joiner handling', [['LA|VALLE', 'office', 'raffle', 'LA', 'staff.'], 129], [['LAVALLE', 88], ['office raffle LA', 128], ['staff.', 42]]), ('regression: non-joiner handling', [['flow', 'shelf|life', 'Wavy', 'AVAIL', 'dry.'], 88], [['flow', 35], ['shelflife', 64], ['Wavy', 45], ['AVAIL', 59], ['dry.', 32]]), ('regression: non-joiner handling', [['LA|VALLE', 'flow', 'y.', 'dry.', 'AVAIL', 'LA'], 106], [['LAVALLE', 88], ['flow y. dry.', 89], ['AVAIL LA', 90]]), ('regression: non-joiner handling', [['LA|VALLE', 'shelf|life'], 127], [['LAVALLE', 88], ['shelflife', 64]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['AT', 'raffle', 'Wavy', 'Vat', 'AT', 'dry.', 'AVAIL'], 98], [['AT raffle', 77], ['Wavy Vat', 77], ['AT dry.', 63], ['AVAIL', 59]]), ('control layout', [['VIA', 'flow', 'dry.', 'y.', 'AVAIL', 'fl.', 'av'], 42], [['VIA', 39], ['flow', 35], ['dry.', 32], ['y.', 12], ['AVAIL', 59], ['fl. av', 39]])], [('regression: non-joiner handling', [['fi', 'flow', 'shelf|life', 'LA', 'our', 'Yo'], 104], [['fi flow', 51], ['shelflife LA', 95], ['our Yo', 56]]), ('regression: non-joiner handling', [['wolf|like', 'Tofu', 'Yo', 'AVAIL', 'Wavy', 'Av'], 108], [['wolflike Tofu', 104], ['Yo AVAIL', 85], ['Wavy Av', 73]]), ('regression: non-joiner handling', [['fly.', 'LA|VALLE'], 52], [['fly.', 23], ['LAVALLE', 88]]), ('regression: non-joiner handling', [['Ta', 'raffle', 'VIA', 'LA|VALLE'], 66], [['Ta', 21], ['raffle', 46], ['VIA', 39], ['LAVALLE', 88]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('control layout', [['Wavy', 'fi', 'Av', 'LT'], 86], [['Wavy fi', 61], ['Av LT', 51]]), ('control layout', [['fi', 'y.', 'fly.', 'office'], 58], [['fi y. fly.', 56], ['office', 46]])]]
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 |
|---|---|---|---|
| non-joiner blocks ligature | [['shelflife', 65]] | [['shelflife', 64]] | Failed |
| regression: non-joiner handling | [['LA fl. av', 70], ['LAVALLE', 85], ['Vat Wavy', 77]] | [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]] | Failed |
| regression: non-joiner handling | [['LAVALLE LA', 116], ['y.', 12]] | [['LAVALLE LA', 119], ['y.', 12]] | Failed |
| regression: non-joiner handling | [['Tofu LAVALLE', 127], ['flow', 35]] | [['Tofu LAVALLE', 130], ['flow', 35]] | Failed |
| case-sensitive pair | [['Av av', 47]] | [['Av av', 47]] | Passed |
| ligature then period | [['fl. fi,', 35]] | [['fl. fi,', 35]] | Passed |
| control layout | [['fly. fi fl.', 59], ['av', 19]] | [['fly. fi fl.', 59], ['av', 19]] | Passed |
| control layout | [['LA VIA', 70]] | [['LA VIA', 70]] | Passed |
SHA-256 / d442c92794f2812f740494d16f9e8214c36989ed4cac5e19fc0fc4c0ff8a1418
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
words, width = x
W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}
LIG = {'fi': 11, 'fl': 11, 'ff': 12}
KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}
SPACE = 5
def glyph(c):
return W.get(c, 13 if c.isupper() else 10)
def measure(w):
total, prev, i = 0, None, 0
while i < len(w):
if w[i] == '|':
i += 1
continue
pair = w[i:i + 2]
if pair in LIG:
total += LIG[pair]
prev = None
i += 2
continue
g = w[i]
total += glyph(g)
if prev is not None:
total += KERN.get(prev + g, 0)
prev = g
i += 1
return total
def line_width(ws):
return sum(measure(t) for t in ws) + SPACE * (len(ws) - 1)
lines, cur = [], []
for w in words:
cand = cur + [w]
if not cur or line_width(cand) <= width:
cur = cand
else:
lines.append(cur)
cur = [w]
if cur:
lines.append(cur)
return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: non-joiner handling', [['LA', 'fl.', 'av', 'LA|VALLE', 'Vat', 'Wavy'], 112], [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]]), ('regression: non-joiner handling', [['LA|VALLE', 'LA', 'y.'], 128], [['LAVALLE LA', 119], ['y.', 12]]), ('regression: non-joiner handling', [['Tofu', 'LA|VALLE', 'flow'], 134], [['Tofu LAVALLE', 130], ['flow', 35]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['fly.', 'fi', 'fl.', 'av'], 74], [['fly. fi fl.', 59], ['av', 19]]), ('control layout', [['LA', 'VIA'], 102], [['LA VIA', 70]])], [('regression: non-joiner handling', [['shelf|life', 'AVAIL', 'LA|VALLE', 'Wavy', 'Tofu', 'Vat', 'y.'], 131], [['shelflife AVAIL', 128], ['LAVALLE', 88], ['Wavy Tofu Vat', 119], ['y.', 12]]), ('regression: non-joiner handling', [['office', 'wolf|like', 'fl.', 'y.', 'fl.'], 72], [['office', 46], ['wolflike', 62], ['fl. y. fl.', 52]]), ('regression: non-joiner handling', [['office', 'LT', 'Wavy', 'AT', 'Vat', 'LA|VALLE', 'our'], 65], [['office', 46], ['LT', 23], ['Wavy', 45], ['AT Vat', 58], ['LAVALLE', 88], ['our', 30]]), ('regression: non-joiner handling', [['LA|VALLE', 'VIA', 'raffle', 'dry.'], 97], [['LAVALLE', 88], ['VIA raffle', 90], ['dry.', 32]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['fly.', 'flow', 'Wavy', 'av', 'LT'], 132], [['fly. flow Wavy', 113], ['av LT', 47]]), ('control layout', [['LA', 'office', 'fl.', 'VIA', 'LA'], 96], [['LA office', 77], ['fl. VIA LA', 90]])], [('regression: non-joiner handling', [['LA|VALLE', 'fl.'], 138], [['LAVALLE fl.', 108]]), ('regression: non-joiner handling', [['LA', 'fl.', 'av', 'LA|VALLE', 'Vat', 'Wavy'], 112], [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]]), ('regression: non-joiner handling', [['LA|VALLE', 'shelf|life', 'office', 'AT', 'wolf|like'], 116], [['LAVALLE', 88], ['shelflife office', 115], ['AT wolflike', 93]]), ('regression: non-joiner handling', [['Yo', 'LA|VALLE', 'Tofu', 'Ta', 'Av'], 56], [['Yo', 21], ['LAVALLE', 88], ['Tofu', 37], ['Ta Av', 49]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['our', 'av', 'AT', 'Yo'], 92], [['our av AT', 85], ['Yo', 21]]), ('control layout', [['fl.', 'Yo', 'Tofu'], 112], [['fl. Yo Tofu', 83]])], [('regression: non-joiner handling', [['LA|VALLE', 'office', 'raffle', 'LA', 'staff.'], 129], [['LAVALLE', 88], ['office raffle LA', 128], ['staff.', 42]]), ('regression: non-joiner handling', [['flow', 'shelf|life', 'Wavy', 'AVAIL', 'dry.'], 88], [['flow', 35], ['shelflife', 64], ['Wavy', 45], ['AVAIL', 59], ['dry.', 32]]), ('regression: non-joiner handling', [['LA|VALLE', 'flow', 'y.', 'dry.', 'AVAIL', 'LA'], 106], [['LAVALLE', 88], ['flow y. dry.', 89], ['AVAIL LA', 90]]), ('regression: non-joiner handling', [['LA|VALLE', 'shelf|life'], 127], [['LAVALLE', 88], ['shelflife', 64]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['AT', 'raffle', 'Wavy', 'Vat', 'AT', 'dry.', 'AVAIL'], 98], [['AT raffle', 77], ['Wavy Vat', 77], ['AT dry.', 63], ['AVAIL', 59]]), ('control layout', [['VIA', 'flow', 'dry.', 'y.', 'AVAIL', 'fl.', 'av'], 42], [['VIA', 39], ['flow', 35], ['dry.', 32], ['y.', 12], ['AVAIL', 59], ['fl. av', 39]])], [('regression: non-joiner handling', [['fi', 'flow', 'shelf|life', 'LA', 'our', 'Yo'], 104], [['fi flow', 51], ['shelflife LA', 95], ['our Yo', 56]]), ('regression: non-joiner handling', [['wolf|like', 'Tofu', 'Yo', 'AVAIL', 'Wavy', 'Av'], 108], [['wolflike Tofu', 104], ['Yo AVAIL', 85], ['Wavy Av', 73]]), ('regression: non-joiner handling', [['fly.', 'LA|VALLE'], 52], [['fly.', 23], ['LAVALLE', 88]]), ('regression: non-joiner handling', [['Ta', 'raffle', 'VIA', 'LA|VALLE'], 66], [['Ta', 21], ['raffle', 46], ['VIA', 39], ['LAVALLE', 88]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('control layout', [['Wavy', 'fi', 'Av', 'LT'], 86], [['Wavy fi', 61], ['Av LT', 51]]), ('control layout', [['fi', 'y.', 'fly.', 'office'], 58], [['fi y. fly.', 56], ['office', 46]])]]
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 |
|---|---|---|---|
| non-joiner blocks ligature | [['shelflife', 64]] | [['shelflife', 64]] | Passed |
| regression: non-joiner handling | [['LA fl. av', 70], ['LAVALLE', 85], ['Vat Wavy', 77]] | [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]] | Failed |
| regression: non-joiner handling | [['LAVALLE LA', 116], ['y.', 12]] | [['LAVALLE LA', 119], ['y.', 12]] | Failed |
| regression: non-joiner handling | [['Tofu LAVALLE', 127], ['flow', 35]] | [['Tofu LAVALLE', 130], ['flow', 35]] | Failed |
| case-sensitive pair | [['Av av', 47]] | [['Av av', 47]] | Passed |
| ligature then period | [['fl. fi,', 35]] | [['fl. fi,', 35]] | Passed |
| control layout | [['fly. fi fl.', 59], ['av', 19]] | [['fly. fi fl.', 59], ['av', 19]] | Passed |
| control layout | [['LA VIA', 70]] | [['LA VIA', 70]] | Passed |
SHA-256 / 0f7951b0798e21a336c832729ab2c5d4cd40e344b8d0e910e33177b2d502f938
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
words, width = x
W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}
LIG = {'fi': 11, 'fl': 11, 'ff': 12}
KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}
SPACE = 5
def glyph(c):
return W.get(c, 13 if c.isupper() else 10)
def measure(w):
total, prev, i = 0, None, 0
while i < len(w):
if w[i] == '|':
prev = None
i += 1
continue
pair = w[i:i + 2]
if pair in LIG:
total += LIG[pair]
prev = None
i += 2
continue
g = w[i]
total += glyph(g)
if prev is not None:
total += KERN.get(prev + g, 0)
prev = g
i += 1
return total
def line_width(ws):
return sum(measure(t) for t in ws) + SPACE * (len(ws) - 1)
lines, cur = [], []
for w in words:
cand = cur + [w]
if not cur or line_width(cand) <= width:
cur = cand
else:
lines.append(cur)
cur = [w]
if cur:
lines.append(cur)
return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: non-joiner handling', [['LA', 'fl.', 'av', 'LA|VALLE', 'Vat', 'Wavy'], 112], [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]]), ('regression: non-joiner handling', [['LA|VALLE', 'LA', 'y.'], 128], [['LAVALLE LA', 119], ['y.', 12]]), ('regression: non-joiner handling', [['Tofu', 'LA|VALLE', 'flow'], 134], [['Tofu LAVALLE', 130], ['flow', 35]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['fly.', 'fi', 'fl.', 'av'], 74], [['fly. fi fl.', 59], ['av', 19]]), ('control layout', [['LA', 'VIA'], 102], [['LA VIA', 70]])], [('regression: non-joiner handling', [['shelf|life', 'AVAIL', 'LA|VALLE', 'Wavy', 'Tofu', 'Vat', 'y.'], 131], [['shelflife AVAIL', 128], ['LAVALLE', 88], ['Wavy Tofu Vat', 119], ['y.', 12]]), ('regression: non-joiner handling', [['office', 'wolf|like', 'fl.', 'y.', 'fl.'], 72], [['office', 46], ['wolflike', 62], ['fl. y. fl.', 52]]), ('regression: non-joiner handling', [['office', 'LT', 'Wavy', 'AT', 'Vat', 'LA|VALLE', 'our'], 65], [['office', 46], ['LT', 23], ['Wavy', 45], ['AT Vat', 58], ['LAVALLE', 88], ['our', 30]]), ('regression: non-joiner handling', [['LA|VALLE', 'VIA', 'raffle', 'dry.'], 97], [['LAVALLE', 88], ['VIA raffle', 90], ['dry.', 32]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['fly.', 'flow', 'Wavy', 'av', 'LT'], 132], [['fly. flow Wavy', 113], ['av LT', 47]]), ('control layout', [['LA', 'office', 'fl.', 'VIA', 'LA'], 96], [['LA office', 77], ['fl. VIA LA', 90]])], [('regression: non-joiner handling', [['LA|VALLE', 'fl.'], 138], [['LAVALLE fl.', 108]]), ('regression: non-joiner handling', [['LA', 'fl.', 'av', 'LA|VALLE', 'Vat', 'Wavy'], 112], [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]]), ('regression: non-joiner handling', [['LA|VALLE', 'shelf|life', 'office', 'AT', 'wolf|like'], 116], [['LAVALLE', 88], ['shelflife office', 115], ['AT wolflike', 93]]), ('regression: non-joiner handling', [['Yo', 'LA|VALLE', 'Tofu', 'Ta', 'Av'], 56], [['Yo', 21], ['LAVALLE', 88], ['Tofu', 37], ['Ta Av', 49]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['our', 'av', 'AT', 'Yo'], 92], [['our av AT', 85], ['Yo', 21]]), ('control layout', [['fl.', 'Yo', 'Tofu'], 112], [['fl. Yo Tofu', 83]])], [('regression: non-joiner handling', [['LA|VALLE', 'office', 'raffle', 'LA', 'staff.'], 129], [['LAVALLE', 88], ['office raffle LA', 128], ['staff.', 42]]), ('regression: non-joiner handling', [['flow', 'shelf|life', 'Wavy', 'AVAIL', 'dry.'], 88], [['flow', 35], ['shelflife', 64], ['Wavy', 45], ['AVAIL', 59], ['dry.', 32]]), ('regression: non-joiner handling', [['LA|VALLE', 'flow', 'y.', 'dry.', 'AVAIL', 'LA'], 106], [['LAVALLE', 88], ['flow y. dry.', 89], ['AVAIL LA', 90]]), ('regression: non-joiner handling', [['LA|VALLE', 'shelf|life'], 127], [['LAVALLE', 88], ['shelflife', 64]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['AT', 'raffle', 'Wavy', 'Vat', 'AT', 'dry.', 'AVAIL'], 98], [['AT raffle', 77], ['Wavy Vat', 77], ['AT dry.', 63], ['AVAIL', 59]]), ('control layout', [['VIA', 'flow', 'dry.', 'y.', 'AVAIL', 'fl.', 'av'], 42], [['VIA', 39], ['flow', 35], ['dry.', 32], ['y.', 12], ['AVAIL', 59], ['fl. av', 39]])], [('regression: non-joiner handling', [['fi', 'flow', 'shelf|life', 'LA', 'our', 'Yo'], 104], [['fi flow', 51], ['shelflife LA', 95], ['our Yo', 56]]), ('regression: non-joiner handling', [['wolf|like', 'Tofu', 'Yo', 'AVAIL', 'Wavy', 'Av'], 108], [['wolflike Tofu', 104], ['Yo AVAIL', 85], ['Wavy Av', 73]]), ('regression: non-joiner handling', [['fly.', 'LA|VALLE'], 52], [['fly.', 23], ['LAVALLE', 88]]), ('regression: non-joiner handling', [['Ta', 'raffle', 'VIA', 'LA|VALLE'], 66], [['Ta', 21], ['raffle', 46], ['VIA', 39], ['LAVALLE', 88]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('control layout', [['Wavy', 'fi', 'Av', 'LT'], 86], [['Wavy fi', 61], ['Av LT', 51]]), ('control layout', [['fi', 'y.', 'fly.', 'office'], 58], [['fi y. fly.', 56], ['office', 46]])]]
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 |
|---|---|---|---|
| non-joiner blocks ligature | [['shelflife', 64]] | [['shelflife', 64]] | Passed |
| regression: non-joiner handling | [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]] | [['LA fl. av', 70], ['LAVALLE', 88], ['Vat Wavy', 77]] | Passed |
| regression: non-joiner handling | [['LAVALLE LA', 119], ['y.', 12]] | [['LAVALLE LA', 119], ['y.', 12]] | Passed |
| regression: non-joiner handling | [['Tofu LAVALLE', 130], ['flow', 35]] | [['Tofu LAVALLE', 130], ['flow', 35]] | Passed |
| case-sensitive pair | [['Av av', 47]] | [['Av av', 47]] | Passed |
| ligature then period | [['fl. fi,', 35]] | [['fl. fi,', 35]] | Passed |
| control layout | [['fly. fi fl.', 59], ['av', 19]] | [['fly. fi fl.', 59], ['av', 19]] | Passed |
| control layout | [['LA VIA', 70]] | [['LA VIA', 70]] | Passed |
SHA-256 / fd9d208b6b3f2a68b9a04de47ddf6443f3c9a74bae6579055f2b77f2abbb05ce
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:51.554503+00:00.
Case digest / 4668a507428cfb3d7b5391aa4521aedd95d7a79add2b5455d1c6b570982b5cd7