Tiny Core Linux
General TC => General TC Talk => Topic started by: GNUser on September 21, 2022, 09:38:10 AM
-
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):
$ 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:
$ 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.
-
It looks like none of the repo fonts has emojis. You can try fonts off the web by putting them to your ~/.fonts directory.
-
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:
$ 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.
-
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:
font.name-list.emoji Twemoji Mozilla
I doubt it makes any difference, but these are the fonts I have installed:
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:~$
-
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.
-
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):
$ 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.
-
Hi GNUser
According to the test page you linked to, the 3 examples you mentioned come in 2 versions
coded slightly differently:
----- 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.
-
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
-
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.
-
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.
-
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!
-
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?
O0
-
Haha, it sure does.
Happy hacking! grooving!