-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi all,
After several months of hard work refactoring kitty internals extensively, I am excited to announce kitty now has the ability to let terminal programs display text in multiple font sizes. This is implemented in a backwards compatible way, using a new escape code that terminal programs can opt-in to use if they wish too.
This feature works with the existing cell based grid terminal, we now just have the concept of "multicell" characters (these are an extension of the existing way "wide" characters and Emoji are handled) a single character can now extend over a block of cells spanning multiple lines.
A screenshot showing seamless mixed multi-sized text
For a quickstart, some simple commands you can use to display sized text:
printf "\e]66;s=2;Double sized text\a\n\n"
printf "\e]66;s=3;Triple sized text\a\n\n\n"
printf "\e]66;n=1:d=2;Half sized text\a\n"
To use these commands you must either use kitty nightly or build and run kitty from source.
For more details on how the escape code works and the various features see the text-sizing-protocol.rst file. If anyone knows of a conflicting use of OSC 66 please do let know, the number can be easily changed at this point.
This protocol also robustly solves the long standing problem in the terminal ecosystem of determining the width in cells of a string by allowing the client program to simply inform the terminal of how many cells to render any particular piece of text in.
Finally, as a bonus treat, since I was refactoring rendering anyway, I implemented underline gaps for descenders. What this means is that underlines are now rendered with gaps or holes where the text has a descender below the baseline. This is the famous? skip ink CSS feature implemented in browsers. It can be controlled by a new option in kitty.conf called underline_exclusion.
Since text-sizing required extensive changes to kitty internals, I would appreciate testing from some of you that are willing to test beta software. Note that it causes an approx 10% performance penalty in throughput, this is unavoidable because of the extra bookkeeping to deal with multiline characters. But, I think the ability to use different font sizes is worth the tradeoff.
I am also looking for feedback on the protocol design itself, please read the spec document and comment. I am particularly interested in feedback from people implementing terminal programs where such a feature may be useful, to that end I am pinging some such people I know of, please excuse the noise: @rockorager @neurocyte @dankamongmen @justinmk @swsnr @benjajaja @aymanbagabas @mfontanini
Anyone else is of course welcome to comment as well. I dont know how much interest this feature will generate, in case it generates a lot, please remember I am only one person and I have limited bandwidth. I will try to respond to any and all serious comments and I am willing to entertain reasonable changes/additions to how this feature works, but please remember everything has tradeoffs and I may not judge every tradeoff to be worth it.