Add box, rule and kv blocks, text folding and receipt preview
Security / Vulnerability check (push) Successful in 50s
Test / Lint and test (push) Successful in 1m59s

Phase 1 of docs/plans/formatters.md: single and double CP437 boxes from
one /print element, and a way to see a receipt without using paper.

- receipt: box, rule and kv elements, laid out when the job renders from
  the printer profile, size and font (never fixed widths). Boxes take a
  title (inline or capped), a footer, padding, fit and columns, and a
  body of text or children (text, feed, kv, and rules as dividers joined
  to the borders). Glyphs a code page lacks fall back per set: double-h
  and double-v to double, then single, then ascii; a missing junction
  switches line weight first.
- Validation names nested elements (elements[0].children[3] (qr)),
  checks fields per block type, allows one level of children and counts
  them toward the 500-element limit. Block fields on the older types are
  problems, as they were unknown fields before.
- Text is composed to NFC and characters the code page lacks fold to
  look-alikes (curly quotes, dashes, ellipsis, arrows, check marks, euro,
  trademark), as the owner approved on 2026-11-29. An emoji sequence
  prints as one '?'. Encodable text is untouched.
- escpos: CodePage.CanEncode and Decode, and Interpret, which reads a
  command stream back as the printer would print it. It takes the
  profile so that it can follow the printer's own wrapping and
  alignment; raw spans stay opaque.
- POST /api/v1/preview and `uberbringer preview` show the lines a job
  prints, as text or JSON with styles, without fetching images.
- Config: [format] max_lines (default 2000), refused with 422
  too_many_lines on preview; printer.box_line_spacing (default 0).

Byte compatibility: testdata/compat fixtures were rendered by 9b91109
before the renderer changed, and still match it and the new renderer.
examples/blocks.json was printed on the TM-T88IV; the owner judged the
border gaps at the default spacing fine (2026-11-30), so
box_line_spacing stays 0, and TestPaperReceipts pins its bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-30 00:49:45 -06:00
1 parent 9fdea32b4f
commit 4562f0cebb
109 files changed
+6383 -487

No files matched your search

