Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jgraham909/ec0be87d72d3d966d909e83b6fe9c049 to your computer and use it in GitHub Desktop.
Save jgraham909/ec0be87d72d3d966d909e83b6fe9c049 to your computer and use it in GitHub Desktop.
Add Emoji to Linux Fontconfig (edited to fix broken fonts for Zoom video conference)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Author: Santiago Saavedra <ssaavedra@gpul.org>, Kyle Lacy
License: CC0
Year: 2016-2017
Install:
Copy to $XDG_CONFIG_DIR/fontconfig/conf.d/57-add-emoji-support.conf
Run fc-cache -f
Description:
This fontconfig script is an update to Santiago Saavedra's original emoji
fontconfig script. It uses Noto Color Emoji instead of EmojiOne color,
and it also tweaks the match rules to fix some broken apps (namely, Zoom
video conference, which has a weird font rendering issue if the original
script is used).
-->
<fontconfig>
<match>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend_first">
<string>emoji</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="append" binding="same">
<string>emoji</string>
</edit>
</match>
<!-- Hack to fix font issue in Zoom when the above match is applied: -->
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="append" binding="same">
<string>DejaVu Sans</string>
</edit>
</match>
<match target="font">
<test name="family" compare="eq">
<string>DejaVu Sans</string>
</test>
<edit name="family" mode="prepend_first">
<string>emoji</string>
</edit>
</match>
<alias binding="strong">
<family>emoji</family>
<default><family>Noto Color Emoji</family></default>
</alias>
<!-- Alias requests for the other emoji fonts -->
<alias binding="strong">
<family>Apple Color Emoji</family>
<prefer><family>emoji</family></prefer>
<default><family>sans-serif</family></default>
</alias>
<alias binding="strong">
<family>Segoe UI Emoji</family>
<prefer><family>emoji</family></prefer>
<default><family>sans-serif</family></default>
</alias>
<alias binding="strong">
<family>EmojiOne Color</family>
<prefer><family>emoji</family></prefer>
<default><family>sans-serif</family></default>
</alias>
</fontconfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment