Wordmark: an .ans is CP437, and its newlines are not its rows

The extension is .ans now, not .ansi — the software that draws this stuff is
old and particular about 8.3 names, and .ans is what it expects to open.

The wide mark is a real ANSI-art export rather than something colour-logo.py
painted, which brings two DOS habits the loader had never met. Its blocks and
box-drawing are single bytes in codepage 437, so reading it as UTF-8 raised
instead of drawing; we try UTF-8 first and fall back, and the 53-column mark
keeps its own encoding either way. And an art editor drops the line break on a
row that fills the canvas, trusting the terminal to wrap it — so the file has
nine newlines for sixteen rows. The canvas width comes from the SAUCE record,
which is trimmed off in the same breath, being metadata and not art.

Re-breaking a wrapped row has to restate the colour across the seam: each row
becomes its own Text.from_ansi, so nothing carries state the way a terminal
does when it never stopped reading the one stream.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jean-Pierre MartineauandClaude Opus 5 committed 2026-08-25 01:04:53 -04:00
1 parent f870bff990
commit c439dec289
5 files changed
+98 -15

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@
"""Colour a plain-text wordmark into the pre-coloured ANSI the splash draws.
The art itself is hand-drawn and lives in ``meshterm/assets`` as a ``.txt``; this paints
it and writes the matching ``.ansi`` beside it, so the colour scheme is stated once here
it and writes the matching ``.ans`` beside it, so the colour scheme is stated once here
rather than re-typed into every escape sequence by hand.
python scripts/colour-logo.py # repaint every asset/*.txt
@@ -64,7 +64,7 @@ def main() -> None:
names = sys.argv[1:] or sorted(p.stem for p in ASSETS.glob("*.txt"))
for name in names:
source = ASSETS / f"{name}.txt"
target = ASSETS / f"{name}.ansi"
target = ASSETS / f"{name}.ans"
target.write_text(colour(source.read_text(encoding="utf-8")), encoding="utf-8")
print(f"{source.name} -> {target.name}")