Skip to content

Instantly share code, notes, and snippets.

@win0err
Last active November 16, 2024 18:29
Show Gist options
  • Save win0err/9d8c7f0feabdfe8a4c9787b02c79ac51 to your computer and use it in GitHub Desktop.
Save win0err/9d8c7f0feabdfe8a4c9787b02c79ac51 to your computer and use it in GitHub Desktop.
πŸ’ƒ Apple Emoji on Linux

Install Apple Color Emoji on Linux

  1. Download font.
mkdir ~/.local/share/fonts/
wget https://github.com/samuelngs/apple-emoji-linux/releases/latest/download/AppleColorEmoji.ttf -O ~/.local/share/fonts/AppleColorEmoji.ttf
# or system-wide to /usr/share/fonts/AppleColorEmoji/, for example
  1. Put Apple Color Emoji on the 1st place in /etc/fonts/conf.d/60-generic.conf:
...
	<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>
...
  1. Create font config:
mkdir ~/.config/fontconfig/	
tee ~/.config/fontconfig/fonts.conf << FONTS	
<?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>	
FONTS	
  1. Clear font cache: fc-cache -f -v
@carlos-lucenag
Copy link

That was really useful, thanks!!!

@samyarkd
Copy link

samyarkd commented Aug 3, 2024

great awesome :D

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