Feature request: mapping colors to different fonts #4351
Unanswered
geofft
asked this question in
Feature Requests, Ideas
Replies: 1 comment 1 reply
-
Would setting NO_COLOR=1 help at all? See: https://no-color.org/ |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a monochrome e-ink screen, which is great for use in bright sunlight, but makes it hard to use applications with syntax highlighting or other use of multiple colors. While the screen does support grayscale, it's hard to visually distinguish more than one or maybe two levels of gray in isolation. (Also the physical refresh rate is lower with grayscale enabled.)
So, I'd like to get my terminal emulator to render the ANSI colors by using distinct fonts/styles instead of color. I can probably distinguish 8-16 unique combinations of typefaces (serif vs. sans, a font with noticeably different x-height, particularly distinctive or novelty fonts, etc.) and styles (small caps, weight, etc.) which would make syntax highlighting usable on a monochrome display. I see that Ghostty already supports rendering multiple fonts via codepoint range, so this seems feasible in theory, though from a quick look at the code it doesn't seem like color info gets plumbed through to font selection, I think.
(While one potential answer is to define a new escape sequence to request a particular font and teach my text editor to use it, there are a lot of apps that use color for output—
grep,git,ls, etc.—and I'd like all of them to support this feature, because I can't see colors at all on my e-ink screen. A color-to-font remapping feature would make everything work out of the box.)Would you be open to this feature? I'd be happy to contribute code for it, though I'd probably need a couple of pointers about how to best structure this change. (I'm in the Discord and happy to chat there.)
Here's a very quick mockup of what it might look like done with CSS and a relatively random choice of fonts:

This is mapping yellow to Recursive mono + casual, red to Doto, and green to Courier Prime, which all have similar enough metrics to JetBrains Mono that the grid works (a full implementation would need to force the metrics to match the primary font exactly).
Beta Was this translation helpful? Give feedback.
All reactions