From 17fde29ef607e1cd4494bef4bbf6fe4623ec8722 Mon Sep 17 00:00:00 2001 From: Joe Lothan Date: Mon, 15 Jun 2026 19:31:20 -0400 Subject: [PATCH] better margins / gaps --- print_tape.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/print_tape.py b/print_tape.py index c9dfc4a..6bfc018 100644 --- a/print_tape.py +++ b/print_tape.py @@ -20,7 +20,11 @@ from glyphs import price_to_fraction, upload_fractions # so 512 printable dots / 24 = 21 chars fit across the 80mm paper width. LINE_WIDTH = 21 NUM_COLUMNS = 4 -COL_WIDTH = LINE_WIDTH // NUM_COLUMNS # 5 +COL_WIDTH = 4 +EDGE = 1 # 1-char margin on each edge +GAP = 1 # 1-char gap between columns +# Layout: edge(1) + col(4) + gap(1) + col(4) + gap(1) + col(4) + gap(1) + col(4) + edge(1) = 21 +COL_STARTS = [EDGE + i * (COL_WIDTH + GAP) for i in range(NUM_COLUMNS)] def format_price(lots, price): @@ -76,7 +80,7 @@ def print_all(p, trades): for row_idx in range(max_len): row = [" "] * LINE_WIDTH for col_idx in range(NUM_COLUMNS): - col_start = col_idx * COL_WIDTH + col_start = COL_STARTS[col_idx] if row_idx < len(col_chars[col_idx]): entry = col_chars[col_idx][row_idx] if entry[0] == "top":