From 4c3a118d2e53c80c82e22180fb9a55ee7bc70938 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 3 Oct 2026 08:59:50 +0000 Subject: [PATCH] UPG100 poster header: scripture references stay whole; the classic header drops bold markers - A scripture reference never breaks between its book and its chapter:verse in the header's text columns ("Mark 6:40"); before, two zones printed "(Mark" at a line's end and "6:40)." on the next. - (With the parent commit: the three header columns end at about the same height. The facts column widens when it runs long, the side columns stay equal and mirrored; across the 28 zones the height spread drops from 99 to 72 px, mean 54 to 34.) --- library/packet/poster-render.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/packet/poster-render.js b/library/packet/poster-render.js index c70adf5f8..44c2a2827 100644 --- a/library/packet/poster-render.js +++ b/library/packet/poster-render.js @@ -860,6 +860,9 @@ function boldLines(text, width) { for (let i = 0; i < part.length; i++) { plain += part[i]; bold.push(on); } // per UTF-16 unit, as plain[p] reads on = !on; } + // A scripture reference never breaks between its book and its chapter:verse ("Mark 6:40"): that space becomes a + // placeholder for the wrap and prints as a space again. One character for one, so the bold flags stay aligned. + plain = plain.replace(/([A-Za-z]+) (\d+:\d+)/g, '$1\u0001$2'); let p = 0; return wrapPx(plain, HC.fs, width).map((ln) => { while (plain[p] === ' ') p++; @@ -867,7 +870,7 @@ function boldLines(text, width) { const flush = () => { if (run) out += runBold ? `${esc(run)}` : esc(run); run = ''; }; for (let k = 0; k < ln.length; k++, p++) { if (bold[p] !== runBold) { flush(); runBold = bold[p]; } - run += plain[p]; + run += plain[p] === '\u0001' ? ' ' : plain[p]; } flush(); return out;