+121
View File
@@ -0,0 +1,121 @@
1b401b74001b61011b4d001d21111b45011b2d001d4200426c6f636b2063616c
6962726174696f6e0a1b45001b2d001d42001d21001b4d001b61011b4d011d21
001b45001b2d001d42004c6f6f6b206174207468652067617073206265747765
656e20746865206c696e6573206f662074686520766572746963616c0a626f72
646572732c20616e642061742074686520636f726e65727320616e64206a756e
6374696f6e732e0a1b45001b2d001d42001d21001b4d001b64011b61001b4d00
1d21001b45001b2d001d4200c4c42072756c657320c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c40a1b45001b2d001d4200
1d21001b4d001b61001b4d001d21001b45001b2d001d4200c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c40a1b45001b2d001d42001d21001b4d001b61001b4d001d21001b45001b2d
001d4200cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcd0a1b45001b2d001d42001d21001b4d001b61
001b4d001d21001b45001b2d001d4200b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0
b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b00a1b45001b2d
001d42001d21001b4d001b61001b4d001d21001b45001b2d001d4200b1b1b1b1
b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1
b1b1b1b1b1b10a1b45001b2d001d42001d21001b4d001b61001b4d001d21001b
45001b2d001d4200b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2
b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b20a1b45001b2d001d42001d21001b
4d001b61001b4d001d21001b45001b2d001d4200dbdbdbdbdbdbdbdbdbdbdbdb
dbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdb0a1b
45001b2d001d42001d21001b4d001b61001b4d001d21001b45001b2d001d4200
2d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d20
2d202d202d202d202d200a1b45001b2d001d42001d21001b4d001b61001b4d00
1d21001b45001b2d001d4200fafafafafafafafafafafafafafafafafafafafa
fafafafafafafafafafafafafafafafafafafafafafa0a1b45001b2d001d4200
1d21001b4d001b61001b4d001d21001b45001b2d001d42002d2d2d2d2d2d2d2d
2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d
2d2d0a1b45001b2d001d42001d21001b4d001b61001b4d001d21001b45001b2d
001d4200cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd201b4501544f54414c1b45
0020cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd0a1b45001b2d001d42001d21
001b4d001b64011b61001b4d001d21001b45001b2d001d4200dac42073696e67
6c6520c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4bf0ab320496e6c696e65207469746c652c2070616464696e6720312e2020
20202020202020202020202020b30ac3c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4b40ab32041207369
6e676c6520646976696465722061626f76652c206120646f75626c65206f6e65
202020b30ab32062656c6f772e20202020202020202020202020202020202020
2020202020202020202020202020b30ac6cdcd20646f75626c65206469766964
657220cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdb50ab320486f73
74202e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e206e61
73303120b30ab3201b4501557365641b4500202e2e2e2e2e2e2e2e2e2e2e2e2e
2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e201b45013934251b450020b30ac0c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4d90a1b45001b2d001d42001d21001b4d001b61001b4d001d2100
1b45001b2d001d4200c9cdb52041434854554e4720c6cdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdbb0aba2054686520636f66666565
206d616368696e65206973206265696e672064657363616c65642e2020ba0aba
2020202020202020446f206e6f742075736520756e74696c2031303a33302e20
2020202020202020ba0ac8cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdbc0a1b45001b2d001d42001d21
001b4d001b61001b4d001d21001b45001b2d001d4200c9cd20646f75626c6520
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdbb
0aba2053696e676c6520646976696465723a2020202020202020202020202020
20202020202020202020ba0ac7c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4b60aba20446f75626c6520
646976696465723a202020202020202020202020202020202020202020202020
ba0acccdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdb90aba202020202020202020202020202020202020
2020202020202020466f6f7465722062656c6f772e20ba0ac8cdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd203239204e6f762032313a303420cd
cdbc0a1b45001b2d001d42001d21001b4d001b61001b4d001d21001b45001b2d
001d4200d5cdb520646f75626c652d6820c6cdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdb80ab320446f75626c6520686f72697a6f6e74
616c2c2073696e676c6520766572746963616c2020202020b30ab3206c696e65
732e202020202020202020202020202020202020202020202020202020202020
202020b30ac6cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcdb50ab3202020202020202020202020202020
202020456e642e202020202020202020202020202020202020b30ad4cdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdbe0a1b45001b2d001d42001d21001b4d001b61001b4d001d21001b45
001b2d001d4200d6c420646f75626c652d7620c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4b70aba2053696e676c6520686f72697a
6f6e74616c2c20646f75626c6520766572746963616c2020202020ba0aba206c
696e65732e202020202020202020202020202020202020202020202020202020
202020202020ba0ac7c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4b60aba202020202020202020202020
202020202020456e642e202020202020202020202020202020202020ba0ad3c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4bd0a1b45001b2d001d42001d21001b4d001b61001b4d001d21
001b45001b2d001d42002b2d206173636969202d2d2d2d2d2d2d2d2d2d2d2d2d
2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2b0a7c20506c61696e20415343
494920666f7220636f646520706167657320776974686f757420626f78207c0a
7c2064726177696e672e20202020202020202020202020202020202020202020
2020202020202020207c0a2b2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d
2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2b0a1b45001b2d001d42001d
21001b4d001b64011b61001b4d001d21001b45001b2d001d4200202020202020
202020202020202020dac4c4c4c4c4c4c4c4c4bf0a2020202020202020202020
20202020b370616464696e672030b30a202020202020202020202020202020c0
c4c4c4c4c4c4c4c4c4d90a1b45001b2d001d42001d21001b4d001b61001b4d00
1d21001b45001b2d001d42002020202020202020202020202020dac4c4c4c4c4
c4c4c4c4c4c4bf0a2020202020202020202020202020b32070616464696e6720
3120b30a2020202020202020202020202020c0c4c4c4c4c4c4c4c4c4c4c4d90a
1b45001b2d001d42001d21001b4d001b61001b4d001d21001b45001b2d001d42
0020202020202020202020202020c9cdcdcdcdcdcdcdcdcdcdcdcdcdbb0a2020
2020202020202020202020ba202070616464696e6720322020ba0a2020202020
2020202020202020c8cdcdcdcdcdcdcdcdcdcdcdcdcdbc0a1b45001b2d001d42
001d21001b4d001b61001b4d001d21001b45001b2d001d420020202020202020
2020dac4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4bf0a202020202020
202020b32020202121212041434854554e4720212121202020b30a2020202020
20202020c0c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4d90a1b45001b
2d001d42001d21001b4d001b64011b61001b4d001d21111b45001b2d001d4200
dac42073697a65203220c4c4c4c4c4c4c4c4c4c4bf0ab3205477656e74792d6f
6e652020202020202020b30ab320636f6c756d6e732e20202020202020202020
b30ac0c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4d90a1b45001b2d001d42
001d21001b4d001b61001b4d001d21221b45001b2d001d42002020c9cdcdcdcd
cdcdcdcdbb0a2020ba2073697a65203320ba0a2020c8cdcdcdcdcdcdcdcdbc0a
1b45001b2d001d42001d21001b4d001b61001b4d011d21001b45001b2d001d42
00dac420666f6e74206220c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4bf0ab320466f6e74
2042206973206e6172726f77657220616e642073686f727465722c20736f2069
747320626f726465727320736974202020b30ab320636c6f73657220746f6765
746865722e202020202020202020202020202020202020202020202020202020
20202020202020202020b30ac0c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4
c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c4c420353620636f6c756d6e73
20c4c4d90a1b45001b2d001d42001d21001b4d001b61001b4d011d21111b4500
1b2d001d42002020202020c9cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdbb0a2020
202020ba20666f6e7420622c2073697a65203220ba0a2020202020c8cdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdbc0a1b45001b2d001d42001d21001b4d001d5642
00