Commit Graph

8 Commits

Author SHA1 Message Date
EugeneTes
36eab4b4b2 fix ESC * bit-image banding: match line spacing to the slice height
The POS895 logo printed with a white line under every band. Root cause is
in PrintImageBitModeAsync, not in the adapter: between slices it advances
with a bare LF, which moves the paper by the CURRENT line spacing rather
than by the slice height. ESC @ leaves that spacing at 1/6 inch, about
33.8 dots at 203 dpi, so each pass painted 24 dot rows and then advanced
~34, leaving a ~10 dot gap. The code assumed LF advances exactly one
slice; nothing ever made that true.

Confirmed on hardware before changing anything: printed two identical
solid 576x96 blocks, one at default spacing and one after ESC 3 24. The
first came out striped, the second solid.

Fixed by setting the spacing to the slice height for the duration of the
image and restoring the default in a finally. The restore matters as much
as the fix - leaving it at 24 would compress every following line of text,
turning a logo defect into a whole-receipt one.

Fixed here rather than in POS895 because the assumption is wrong for any
caller of this method. Blast radius is nil: PrintImageBitModeAsync has no
other production consumer, since TM_T30IIITranslated uses the raster path
and TM_U220IITranslated.PrintImageAsync is an empty stub.

Three regression tests drive a real EpsonPrinter against a loopback TCP
listener and assert on the wire bytes: ESC 3 <sliceHeight> before the
first ESC *, ESC 2 after the last, and the spacing tracking the mode
(ESC 3 8 for 8-dot) rather than a hardcoded 24. All three failed before
the fix.

Verified on the printer: the logo now prints solid.

Claude-Session: https://claude.ai/code/session_01E6N3P4nSZLtp4BC2LXVref
2026-09-03 14:11:17 +02:00
EugeneTes
5ee95c8109 1.0.12 2026-04-03 08:38:32 +02:00
EugeneTes
f0ae32c9e5 fallback support 2026-02-05 09:31:38 +01:00
EugeneTes
1125222cbe new receipt formats 2026-01-26 14:29:37 +01:00
EugeneTes
729679d283 experiments for the new client 2026-01-21 11:59:13 +01:00
EugeneTes
cb231801f1 tm220 print mode refactoring 2026-01-21 09:19:24 +01:00
EugeneTes
147265358f kitchen receipt + html printer 2026-01-14 11:47:43 +01:00
EugeneTes
7390693f50 Add project files. 2026-01-13 09:06:47 +01:00