Closed thorerik closed 7 years ago
Emoji's (techincally all unicode single character glyphs) render fine in kitty, provided two things:
1) The system wcwidth() is new enough to return the character cell width for the emojis 2) The font you have specified for kitty support emojis, or you specify a different font in the config for the emoji unicode range. While kitty does use fallback fonts when the specified font does not have glyphs for a character, it is best to explicitly use the font you like for emojis rather than relying on the fallback mechanism, which is fairly opaque.
The only caveat is that currently color fonts are not supported. Looking at your screenshot, that does not look like an emoji problem but more a character encoding problem.
For exampl, in kitty on my system:
So what version of kitty and what operating system is this?
And just for completeness here is what both those emoji's pluss some surrounding text look like:
As you can see, they are rendered perfectly, with no cutoff parts, in exactly one character cell, because wcwidth() on my system returns one for them. Using
kitty -o use_system_wcwidth=no
which tells kitty to use its internal modern wcwidth(), it look like:
which shows perfectly render two character emoji's with no artifacts whatsoever.
This is on a linux (Arch system).
Closing, no followup
Is support for colour fonts planned in the future?
It's not on my TODO list. It will be somewhat awkward because the rendering sytem in kitty assumes text is in the form of 8bpp alpha masks. You'd probably have to create a separate texture array on the GPU to store colored characters and put in a conditional into the shader to use that store. I generally try to avoid conditionals in shaders as they are often performance bottlenecks. And then there is the limitation that the cell structure in kitty only allows at most two combining unicode marks. Choosing shades requires upto 5. So you'd have to add at least another 12 bytes to the size of the cell structure. All this decreases performance in the general case for what is a not very compelling feature, IMO.
Still I am not adamantly opposed. If someone were to come up with a patch and show that its impact on performance is minimal, I would be willing to merge.
Well I decided to implement color emoji. With some work I could get the performance impact to be mimimal and I just decided to ignore the shades. Implementation is in the color branch.
@kovidgoyal Has there been any development on this? Any way people can help out? Gotta have my coloured twitter emoji :heart: in my hostname :grimacing:
Works for me:
@maximbaz Hmm, with what version is that? And if I'm already on the right version, I guess I have my fonts not setup correctly? I have emoji installed on my system (Arch Linux) but I'm not sure what else I have to do (like specify a font for the range?)
Also, what emoji set is that? :grimacing:
kitty is of version 0.11.1
as you can see on the screenshot 😉 The emoji set is EmojiOne, since you are on Arch, you can use my AUR package ttf-emojione — in addition to installing the font files it will also add the proper fontconfig. I don't have any other configuration on my system besides what I put in that AUR package.
@maximbaz Ah, thanks, that kitty version in the picture was being overshadowed by the unicorn :sweat_smile: :joy:
I got it to work now, although I'm now having some other (unrelated) issues, to do with how my shell (fish) handles emoji width
@maximbaz
Did you just have to install that font in Arch and that's it? Or do you need to do some settings in kitty.conf?
Install font and configure fontconfig, the Arch package comes with the config 75-emojione.conf, so all you need to do is to run
ln -sf ../conf.avail/75-emojione.conf /etc/fonts/conf.d/75-emojione.conf
No changes to kitty.conf after that, having fontconfig makes emoji appear properly in all apps.
Just a quick note that on Ubuntu 18.10, emojis displayed correctly in Kitty after installing the emojione package:
sudo apt install fonts-emojione
ttf-joypixels replaces ttf-emojione on arch for anyone looking.
Anybody can help me, i have deepin terminal, but the emoji don't get color look...
kitty has nothing to do with the deepin terminal. If you want to report an issue for the deepin terminal, you should do that in the repo https://github.com/linuxdeepin/deepin-terminal since their bug tracker https://bugzilla.deepin.io/describecomponents.cgi?product=深度终端 seems to be unreachable.
On Arch, installing ttf-twemoji
worked for me.
The new font-package on AUR is now ttf-joypixels which replaced ttf-emojione.
It works well and looks great with Kitty. Thanks. Finally emojis in emacs without a hassle! 📣
Might be way out of scope for the project, so feel free to close this issue.
I got a small curveball for a lot of terminal emulators: my mac has a user named 🐈 and hostname 😇.
Most terminals are able to at least somewhat deal with it:
In Kitty however, it turns into some odd things:
this might be somewhat related to #50 as far as my understanding goes.