You are not logged in.

#1 2021-07-20 16:59:58

stee1rat
Member
Registered: 2013-10-22
Posts: 70

[SOLVED] Not all emojis are correct in alacritty terminal

I use

curl https://wttr.in/?format=2 

to test emojis.

For some reason in alacritty only some emijis are shown correctly (except the sun emoji):
Tue-Jul-20-07-54-06-PM-MSK-2021.png

In gnome terminal everything is correct:
Tue-Jul-20-07-54-46-PM-MSK-2021.png

Does anyone know what font gnome-terminal uses? Can someone recommend me a font to fix this problem?

My ~/.config/fontconfig/fonts.conf looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
</fontconfig>

Last edited by stee1rat (2021-07-21 19:52:09)

Offline

#2 2021-07-20 18:13:25

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] Not all emojis are correct in alacritty terminal

Edit: Should have scrolled down.

Show us your alacritty.yml.

Last edited by tucuxi (2021-07-20 18:15:02)

Offline

#3 2021-07-20 18:55:13

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: [SOLVED] Not all emojis are correct in alacritty terminal

I think my alacritty.xml is the default one: https://pastebin.com/BVdgiykh

Offline

#4 2021-07-20 20:30:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,647

Re: [SOLVED] Not all emojis are correct in alacritty terminal

gnome terminal looks like a bold variant?
What's

fc-match monospace

Offline

#5 2021-07-20 22:32:57

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: [SOLVED] Not all emojis are correct in alacritty terminal

I don't think its bolder. It just looks a little weird in dwm.

The output in both terminals is the same:

$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

$ fc-match emoji
NotoColorEmoji.ttf: "Noto Color Emoji" "Regular"

Offline

#6 2021-07-21 05:47:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,647

Re: [SOLVED] Not all emojis are correct in alacritty terminal

DejaVu Sans Mono has the Sun icon (u2600) but not the others.
Try to add

  <alias>
    <family>DejaVu Sans Mono</family>
    <prefer>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  <alias>
    <family>Monospace</family>
    <prefer>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>

There're actually several bugs itr. eg,
https://github.com/alacritty/alacritty/issues/4389
https://github.com/alacritty/alacritty/issues/4692
so I guess alacritty has its homebrew font resolution code that deviates from the "regular" behavior.

Offline

#7 2021-07-21 15:14:27

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: [SOLVED] Not all emojis are correct in alacritty terminal

Both of these bugs closed as not bugs, but problems with configurations.
I tried adding what you mentioned and it didn't help. I also tried font.conf from https://github.com/alacritty/alacritty/issues/4692, which didn't help also.
Could there be a problem with my Noto Color Emoji font? Is there a way to see what symbols and icons it has? I installed it from official repositories: noto-fonts-emoji and noto-fonts.

Offline

#8 2021-07-21 15:31:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,647

Re: [SOLVED] Not all emojis are correct in alacritty terminal

By that metric, systemd never had any bugs at all… still the reporters perceived similar behavior w/ alacritty in contrast to eg. kitty.
I don't think there's a probelm w/ the fonts, you can use https://archlinux.org/packages/extra/x86_64/fontforge/ to look at it - but everything suggests that alacritty approaches font substitution differently and picks the glyph from dejavu and only resorts to noto emoji if dejavu doesn't provide the glyph.

Try https://wiki.archlinux.org/title/Font_c … emoji_font
Just don't test for any application and use your local fonts.conf rather than something in /usr/share (see the discussion note)

Offline

#9 2021-07-21 17:43:30

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] Not all emojis are correct in alacritty terminal

You can query fontconfig what font it suggests for a particular code point with

fc-match -s monospace:charset=XXXX

where XXXX is the hex code.

Offline

#10 2021-07-21 19:49:52

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: [SOLVED] Not all emojis are correct in alacritty terminal

Thanks everyone for the help. Turned out it was the problem with my configuration. Still not fully understand how it works and how to change font and why it didn't work with alacritty, but worked in gnome-terminal. But it works big_smile

Fixed it with the following fonts.conf:

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
	  <family>Joy Pixels</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
	  <family>Joy Pixels</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Noto Sans Mono</family>
	  <family>Joy Pixels</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer>
      <family>Joy Pixels</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
</fontconfig>

Offline

Board footer

Powered by FluxBB