Skip to content

Draw text as ASCII art in the Omarchy logo font - #8037

Merged
dhh merged 2 commits into
quattrofrom
omarchy-ascii
Aug 24, 2026
Merged

dhh merged 2 commits into
quattrofrom
omarchy-ascii

Conversation

@omarchybot

@omarchybot omarchybot commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

omarchy ascii draws text in Delta Corps Priest 1, the FIGlet font the Omarchy wordmark itself is drawn in, so branding art can be words rather than a picture:

omarchy ascii "Back in five" > ~/.config/omarchy/branding/screensaver.txt

It takes the text as arguments or reads it from a pipe when given none, draws each input line as its own block — including a blank line, which keeps the gap someone put there — and trims trailing blanks so the output drops straight into a file.

The font is embedded in the script and the layout is done in awk, so the command adds nothing to the default package set. figlet would be a package plus a font it does not ship, for a command whose whole job is one font.

The layout runs on one-byte stand-ins for the five block characters the font draws with. Column arithmetic over the characters themselves counts bytes under LC_ALL=C and characters under a UTF-8 locale, which puts the kerning a column out in one of them; the stand-ins keep length() and substr() counting columns either way. A row is held without its trailing blanks, counted separately, so placing a glyph costs its own width rather than the width of the art so far — the difference between a tenth of a second and forty-six on a four-thousand-character line.

The output is identical to figlet.js's for every letter, all 2,704 letter pairs, and the spacing cases between them.

Three consequences worth naming rather than fixing.

Delta Corps Priest 1 carries letters and spaces only: every mirror of it ships the same file with the digit and punctuation glyphs empty, so omarchy ascii "Omarchy 4.0" draws the word and nothing more. The dropped characters are named on stderr, and text with nothing drawable at all exits 1 rather than printing silence, because a version number that vanishes quietly reads as a bug in the renderer.

figlet.js and figlet.c disagree about a first M or m: the C one fits the glyph against the empty line and so trims the column of blanks every row of it shares, the JavaScript one keeps it. asciiart.eu runs figlet.js, so this follows figlet.js, and a test pins that M — the wordmark starts with an O, which shares no such column and so cannot catch the difference.

logo.txt is not this font's output. It is the same design tightened by hand — one column narrower in each stem gap, 81×10 where the font itself renders 88×9, and a different top on the m — so omarchy ascii Omarchy does not reproduce it. Nothing was changed to make them agree, because that is a decision about the wordmark rather than about this command.

Renders text as ASCII art in Delta Corps Priest 1, the FIGlet font the Omarchy wordmark itself is drawn in, so branding art can be words rather than a picture. The font is embedded in the script and the layout is done in awk, so the command adds nothing to the default package set.

The layout runs on one-byte stand-ins for the five block characters the font draws with. Column arithmetic over the characters themselves counts bytes in one locale and characters in another, and the stand-ins keep length() and substr() counting columns either way.

Delta Corps Priest 1 carries letters and spaces only, and every mirror of it ships the same file with the digit and punctuation glyphs empty. Anything else is dropped and named on stderr, and text with nothing drawable at all exits 1 rather than printing silence.

🤖 Generated by Opus 5 in Claude Code.
Copilot AI balanced review requested due to automatic review settings August 24, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds omarchy ascii for rendering text with the embedded Omarchy wordmark font.

Changes:

  • Implements the dependency-free AWK renderer.
  • Registers and documents the command.
  • Adds rendering and error-handling tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
bin/omarchy-ascii Adds the renderer and embedded font.
bin/omarchy Registers the ASCII command group.
manual/41-branding.md Documents text-based branding.
test/shell.d/ascii-test.sh Tests rendering and input behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The route never ran on piped text. The metadata declared `<text...>` as required, so `omarchy ascii` with nothing on the command line resolved to the router's help while `omarchy-ascii` run directly worked, which is why the tests missed it: they all called the binary. The argument is optional now, and a test goes through the route.

