diff --git a/meshterm/assets/logo.txt b/meshterm/assets/logo.txt deleted file mode 100644 index 44640cc..0000000 --- a/meshterm/assets/logo.txt +++ /dev/null @@ -1,6 +0,0 @@ -███╗ ███╗███████╗███████╗██╗ ██╗████████╗███████╗██████╗ ███╗ ███╗ -████╗ ████║██╔════╝██╔════╝██║ ██║╚══██╔══╝██╔════╝██╔══██╗████╗ ████║ -██╔████╔██║█████╗ ███████╗███████║ ██║ █████╗ ██████╔╝██╔████╔██║ -██║╚██╔╝██║██╔══╝ ╚════██║██╔══██║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║ -██║ ╚═╝ ██║███████╗███████║██║ ██║ ██║ ███████╗██║ ██║██║ ╚═╝ ██║ -╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ \ No newline at end of file diff --git a/meshterm/assets/logo_53.ans b/meshterm/assets/logo_53.ans index 0f0912b..7b2207b 100644 Binary files a/meshterm/assets/logo_53.ans and b/meshterm/assets/logo_53.ans differ diff --git a/meshterm/assets/logo_53.txt b/meshterm/assets/logo_53.txt deleted file mode 100644 index fcfc56d..0000000 --- a/meshterm/assets/logo_53.txt +++ /dev/null @@ -1,6 +0,0 @@ -██╗ ██╗█████╗████╗██╗██╗██████╗█████╗█████╗ ██╗ ██╗ -███████║██╔══╝██╔═╝██║██║╚═██╔═╝██╔══╝██╔═██╗███████║ -██╔█╔██║████╗ ████╗█████║ ██║ ████╗ █████╔╝██╔█╔██║ -██║╚╝██║██╔═╝ ╚═██║██╔██║ ██║ ██╔═╝ ██╔═██╗██║╚╝██║ -██║ ██║█████╗████║██║██║ ██║ █████╗██║ ██║██║ ██║ -╚═╝ ╚═╝╚════╝╚═══╝╚═╝╚═╝ ╚═╝ ╚════╝╚═╝ ╚═╝╚═╝ ╚═╝ \ No newline at end of file diff --git a/meshterm/ui/logo.py b/meshterm/ui/logo.py index e36364f..aefaa41 100644 --- a/meshterm/ui/logo.py +++ b/meshterm/ui/logo.py @@ -2,18 +2,17 @@ The art itself lives in ``meshterm/assets`` as pre-coloured ``.ans`` files — the classic ANSI-art extension, kept short because the editors that draw this stuff are old and -particular about 8.3 names. A ``.txt`` beside one is its hand-drawn source for marks we -colour ourselves (``scripts/colour-logo.py`` paints one into the other); a mark drawn in -an ANSI-art editor arrives already finished and has no source but itself. Files are read -fresh on every call, so the wordmark can be re-styled by editing the art alone: no code -change and no restart of the design loop. +particular about 8.3 names. Each mark is drawn by hand in one of those editors and needs +no source but itself: there is nothing here that generates a wordmark, and nothing to +re-run after editing one. Files are read fresh on every call, so the mark can be re-styled +by editing the art alone: no code change and no restart of the design loop. Three things separate a real ``.ans`` from a text file with colour in it, and :func:`_rows` handles them all so the art stays authorable in the tools that drew it: * **Codepage 437.** The blocks and box-drawing (``█▓▒░`` and ``╔═╗``) are single bytes in - DOS's codepage, not UTF-8. We try UTF-8 first and fall back, so a mark we generated - ourselves and a mark exported from an art editor both read. + DOS's codepage, not UTF-8. We try UTF-8 first and fall back, so an older mark stored as + UTF-8 (the 53-column one still is) and one exported from an art editor both read. * **Auto-wrap.** An art editor omits the line break on a row that fills the canvas and lets the terminal wrap it, so the file's newlines are *not* the picture's rows. The canvas width comes from the SAUCE record on the end of the file — which has to be diff --git a/scripts/colour-logo.py b/scripts/colour-logo.py deleted file mode 100644 index 3042e2f..0000000 --- a/scripts/colour-logo.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 -"""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 ``.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 - python scripts/colour-logo.py logo_53 # just that one - -The scheme is a vertical ramp over the letter rows — white, yellow, light red, red, light -black, hottest at the top — with every box-drawing character (the drop shadow and the -letters' own bevels) in the light black regardless of its row. Each colour is chosen so the -PicoCalc console's 16-slot quantizer lands it on exactly one palette slot (15, 11, 9, 1, 8) -while it stays a warm fade in truecolour on the desktop; see ``theme._VT_SLOTS``. -""" - -from __future__ import annotations - -import sys -from pathlib import Path - -ASSETS = Path(__file__).resolve().parent.parent / "meshterm" / "assets" - -#: Letter-row colours, hottest first. A mark with more rows than this reuses the last one. -ROW_RGB = ("255;255;255", "251;217;80", "248;113;113", "185;28;28", "80;93;111") - -#: Every non-block character — the drop shadow and the bevels — takes this. -SHADOW_RGB = "80;93;111" - -#: The letter body. Everything else in the art is shadow. -BLOCK = "█" - - -def colour(art: str) -> str: - """Paint one plain-text wordmark, returning the pre-coloured ANSI.""" - lines = art.split("\n") - if lines and lines[-1] == "": - lines.pop() - out_lines = [] - for row, line in enumerate(lines): - hue = ROW_RGB[min(row, len(ROW_RGB) - 1)] - out, current = [], None - for ch in line: - if ch == " ": - if current is not None: - out.append("\x1b[0m") - current = None - out.append(" ") - continue - want = hue if ch == BLOCK else SHADOW_RGB - if want != current: - out.append(f"\x1b[38;2;{want}m") - current = want - out.append(ch) - if current is not None: - out.append("\x1b[0m") - out_lines.append("".join(out)) - return "\n".join(out_lines) + "\n" - - -def main() -> None: - """Repaint the named marks, or every ``.txt`` in the assets folder.""" - 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}.ans" - target.write_text(colour(source.read_text(encoding="utf-8")), encoding="utf-8") - print(f"{source.name} -> {target.name}") - - -if __name__ == "__main__": - main()