Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emojis on the terminal #73

Closed
thorerik opened this issue May 7, 2017 · 19 comments
Closed

Emojis on the terminal #73

thorerik opened this issue May 7, 2017 · 19 comments

Comments

@thorerik
Copy link

thorerik commented May 7, 2017

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:
image

In Kitty however, it turns into some odd things:
image

this might be somewhat related to #50 as far as my understanding goes.

@kovidgoyal
Copy link
Owner

kovidgoyal commented May 8, 2017

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:
screenshot_20170508_080615

So what version of kitty and what operating system is this?

@kovidgoyal
Copy link
Owner

kovidgoyal commented May 8, 2017

And just for completeness here is what both those emoji's pluss some surrounding text look like:

screenshot_20170508_080944

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:

screenshot_20170508_081227

which shows perfectly render two character emoji's with no artifacts whatsoever.

This is on a linux (Arch system).

@kovidgoyal
Copy link
Owner

Closing, no followup

@dkasak
Copy link

dkasak commented Nov 5, 2017

Is support for colour fonts planned in the future?

@kovidgoyal
Copy link
Owner

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.

@kovidgoyal
Copy link
Owner

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.

@spacekookie
Copy link

@kovidgoyal Has there been any development on this? Any way people can help out? Gotta have my coloured twitter emoji ❤️ in my hostname 😬

@maximbaz
Copy link
Contributor

Works for me:

image

@spacekookie
Copy link

@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? 😬

@maximbaz
Copy link
Contributor

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.

@spacekookie
Copy link

@maximbaz Ah, thanks, that kitty version in the picture was being overshadowed by the unicorn 😅 😂

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

@esn89
Copy link

esn89 commented Feb 21, 2019

@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?

@maximbaz
Copy link
Contributor

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.

@merlinND
Copy link

Just a quick note that on Ubuntu 18.10, emojis displayed correctly in Kitty after installing the emojione package:

sudo apt install fonts-emojione

@insidewhy
Copy link

ttf-joypixels replaces ttf-emojione on arch for anyone looking.

@Cassianokunsch
Copy link

Anybody can help me, i have deepin terminal, but the emoji don't get color look...
Captura de Tela_Área de Seleção_20190725130829

@Luflosi
Copy link
Contributor

Luflosi commented Jul 25, 2019

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.

@amishbni
Copy link

amishbni commented Jan 6, 2020

On Arch, installing ttf-twemoji worked for me.

@abluedot
Copy link

abluedot commented Mar 4, 2021

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! 📣

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

No branches or pull requests

13 participants