Text reached awk as a command-line variable, where awk reads backslash escapes of its own, so `omarchy ascii 'A\nB'` drew two blocks instead of naming the backslash as a character the font lacks. A text longer than the argument list could not be passed at all. It arrives as awk's input now, with the font on a descriptor of its own.

A line with nothing drawable printed nothing at all, so a blank line between two words closed the gap up rather than keeping it. Every line draws its block now, blank ones included, which is what figlet does with a newline.

Placing a glyph scanned and copied the whole width of the art so far, costing the square of the line's length: four thousand characters took forty-six seconds. A row is now held without its trailing blanks, counted separately instead, so a glyph costs its own width and those four thousand characters take a tenth of a second.

A skipped control character was named on stderr by writing it out, which sends it to the terminal as a control character; those are named by code now. An unknown option was drawn as art rather than refused, so a mistyped `--width 40` quietly rendered the word "width".

figlet.c trims the column of blanks that every row of an `M` shares when it is the first glyph on a line, and figlet.js keeps it. asciiart.eu runs figlet.js, so the rendering follows figlet.js and a test pins that `M`, because the wordmark alone does not catch the difference and the next reader would have no way to tell the choice from an oversight.

🤖 Generated by Opus 5 in Claude Code. Reviewed by Codex XHigh.

Co-Authored-By: Codex XHigh <[email protected]>
@dhh
dhh merged commit 4baae6b into quattro Aug 24, 2026
3 checks passed
@dhh
dhh deleted the omarchy-ascii branch August 24, 2026 15:58
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
* Add omarchy-ascii for drawing text in the logo font

Renders text as ASCII art in Delta Corps Priest 1, the FIGlet font the Omarchy wordmark itself is drawn in, so branding art can be words rather than a picture. The font is embedded in the script and the layout is done in awk, so the command adds nothing to the default package set.

The layout runs on one-byte stand-ins for the five block characters the font draws with. Column arithmetic over the characters themselves counts bytes in one locale and characters in another, and the stand-ins keep length() and substr() counting columns either way.

Delta Corps Priest 1 carries letters and spaces only, and every mirror of it ships the same file with the digit and punctuation glyphs empty. Anything else is dropped and named on stderr, and text with nothing drawable at all exits 1 rather than printing silence.

🤖 Generated by Opus 5 in Claude Code.

* Correct what the renderer did with input it could not draw

The route never ran on piped text. The metadata declared `<text...>` as required, so `omarchy ascii` with nothing on the command line resolved to the router's help while `omarchy-ascii` run directly worked, which is why the tests missed it: they all called the binary. The argument is optional now, and a test goes through the route.

Text reached awk as a command-line variable, where awk reads backslash escapes of its own, so `omarchy ascii 'A\nB'` drew two blocks instead of naming the backslash as a character the font lacks. A text longer than the argument list could not be passed at all. It arrives as awk's input now, with the font on a descriptor of its own.

A line with nothing drawable printed nothing at all, so a blank line between two words closed the gap up rather than keeping it. Every line draws its block now, blank ones included, which is what figlet does with a newline.

Placing a glyph scanned and copied the whole width of the art so far, costing the square of the line's length: four thousand characters took forty-six seconds. A row is now held without its trailing blanks, counted separately instead, so a glyph costs its own width and those four thousand characters take a tenth of a second.

A skipped control character was named on stderr by writing it out, which sends it to the terminal as a control character; those are named by code now. An unknown option was drawn as art rather than refused, so a mistyped `--width 40` quietly rendered the word "width".

figlet.c trims the column of blanks that every row of an `M` shares when it is the first glyph on a line, and figlet.js keeps it. asciiart.eu runs figlet.js, so the rendering follows figlet.js and a test pins that `M`, because the wordmark alone does not catch the difference and the next reader would have no way to tell the choice from an oversight.

🤖 Generated by Opus 5 in Claude Code. Reviewed by Codex XHigh.

Co-Authored-By: Codex XHigh <[email protected]>

---------

Co-authored-by: David Heinemeier Hansson <[email protected]>
Co-authored-by: Codex XHigh <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants