Created
June 19, 2016 10:36
-
-
Save ssaavedra/a8e5bdce469e1887041423205ce72fdc to your computer and use it in GitHub Desktop.
Add Emoji to Linux Fontconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<!-- | |
EmojiOne Color SVGinOT Font | |
Author: Santiago Saavedra <[email protected]> | |
License: CC0 | |
Year: 2016 | |
Install: | |
Copy to $XDG_CONFIG_DIR/fontconfig/conf.d/57-add-emoji-support.conf | |
Run fc-cache -f | |
Description: | |
This fontconfig script prepends an emoji family to every other family. | |
Then, the emoji family is defined to have EmojiOne Color as its default member. | |
This would work with a build of Noto Color Emoji which wouldn't override | |
non-emoji symbols, but the one I have overrides at least numbers. | |
--> | |
<fontconfig> | |
<match> | |
<!-- If the requested font is serif --> | |
<test qual="any" name="family"> | |
<string>serif</string> | |
</test> | |
<edit name="family" mode="prepend_first"> | |
<string>emoji</string> | |
</edit> | |
</match> | |
<match target="pattern"> | |
<!-- If the requested font is sans-serif --> | |
<test qual="any" name="family"> | |
<string>sans-serif</string> | |
</test> | |
<!-- Followed by EmojiOne Color --> | |
<edit name="family" mode="prepend_first"> | |
<string>emoji</string> | |
</edit> | |
</match> | |
<match target="font"> | |
<!-- If the requested font is Bitstream Vera Sans Mono --> | |
<test name="family" compare="eq"> | |
<string>Bitstream Vera Sans Mono</string> | |
</test> | |
<!-- Assign the monospace family last --> | |
<edit name="family" mode="append_last"> | |
<string>monospace</string> | |
</edit> | |
</match> | |
<!-- Add emoji generic family --> | |
<alias binding="strong"> | |
<family>emoji</family> | |
<!-- | |
<default><family>Noto Color Emoji</family></default> | |
--> | |
<default><family>EmojiOne Color</family></default> | |
</alias> | |
<!-- Alias requests for the other emoji fonts | |
<alias binding="strong"> | |
<family>Apple Color Emoji</family> | |
<prefer><family>EmojiOne Color</family></prefer> | |
<default><family>sans-serif</family></default> | |
</alias> | |
<alias binding="strong"> | |
<family>Segoe UI Emoji</family> | |
<prefer><family>EmojiOne Color</family></prefer> | |
<default><family>sans-serif</family></default> | |
</alias> | |
<alias binding="strong"> | |
<family>Noto Color Emoji</family> | |
<prefer><family>EmojiOne Color</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