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>
34 lines
2.1 KiB
Plaintext
34 lines
2.1 KiB
Plaintext
1b401b74001b61001b4d001d21001b45001b2d001d42004c6f6e672070617261
|
|
677261706873207772617020617420776f726420626f756e6461726965730a66
|
|
6f72207468652070617065722077696474682c20736f206120776f7264206973
|
|
206e657665720a73706c6974206163726f73732074776f206c696e65732e2054
|
|
686579206b656570207772617070696e670a666f72206173206c6f6e67206173
|
|
207468657265206973207465787420746f207072696e742e0a1b45001b2d001d
|
|
42001d21001b4d001b61001b4d001d21111b45001b2d001d420053697a652074
|
|
776f2077726170732061740a68616c662074686520636f6c756d6e73206f660a
|
|
73697a65206f6e652c2077686963682069730a7477656e74792d6f6e65206865
|
|
72652e0a1b45001b2d001d42001d21001b4d001b61001b4d001d21221b45001b
|
|
2d001d420053697a652074687265650a77726170732061740a666f7572746565
|
|
6e0a636f6c756d6e732e0a1b45001b2d001d42001d21001b4d001b61001b4d01
|
|
1d21001b45001b2d001d4200466f6e74204220676574732066696674792d7369
|
|
7820636f6c756d6e73206f6e206120544d2d5438382c20736f20746869730a6c
|
|
6f6e676572206c696e65206f662074657874207772617073206c617465722074
|
|
68616e20466f6e74204120776f756c642e0a1b45001b2d001d42001d21001b4d
|
|
001b61001b4d001d21001b45001b2d001d420046697273742070617261677261
|
|
70682e0a5365636f6e64207061726167726170682061667465722061206e6577
|
|
6c696e652e0a0a20202020496e64656e74656420706172616772617068206166
|
|
746572206120626c616e6b206c696e650a6b656570732069747320696e64656e
|
|
746174696f6e207768656e206974207772617073206f6e746f0a6d6f7265206c
|
|
696e65732e0a1b45001b2d001d42001d21001b4d001b61001b4d001d21001b45
|
|
001b2d001d42007365650a68747470733a2f2f6578616d706c652e636f6d2f61
|
|
2f766572792f6c6f6e672f706174682f746861742f0a69732f6c6f6e6765722f
|
|
7468616e2f6f6e652f77686f6c652f6c696e652f6f662f7468652f7265636569
|
|
0a7074206f6b0a1b45001b2d001d42001d21001b4d001b61001b4d001d21001b
|
|
45001b2d001d4200616161612020202062626262202020747261696c696e6720
|
|
737061636573206174206120627265616b0a6172652064726f70706564202020
|
|
2020202020202020202020202020202020656e642020200a1b45001b2d001d42
|
|
001d21001b4d001b61011b4d001d21001b45001b2d001d420043656e74726564
|
|
207465787420616c736f20777261707320617420776f726420626f756e646172
|
|
6965730a616e642065616368206c696e652069732063656e7472656420627920
|
|
746865207072696e7465722e0a1b45001b2d001d42001d21001b4d001d564200
|