Emoji and Linux 🐧 #53
Comments
Ooof, that's a good question! I hear (as a Mac user, sheltered from these problems), that the solution is to install a better emoji font. If you're on Ubuntu, I think this is what you're looking for. I don't know if it works on non-Ubuntu, but it's worth giving a try! The solution seems pretty generic -- 1. download a better font, 2. make it the OS fallback for emoji, 3. flush the font cache. Good luck! Let me know if this worked out for you! |
Hi again =) Thanks for your answer. The solution you provided worked indeed. Unfortunately It seems, Chrome on Linux |
Ah. RIGHT. It's because Emoji One is an SVG font, and Chrome doesn't support that. You'll have to find a non-svg emoji font instead :( |
Thanks! I'll try searching and if I succeed, I'll post here) |
Try the Noto Color emoji maybe? |
Hm... Didn't knew about that. |
YESSSSSSSSS. So glad I could help! Also, so I can link this on Twitter: if you want to get colour emoji on Linux Chrome, the solution was to follow the steps in this tutorial but using the Noto Color Emoji font instead! |
Well, you'll probably not want to override monospace font with Noto Color Emoji, cause it will look ugly as well as behave strange. Here are the changes I made to configuration from the tutorial: <match>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
- <string>Emoji One Color</string>
+ <string>Noto Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>serif</string></test>
<edit name="family" mode="prepend" binding="strong">
- <string>Emoji One Color</string>
- </edit>
- </match>
-
- <match>
- <test name="family"><string>monospace</string></test>
- <edit name="family" mode="prepend" binding="strong">
- <string>Emoji One Color</string>
+ <string>Noto Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>Apple Color Emoji</string></test>
<edit name="family" mode="prepend" binding="strong">
- <string>Emoji One Color</string>
+ <string>Noto Color Emoji</string>
</edit>
</match> |
Hm... on the Mozilla bugzilla I've found a possibility to setup a font fallback only for chrome app. This might be useful for somebody. <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="prgname"><string>chrome</string></test>
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
</fontconfig> |
Hope I'm not too late. Jumping in because I had (somewhat To have them everywhere you need a patched cairo. For Arch Linux users there is aur/cairo-coloredemoji, and for other distro you might have to compile it with the patch, unfortunately: --- a/cairo-1.14.6/src/cairo-ft-font.c 2016-03-13 09:36:42.618325503 +0800
+++ b/cairo-1.14.6/src/cairo-ft-font.c 2016-03-13 09:38:24.194288159 +0800
@@ -2258,7 +2258,7 @@
* Moreover, none of our backends and compositors currently support
* color glyphs. As such, this is currently disabled.
*/
- /* load_flags |= FT_LOAD_COLOR; */
+ load_flags |= FT_LOAD_COLOR;
#endif
error = FT_Load_Glyph (face, Here is my related fontconfig and a final screenshot You may notice that the emoji character width in terminal is sometimes considered 1, not 2, causing them to overlap. This is due to some assumptions on character width in glibc's |
And the freetype's version must > 2.6.3. You may cause some issue when you are using infinality's package(such as firefox can't display emoji correctly, but chromium is fine). |
Try changing your Chrome's font settings (in Settings -> Advanced -> Customized fonts) to generic names or fonts you like, e.g. "sans" "serif" "monospace". This is because in https://gist.github.com/hexchain/47f550472e79d0805060#file-51-noto-color-emoji-conf-xml-L44, your final font list populated by fontconfig starts with the Emoji font (because of If that does not solve your problem, try removing the last |
EDIT: Whoops, forgot a command Thanks for the hint about monochrome fallbacks, hexchain! Why did you edit that away? I figured it out! You don't need a config file at all! You just need to remove the monochrome Symbola font from your system in order to force Chrome to use Noto. So to summarize, this is all you need to do to enable emoji support in Chrome on Ubuntu:
This may have other side effects though. |
Not all monochrome glyphs are from Symbola. Even Noto Sans has some. |
EDIT: Added an overriden emoji that I overlooked You're not wrong, but it's a small amount. The only emoji's that are still overridden with monochrome versions are: (it's possible that I overlooked a few) Other than those, it works perfectly, as you can see. (notice the single wrong one in between the "upside down" and "yummy" faces) |
Hey, @Jop-V thanks! That worked like a charm! |
Yay! Seriously though @hexchain, think before editing! I'm glad I saw your reply before you edited it, because I'm not completely sure whether I would have figured it out without the information in your unedited post... |
Hi Guys, had the same issue with spaces being removed from text, and found a solution that didn't involve removing fonts. And I think it works with every emoji. Basically, the DejaVu font is overriding some of them, so in your fontconfig you'll need to set the font fallbacks to both the emoji font and a font without emoji (otherwise the emoji font will screw up the spaces). I used "Bitstream Vera" My Gist: https://gist.github.com/joestrong/b4ee8c12284fa2a20e70a9bc272ef19b |
You may want to limit the config to Chrome using |
GIMP works fine for me and I haven't seen any crashes so far |
@hexchain I already commented on your gist with the installation instructions for Arch, so people can try it out more easily. Thanks much for the patched cairo package! However, I have now emojis in my UI programs GNOME-wide. Do I need to make an alias for "monospace" like described here but for Noto Color Emoji instead? edit Forgot to restart the GNOME Terminal, now it works perfectly fine. |
@cookiengineer Any VTE-based terminal would suffice (I use Termite personally). As reported by others, Qt(KDE) ones are good too but I haven't tried any. |
@hexchain: Well, I'm stupid. Forgot to restart GNOME Terminal. Now it works perfectly fine |
Just letting you guys know I'm diggin' the net to write a small roundup about emojis and Linux. You are awesome |
@hexchain I would like to achieve in the Ubuntu terminal color symbol, your can give me some reference? |
It's strange that we have to patch Cairo, I thought Pango was used to render text under GTK+, while using Cairo for the rest of the graphic rendering? Anyway with a patched Cairo (download package for Ubuntu 16.04), the font installed and config written, it works. So the full commands to get color emojis in Ubuntu 16.04 LTS would be: cd "$(mktemp -d)"
wget https://noto-website.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip
unzip NotoColorEmoji-unhinted.zip
wget https://github.com/notwaldorf/ama/files/1049784/libcairo2_1.14.6-1_amd64.deb.zip
unzip libcairo2_1.14.6-1_amd64.deb.zip
sudo dpkg -i libcairo2_1.14.6-1_amd64.deb
mkdir -p ~/.fonts && mv *.ttf ~/.fonts
mkdir -p ~/.config/fontconfig && cat > ~/.config/fontconfig/fonts.conf <<EOF
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>Apple Color Emoji</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Color Emoji</string>
</edit>
</match>
</fontconfig>
EOF
fc-cache -f -v |
@jmendeth |
Hi, I know the topic is closed but I had some issues related to this and I wanted to ask a question if someone here could help me with this issue I've just created on stack overflow. Thank you very much, Sandra |
Hi Monica,
Have you seen any successful combinations of emoji🎉 and Linux desktops 🐧 ? I'm really 😞 upset because all I get is monochrome ⚫ emojis, which looks so sad 😢 .
Have you heard about any good way to use🌈 colorful emojis 😹 on linux machines?❤️
TIA
The text was updated successfully, but these errors were encountered: