Skip to content

Instantly share code, notes, and snippets.

@qnub
Forked from BojanStipic/fonts.conf
Last active July 7, 2022 00:37
Show Gist options
  • Save qnub/cb49f20cc1250f22b4ee493dfb2eddd7 to your computer and use it in GitHub Desktop.
Save qnub/cb49f20cc1250f22b4ee493dfb2eddd7 to your computer and use it in GitHub Desktop.
Linux color emoji
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family"><string>DejaVu Sans</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Sans</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>FreeSans</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Sans</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>DejaVu Serif</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Serif</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>FreeSerif</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Serif</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>DejaVu Mono</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Mono</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>FreeMono</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Mono</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>EmojiOne Color</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>Apple Color Emoji</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>Segoe UI Emoji</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
</match>
<selectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<string>DejaVu Sans</string>
</patelt>
</pattern>
</rejectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<string>DejaVu Serif</string>
</patelt>
</pattern>
</rejectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<string>DejaVu Mono</string>
</patelt>
</pattern>
</rejectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<string>FreeSans</string>
</patelt>
</pattern>
</rejectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<string>FreeSerif</string>
</patelt>
</pattern>
</rejectfont>
<rejectfont>
<pattern>
<patelt name="family" >
<string>FreeMono</string>
</patelt>
</pattern>
</rejectfont>
</selectfont>
<match>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend_first">
<string>Noto Serif</string>
</edit>
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend_first">
<string>Noto Sans</string>
</edit>
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend_first">
<string>PT Mono</string>
</edit>
<edit name="family" mode="prepend_first">
<string>Noto Mono</string>
</edit>
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
<alias binding="strong">
<family>emoji</family>
<default><family>Noto Color Emoji</family></default>
</alias>
</fontconfig>

Run

sudo apt install fonts-noto

Download and install font https://noto-website.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip (unzip, dubleclick font file, click «Install»).

Copy fonts.conf to ~/.config/fontconfig/fonts.conf

Run

fc-cache -f -v

Check http://eosrei.github.io/emojione-color-font/full-demo.html

Emoji Picker:

sudo add-apt-repository ppa:ys/emojione-picker
sudo apt update && sudo apt install emojione-picker

Firefox fix on about:config page set gfx.font_rendering.fontconfig.fontlist.enabled to false and reboot firefox.

@AlexCzar
Copy link

Thanks!

@SergiusTheBest
Copy link

Now there is no need in the conf file, just do sudo apt install fonts-noto-color-emoji.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment