attribute changes

10 views
Skip to first unread message

Elliott Hughes

unread,
Feb 10, 2019, 9:59:49 PM2/10/19
to terminat...@googlegroups.com
i committed a few changes this weekend that will have visible effects:

* bold is now real bold font, not just overstrike
* we now also resolve the spec's bold/bright ambiguity by using brighter colors as well as a bold font, as do most other terminal emulators  (the bold parts of top(1)'s output now stand out a lot more than they did, for example)
* italic is now supported (though you won't see this many places `man man` for example talks about italic text but shows underlined text and explicitly says that it won't show up as actual italics)
* dim/faint is now supported (the first place i ever knowingly saw this is lldb's prompt)
* strikethrough is now supported (i don't think i've ever seen this in real use)
* hidden is now supported (though why it even exists is beyond me)
* these attributes combine in the usual ways, so you can have "dim bold" (which looks like our bold used to) or "bold italic strikethrough" or whatever

the demo at https://github.com/tartley/colorama is pretty good for seeing dim vs normal vs bright.

i've not added any caching and just directly use Color.brighter/Color.darker for bright and dim, and Font.deriveFont for bold/italic/bold+italic whenever i'm painting those attributes. that seems fine on my machine, for the tests i ran, but let me know if you see performance issues because of this.

i've simply removed the old "overstrike bold" code, since Apple's Monaco was replaced as the default monospace font by Menlo in 2009 and does have bold/italic, as do Ubuntu Mono and Roboto Mono, and the internets claim that Windows' Consolas does too. until i hear that someone really really needs overstrike support back, i'm assuming that the fonts we're all using have moved on. (if someone were to say "Consolas' variants have wildly incompatible metrics", say, that would definitely warrant another checkbox in the preferences. but i'm assuming that the world we live in isn't _that_ silly.)

i haven't implemented double underline or wavy underline because even xterm doesn't seem to support them yet (though, thanks to libvte, just about everything else seems to). likewise the escapes to give underlines a different color from the text foreground/background (which would increase the size of every Style object).

--
Reply all
Reply to author
Forward
0 new messages