Skip to content

Instantly share code, notes, and snippets.

@gusbemacbe
Last active August 28, 2020 07:54
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gusbemacbe/393613ac23ec19f39dc963b40fb8a704 to your computer and use it in GitHub Desktop.
Save gusbemacbe/393613ac23ec19f39dc963b40fb8a704 to your computer and use it in GitHub Desktop.
Color emoji font on Arch Linux (updated)

Hello!

The @ himalay's gist is outdated and broke the Electron-based apps, and the browsers. My updated gist derived from Twemoji font's fontconfig.

  1. Firstly create:
mkdir -p ~/.fonts
mkdir -p ~/.config/fontconfig/
  1. Raw the file fonts.conf.
  2. Save it to ~/.config/fontconfig/
  3. Remember to replace FiraGO (sans and serif) with your favourite sans and/or serif font, to replace JoyPixels with your favourite colour emoji font, to replace FuraCode Nerd font with your favourite monospace font.
  4. Run the command fc-cache -f -v
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle">
<const>hintfull</const>
</edit>
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
<edit mode="assign" name="autohint">
<bool>false</bool>
</edit>
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
<edit mode="assign" name="dpi">
<double>102</double>
</edit>
</match>
<dir>~/.local/share/fonts</dir>
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintfull</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
<match target="font">
<!-- If the requested font is Fira GO -->
<test compare="eq" name="family">
<string>FiraGO</string>
</test>
<!-- Replace the entire match list with Fira GO alone -->
<edit mode="assign_replace" name="family">
<string>FiraGO</string>
</edit>
<!-- Assign the serif family -->
<edit mode="append_last" name="family">
<string>serif</string>
</edit>
</match>
<match>
<!-- If the requested font is serif -->
<test qual="any" name="family">
<string>serif</string>
</test>
<!-- Make Fira GO the first result -->
<edit mode="prepend_first" name="family">
<string>FiraGO</string>
</edit>
<!-- Followed by JoyPixels -->
<edit mode="prepend_first" name="family">
<string>JoyPixels</string>
</edit>
</match>
<match target="font">
<!-- If the requested font is Fira GO -->
<test compare="eq" name="family">
<string>FiraGO</string>
</test>
<!-- Replace the entire match list with Bitstream Vera Sans alone -->
<edit mode="assign_replace" name="family">
<string>FiraGO</string>
</edit>
<!-- Assign the sans-serif family -->
<edit mode="append_last" name="family">
<string>sans-serif</string>
</edit>
</match>
<match target="pattern">
<!-- If the requested font is sans-serif -->
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<!-- Make Fira GO the first result -->
<edit mode="prepend_first" name="family">
<string>FiraGO</string>
</edit>
<!-- Followed by JoyPixels -->
<edit mode="prepend_first" name="family">
<string>JoyPixels</string>
</edit>
</match>
<match target="font">
<!-- If the requested font is Fura Code Nerd Font -->
<test compare="eq" name="family">
<string>FuraCode Nerd Font</string>
</test>
<!-- Replace the entire match list with Bitstream Vera Sans Mono alone -->
<edit mode="assign_replace" name="family">
<string>FuraCode Nerd Font</string>
</edit>
<!-- Assign the monospace family last -->
<edit mode="append_last" name="family">
<string>monospace</string>
</edit>
</match>
<match target="pattern">
<!-- If the requested font is monospace -->
<test qual="any" name="family">
<string>monospace</string>
</test>
<!--
Make FuraCode Nerd Font the first result
Note: If you want a different monospace font, this is where you change it.
-->
<edit mode="prepend_first" name="family">
<string>FuraCode Nerd Font</string>
</edit>
<!-- Followed by JoyPixels -->
<edit mode="prepend_first" name="family">
<string>JoyPixels</string>
</edit>
</match>
<!-- Add emoji generic family -->
<alias binding="strong">
<family>emoji</family>
<default>
<family>JoyPixels</family>
</default>
</alias>
<!-- Alias requests for the other emoji fonts -->
<alias binding="strong">
<family>Apple Color Emoji</family>
<prefer>
<family>JoyPixels</family>
</prefer>
<default>
<family>sans-serif</family>
</default>
</alias>
<alias binding="strong">
<family>Segoe UI Emoji</family>
<prefer>
<family>JoyPixels</family>
</prefer>
<default>
<family>sans-serif</family>
</default>
</alias>
<alias binding="strong">
<family>Noto Color Emoji</family>
<prefer>
<family>JoyPixels</family>
</prefer>
<default>
<family>sans-serif</family>
</default>
</alias>
<dir>~/.fonts</dir>
</fontconfig>
@PrMinisterGR
Copy link

This creates weird issues with numbers in pages with Firefox.

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