1

Ubuntu 18.04 introduced out-of-the-box color emoji support, and it ships with the google noto color emoji font by default.

However i want to replace those emojis with the Blobmojis (https://github.com/C1710/blobmoji).

I found ways online how to completely disable this color emoji font support, which usually just involves removing the fonts-noto-color-emoji package, but there has to be a config file somewhere on the system that dictates which font(s) are to be used for emojis, right?

Where would such a file be and how can i configure it, to use a different font by default?

zepar
  • 51

2 Answers2

4

After a long time, and switching to manjaro too, I came upon this problem again, however now I have a solution.

You will need to edit 3 different files, replace Blobmoji with whatever Emoji-Font you want to use.

First file: /etc/fonts/conf.d/60-generic.conf

Find the part of the file where it will list off all emoij font options, something like

<alias binding="same">
    <family>emoji</family>
    <prefer>
        <!-- System fonts -->
        <family>Blobmoji</family> <!-- Custom -->
        <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>

Insert your choice of emoji font at the very top, like this:

    <prefer>
        <!-- System fonts -->
        <family>Blobmoji</family> <!-- Custom -->
        <family>Noto Color Emoji</family> <!-- Google -->

This will give your emoji font top priority in replacing anything labeled "emoji".

Next file is /etc/fonts/conf.d/45-generic.conf

Here you will find a listing of the same fonts again:

<!-- System emoji -->
<alias binding="same">
    <family>Noto Color Emoji</family> <!-- Google -->
    <default><family>emoji</family></default>
</alias>
<alias binding="same">
    <family>Apple Color Emoji</family> <!-- Apple -->
    <default><family>emoji</family></default>
</alias>
<alias binding="same">
    <family>Segoe UI Emoji</family> <!-- Microsoft -->
    <default><family>emoji</family></default>
</alias>
<alias binding="same">
    <family>Twitter Color Emoji</family> <!-- Twitter -->
    <default><family>emoji</family></default>
</alias>
<alias binding="same">
    <family>EmojiOne Mozilla</family> <!-- Mozilla -->
    <default><family>emoji</family></default>
</alias>
<!-- Third-party emoji -->

Insert your font at the very top again:

<!-- System emoji -->
<alias binding="same">
    <family>Blobmoji</family> <!-- Custom -->
    <default><family>emoji</family></default>
</alias>
<alias binding="same">
    <family>Noto Color Emoji</family> <!-- Google -->
    <default><family>emoji</family></default>
</alias>

This will label any text that is written in your font with emoji.

Lastly its your local ~/.config/fontconfig/fonts.conf

This is mostly for Firefox or other browsers, so they will display your desired emojis.

Append this at the end:

<alias>
<family>serif</family>
<prefer>
  <family>Blobmoji</family>
</prefer>
 </alias>
 <alias>
<family>sans-serif</family>
<prefer>
  <family>Blobmoji</family>
</prefer>
 </alias>
 <alias>
<family>monospace</family>
<prefer>
  <family>Blobmoji</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>Blobmoji</string></edit>
 </match>

This will give the serif, sans-serif and monospace fonts access to the custom font emojis.

The last entry is specifically there, if any websites are specifying lists of emoji fonts instead of just using sans-serif, that the usual font will specifically be replaced by your custom font, in this case Noto Sans Color is given, you should choose the font at the highest position on the other 2 files that you have installed, chances are its also just Noto Sans Color.

After fc-cache -f -v everything should be set.

zepar
  • 51
3

While @zepar's answer is useful, setting preference of emoji for monospace breaks webpages where code line numbers are shown. So you can just not append the monospace part.

Here's my fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

<fontconfig>

&lt;alias&gt;
    &lt;family&gt;serif&lt;/family&gt;
    &lt;prefer&gt;
        &lt;family&gt;JoyPixels&lt;/family&gt;
    &lt;/prefer&gt;
&lt;/alias&gt;

&lt;alias&gt;
    &lt;family&gt;sans-serif&lt;/family&gt;
    &lt;prefer&gt;
        &lt;family&gt;JoyPixels&lt;/family&gt;
    &lt;/prefer&gt;
&lt;/alias&gt;

&lt;match target=&quot;pattern&quot;&gt;
    &lt;test qual=&quot;any&quot; name=&quot;family&quot;&gt;
        &lt;string&gt;Noto Color Emoji&lt;/string&gt;
    &lt;/test&gt;
    &lt;edit name=&quot;family&quot; mode=&quot;assign&quot; binding=&quot;same&quot;&gt;
        &lt;string&gt;JoyPixels&lt;/string&gt;
    &lt;/edit&gt;
&lt;/match&gt;

</fontconfig>