Skip to content

Instantly share code, notes, and snippets.

@win0err
Last active March 28, 2024 22:29
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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
@victinifan360
Copy link

Good article!

@win0err
Copy link
Author

win0err commented May 24, 2022

@win0err
Copy link
Author

win0err commented Nov 17, 2023

@carlos-lucenag
Copy link

That was really useful, thanks!!!

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