WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] emojis show up as tofus in all applications  (Read 3138 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
[Solved] emojis show up as tofus in all applications
« on: September 21, 2022, 12:38:10 PM »
I use TCL13.1 x86_64 on my daily-driver laptop. When I receive an email with an emoji or visit a webpage with emojis, I am only able to see a very small subset of them--most kinds of emoji show up as little white boxes (a.k.a. "tofus").

Here's a test page: https://unicode.org/Public/emoji/5.0/emoji-test.txt
With a few exceptions ("smiling face", "frowning face", and "skull and crossbones"), I see only tofus on the right column by the emoji names.

This problem affects both of the applications I use the most: brave-browser and thunderbird.

I already tried installing most of the font extensions in the repo to no avail, so I went back to loading just the few font extensions that I normally use (Hack-font, dejavu-fonts-ttf, and dependencies of other extensions):
Code: [Select]
$ tce-status -i | grep font
Hack-font
Xorg-fonts
dejavu-fonts-ttf
fontconfig
libXfont2
libfontenc

My system already has the /etc/fonts symlink to /usr/local/etc/fonts:
Code: [Select]
$ ls -l /etc/fonts
lrwxrwxrwx    1 root     root            20 Sep 21 12:26 /etc/fonts -> /usr/local/etc/fonts/

Any ideas how to make the emojis show up on the test page as expected? I rarely use emojis myself, but would like to see them when people send them to me.
« Last Edit: September 22, 2022, 09:36:21 AM by Rich »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: emojis show up as tofus in all applications
« Reply #1 on: September 21, 2022, 12:43:13 PM »
It looks like none of the repo fonts has emojis. You can try fonts off the web by putting them to your ~/.fonts directory.
The only barriers that can stop you are the ones you create yourself.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: emojis show up as tofus in all applications
« Reply #2 on: September 21, 2022, 01:05:55 PM »
Thanks, curaga. That did the trick.

I downloaded Noto_Emoji.zip (from https://fonts.google.com/noto/specimen/Noto+Emoji) and Noto_Color_Emoji.zip (from https://fonts.google.com/noto/specimen/Noto+Color+Emoji). Then I extracted the zip archives, created ~/.fonts/emoji/ directory, and put all the extracted .ttf files in there:

Code: [Select]
$ ls $HOME/.fonts/emoji
NotoColorEmoji-Regular.ttf       NotoEmoji-Regular.ttf
NotoEmoji-Bold.ttf               NotoEmoji-SemiBold.ttf
NotoEmoji-Light.ttf              NotoEmoji-VariableFont_wght.ttf
NotoEmoji-Medium.ttf

If I re-open the web browser and try the test page, all emojis show up now! Topic is solved, thank you.


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: emojis show up as tofus in all applications
« Reply #3 on: September 21, 2022, 01:14:11 PM »
Hi GNUser
I just opened your test page with Firefox and all of the emojis seemed to display properly.
I entered  emoji  in the  about:config  search box and Firefox returned one result:
Code: [Select]
font.name-list.emoji Twemoji Mozilla
I doubt it makes any difference, but these are the fonts I have installed:
Code: [Select]
tc@E310:~$ ls -1 /usr/local/tce.installed | grep -E "font|freetype|vera"
Xorg-fonts
dejavu-fonts-ttf
fontconfig
freetype
libXfont2
libfontenc
ttf-bitstream-vera
tc@E310:~$

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: emojis show up as tofus in all applications
« Reply #4 on: September 21, 2022, 01:34:43 PM »
Hi, Rich. It seems your web browser comes with at least one built-in font provided by Mozilla ("Twemoji Mozilla"). My browser (Brave) does not seem to come with any built-in font for emojis.

I discovered that putting the "emoji" directory containing the  Noto*.ttf  files inside of /usr/local/share/fonts (i.e., so that I now have the /usr/local/share/fonts/emojis/ directory) also works.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: emojis show up as tofus in all applications
« Reply #5 on: September 21, 2022, 09:59:03 PM »
A related question: I added noto emoji fonts. Now on test page the vast majority of emojis show up in color using the noto font, while a few of them (e.g., "smiling face", "frowning face", and "skull and crossbones") show up in a much more primitive-looking font in black and white (could be one of the fonts in Xorg-fonts.tcz).

Not that I particularly care about the above "issue", but it is an opportunity for me to learn how to tweak font selection/priority when more than one font can be used to display a particular glyph.

So, how do I force all emojis in my web browser (Brave) to be rendered with NotoColorEmoji-Regular.ttf? This how-to looked promising:
https://askubuntu.com/a/1204262

No luck with that, though. As with user denshigomi, I get this as expected (so far so good):
Code: [Select]
$ fc-match -a | head -2
NotoColorEmoji-Regular.ttf: "Noto Color Emoji" "Regular"
DejaVuSans.ttf: "DejaVu Sans" "Book"
But the black and white emojis are still there when I close my browser and reload the test page! It seems the browser is ignoring fontconfig and following some other font selection algorithm.
« Last Edit: September 21, 2022, 10:20:15 PM by GNUser »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: emojis show up as tofus in all applications
« Reply #6 on: September 21, 2022, 11:45:43 PM »
Hi GNUser
According to the test page you linked to, the 3 examples you mentioned come in 2 versions
coded slightly differently:
Code: [Select]
----- Snip -----
263A FE0F                                  ; fully-qualified     # ☺️ smiling face
263A                                       ; non-fully-qualified # ☺ smiling face
 ----- Snip -----
# subgroup: face-negative
2639 FE0F                                  ; fully-qualified     # ☹️ frowning face
2639                                       ; non-fully-qualified # ☹ frowning face
 ----- Snip -----
2620 FE0F                                  ; fully-qualified     # ☠️ skull and crossbones
2620                                       ; non-fully-qualified # ☠ skull and crossbones
 ----- Snip -----
The color versions (fully-qualified) have  FE0F  appended to them.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14847
Re: emojis show up as tofus in all applications
« Reply #7 on: September 22, 2022, 04:49:59 AM »
It looks like none of the repo fonts has emojis.

In fact there's the emojionecolor-svginot-fonts-ttf extension in the x86_64 repo
« Last Edit: September 22, 2022, 04:51:46 AM by Juanito »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: emojis show up as tofus in all applications
« Reply #8 on: September 22, 2022, 06:01:49 AM »
I figured out the problem I mentioned in Reply #5 above: My browser (Brave) has its own font settings and ignores fontconfig. If I set Noto Color Emoji to be browser's preferred font, then all emojis on test page show up in color.

But this leads to another problem: Noto Color Emoji includes glyphs for alphanumeric characters which, to my eye, are difficult to read. So setting it as the default font is not going to work for me.

Conclusion:
It seems there is no way to set "preferred font for emojis" vs "preferred font for text" (neither in fontconfig nor in web browser). In that case, I will set my preferred font based on what's easy to read. If preferred font happens to have some emojis, its version of those emojis is what I'm stuck seeing. A font with broad emoji coverage (I went with Noto) will be present as a fallback for emojis that are not supported by my preferred font.
« Last Edit: September 22, 2022, 06:03:55 AM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: emojis show up as tofus in all applications
« Reply #9 on: September 22, 2022, 06:15:20 AM »
In fact there's the emojionecolor-svginot-fonts-ttf extension in the x86_64 repo
I just saw that, Juanito. I also found notocoloremoji-fonts-ttf.tcz in the repo. Alas, even with both of these extensions loaded, several emojis on the test page display as tofus.

The latest Noto_Color_Emoji.zip (from https://fonts.google.com/noto/specimen/Noto+Color+Emoji) supports all emojis on the test page. Would you like me to update the notocoloremoji-fonts-ttf.tcz extension, Juanito? You are the maintainer.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: emojis show up as tofus in all applications
« Reply #10 on: September 22, 2022, 06:54:23 AM »
Hi, Juanito. Since I had already created an updated  notocoloremoji-font-ttf.tcz  extension for myself, I took the liberty to submit it to you for the repo. I hope it is useful.

Topic can be marked as solved.

Happy hacking!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: [Solved] emojis show up as tofus in all applications
« Reply #11 on: September 22, 2022, 10:05:13 AM »
Hi GNUser
... Topic can be marked as solved. ...
Done.

I recently tried to enter  -O0  without the leading minus sign in a post and to my surprise it
showed up as an emoji. Does the following display a face with sunglasses and a full head
of hair for you?
Quote
O0

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: [Solved] emojis show up as tofus in all applications
« Reply #12 on: September 22, 2022, 12:39:51 PM »
Haha, it sure does.

Happy hacking! grooving!