Skip to content

Instantly share code, notes, and snippets.

@RVFET
Created November 7, 2024 07:06
Show Gist options
  • Select an option

  • Save RVFET/e1d385ea4cc0e251e945611825ceb6ed to your computer and use it in GitHub Desktop.

Select an option

Save RVFET/e1d385ea4cc0e251e945611825ceb6ed to your computer and use it in GitHub Desktop.
Apple Color Emojis on Fedora/Debian (GNOME)

1. Download the latest version of the font.

wget 'https://github.com/samuelngs/apple-emoji-linux/releases/latest/download/AppleColorEmoji.ttf' -O ~/.local/share/fonts/AppleColorEmoji.ttf

2. Configure the font to be used as default emoji font.

Put the following inside of /etc/fonts/conf.d/60-generic.conf (in <family>emoji</family> part)

...
  <alias binding="same">
    <family>emoji</family>
    <prefer>
      <family>Apple Color Emoji</family> <!-- Added -->
      <!-- System fonts -->
      <family>Noto Color Emoji</family> <!-- Google -->
      <family>Apple Color Emoji</family> <!-- Apple -->
      <family>Segoe UI Emoji</family> <!-- Microsoft -->
      <family>Twitter Color Emoji</family> <!-- Twitter -->
      <family>EmojiOne Mozilla</family> <!-- Mozilla -->
      <!-- Third-Party fonts -->
      <family>Emoji Two</family>
      <family>Emoji One</family>
      <!-- Non-color -->
      <family>Noto Emoji</family> <!-- Google -->
      <family>Android Emoji</family> <!-- Google -->
    </prefer>
  </alias>
...

3. Add the font to the fontconfig

printf '%s\n' "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
'<!DOCTYPE fontconfig SYSTEM "fonts.dtd">' \
'<fontconfig>' \
'  <alias>' \
'    <family>serif</family>' \
'    <prefer>' \
'      <family>Apple Color Emoji</family>' \
'    </prefer>' \
'  </alias>' \
'  <alias>' \
'    <family>sans-serif</family>' \
'    <prefer>' \
'      <family>Apple Color Emoji</family>' \
'    </prefer>' \
'  </alias>' \
'  <alias>' \
'    <family>monospace</family>' \
'    <prefer>' \
'      <family>Apple Color Emoji</family>' \
'    </prefer>' \
'  </alias>' \
'  <match target="pattern">' \
'    <test qual="any" name="family"><string>Noto Color Emoji</string></test>' \
'    <edit name="family" mode="assign" binding="same"><string>Apple Color Emoji</string></edit>' \
'  </match>' \
'</fontconfig>' > ~/.config/fontconfig/fonts.conf

4. Clear the font cache, and done!

fc-cache -f -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment