Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Color emoji on Arch Linux.
# create folders if does not exist
mkdir -p ~/.fonts
mkdir -p ~/.config/fontconfig/
# download noto color emoji font from https://www.google.com/get/noto/#emoji-zsye-color
# extract NotoColorEmoji.ttf file into ~/.fonts/
# create font config file
cat << 'EOF' > ~/.config/fontconfig/fonts.conf
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<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>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>
EOF
# build font information cache files
fc-cache -f -v
@forabi

This comment has been minimized.

Copy link

commented Sep 3, 2017

This actually breaks the numbers in all GTK and Qt apps. It might be due to the updated Noto Color Emoji font. Can this be fixed?

@gjvnq

This comment has been minimized.

Copy link

commented Sep 20, 2017

I just removed all the mode="prepend" binding="strong" and it worked. No weired bugs with numbers.

@jcpsantiago

This comment has been minimized.

Copy link

commented Nov 13, 2017

Fixed color emojis, but removed spaces between words.

@briancaffey

This comment has been minimized.

Copy link

commented Nov 24, 2017

I tried running the script and had issues with spaces and numbers, then removed mode="prepend" binding="strong" and ran fc-cache -f -v as @gjvnq recommended and still had issues with spaces taht @jcpsantiago mentioned. I then removed the all of the contents from ~/.config/fontconfig/fonts.conf and ran fc-cache -f -v again. After rebooting I now get Emoji One emoji with no number/spacing issues in GTK/Qt applications. Thanks for the script and helpful commnts! I don't know if it is possible, but it would also be interesting to display these Emoji One fonts in urxvt. The fonts seem to work just fine in gnome-terminal but some are displayed as boxes in urxvt.

@hbarcelos

This comment has been minimized.

Copy link

commented Apr 27, 2018

Fontconfig error: "/home/henrique/.config/fontconfig/fonts.conf", line 8: junk after document element

I'm getting this error running fc-cache... Anybody knows why?

@hsjoberg

This comment has been minimized.

Copy link

commented May 2, 2018

@hbarcelos try adding a <fontconfig>-root tag for all <match>-tags, that worked for me.

@carbolymer

This comment has been minimized.

Copy link

commented Jul 23, 2019

does not work - it enforces Noto Color Emoji in the whole OS, which basically breaks fonts.

@gusbemacbe

This comment has been minimized.

Copy link

commented Oct 14, 2019

@carbolymer

It is outdated. I prepared updated and compatible file. Here is:

https://gist.github.com/gusbemacbe/393613ac23ec19f39dc963b40fb8a704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.