Last active
March 13, 2024 13:09
-
-
Save SohamG/6b8830cc08a22bc5bc24c76ef799510a to your computer and use it in GitHub Desktop.
Fix emoji in Linux and get color emoji in Discord! Place this fontconfig file in ~/.config/fontconfig/fonts.conf
This file contains 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"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<!-- REQUIRES Noto fonts (along with Noto Color Emoji) | |
run `fc-list | grep -i -e "noto sans" -e "noto serif" -e "noto color emoji"` to confirm | |
--> | |
<!-- Change the string in the family tag to whatever font --> | |
<family>serif</family> | |
<prefer><family>Noto Serif</family></prefer> | |
</alias> | |
<alias> | |
<family>sans-serif</family> | |
<prefer><family>Noto Sans</family></prefer> | |
</alias> | |
<alias> | |
<family>sans</family> | |
<prefer><family>Noto Sans</family></prefer> | |
</alias> | |
<alias> | |
<family>monospace</family> | |
<prefer><family>Noto Mono</family></prefer> | |
</alias> | |
<!-- This adds Noto Color Emoji to the font families sans, serif, sans-serif and monospace --> | |
<match target="pattern"> | |
<test name="family"><string>monospace</string></test> | |
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit> | |
</match> | |
<match target="pattern"> | |
<test name="family"><string>sans</string></test> | |
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit> | |
</match> | |
<match target="pattern"> | |
<test name="family"><string>serif</string></test> | |
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit> | |
</match> | |
<!-- Discord loads the system's sans-serif font family, add Noto Color Emoji to it --> | |
<match target="pattern"> | |
<test name="family"><string>sans-serif</string></test> | |
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit> | |
</match> | |
<!-- Add emoji generic family --> | |
<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>Noto Color Emoji</family></prefer> | |
<default><family>emoji</family></default> | |
</alias> | |
<alias binding="strong"> | |
<family>Segoe UI Emoji</family> | |
<prefer><family>Noto Color Emoji</family></prefer> | |
<default><family>emoji</family></default> | |
</alias> | |
<!-- Run "fc-cache -fv" after saving the file and kill and restart whichever app (like discord) and enjoy emoji --> | |
</fontconfig> |
This should be default for all discord installs honestly, sooo much better.
Thanks for your work, spread the word around to fellow linux users!
I just reinstalled Void Linux on my rig here and I was having the stupid boxy issue in Discord channel names. Installing a crapton of unicode emoji fonts as well as placing this fonts.conf file into ~/.config/fontsconfig/ fixed the issue for me! Thanks for posting it!
missing <alias> between line 7 and 8
Ah crap I messed it up in the last two revisions. Use older version for now
On Tue, Feb 15, 2022 at 1:12 PM Johannes ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
missing between line 7 and 8
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/6b8830cc08a22bc5bc24c76ef799510a#gistcomment-4066503>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJLT6JHKAIUWBYLFMKJUTU3KQSRANCNFSM4H2ONI4Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Soham Gumaste
***@***.***
there's a <alias>
beacon missing between line 7 & 8 in the current revision.
Thanks a lot for the snippet. I've been using for quite a while :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!