How to use color emojis? Or, how to set an order of preference for color emojis?

I’m using Manjaro KDE, in case that is relevant.

I have (at least) two color emoji fonts:

$ pacaur -Ss emoji | grep installed
extra/noto-fonts-emoji 20200720-1 [installed]
aur/ttf-twemoji 13.0.1-1 (18, 5.14132) [installed: 13.0.1-1]

I installed ttf-twemoji because only installing noto-fonts-emoji was not enough to solve the issue of the missing colors. Twemoji solved this issue partially thanks to a config file (see below), but some emojis still default to B/W versions from who knows which strange font:

EDIT: I can’t upload the pic yet ![image|476x500](upload://6BrDPZtTUJtPoLWsRgLezFcWmHk.png)

I’ve looked around and this seems to be a somewhat common issue, but I couldn’t find any solution that worked:

EDIT: I can’t post links yet

* https://archived.forum.manjaro.org/t/make-all-emojis-colorful/84268/7 This has the same issue that some emojis are missing
* https://www.reddit.com/r/archlinux/comments/9q8dlj/how_to_better_enable_color_emojis/ The solution has been removed, but it seems some users still had trouble with mixed emojis.
* https://archived.forum.manjaro.org/t/tutorial-how-to-enable-system-wide-color-emoji-support/35188 I haven't tried this one because the file already exists and it's not clear to me how they should be merged.
* https://wiki.archlinux.org/index.php/Font_configuration#Force_emoji_font This one is for specific applications, whereas I want it system wide.
    * https://wiki.archlinux.org/index.php/Fonts#Emoji_and_symbols I didn't found any useful information here either.

I don’t understand this very well, but my suspicion is that for some of the emojis it’s defaulting to another font. Is there any way to make all emojis come from just one font? Or at least to create an order of preference so that if there are missing emojis they are covered by another specific font?

Finally, for reference, this is Twemoji’s font config file; from /etc/fonts/config.d/75-twemoji.conf

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

    <!--
    Treat this file as a reference and modify as necessary if you are not satisfied with the results.


    This config attempts to guarantee that colorful emojis from Twemoji will be displayed,
    no matter how badly the apps and websites are written.

    It uses a few different tricks, some of which introduce conflicts with other fonts.
    -->


    <!--
    This adds a generic family 'emoji',
    aimed for apps that don't specify specific font family for rendering emojis.
    -->
    <match target="pattern">
        <test qual="any" name="family"><string>emoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <!--
    This adds Twemoji as a final fallback font for the default font families.
    In this case, Twemoji will be selected if and only if no other font can provide a given symbol.

    Note that usually other fonts will have some glyphs available (e.g. Symbola or DejaVu fonts),
    causing some emojis to be rendered in black-and-white.
    -->
    <match target="pattern">
        <test name="family"><string>sans</string></test>
        <edit name="family" mode="append"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test name="family"><string>serif</string></test>
        <edit name="family" mode="append"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test name="family"><string>sans-serif</string></test>
        <edit name="family" mode="append"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test name="family"><string>monospace</string></test>
        <edit name="family" mode="append"><string>Twemoji</string></edit>
    </match>

    <!--
    If other fonts contain emoji glyphs, they could interfere and make some emojis rendered in wrong font (often in black-and-white).
    For example, DejaVu Sans contains black-and-white emojis, which we can remove using the following trick:
    -->
    <match target="scan">
        <test name="family" compare="contains">
            <string>DejaVu</string>
        </test>
        <edit name="charset" mode="assign" binding="same">
            <minus>
                <name>charset</name>
                <charset>
                    <range>
                        <int>0x1f600</int>
                        <int>0x1f640</int>
                    </range>
                </charset>
            </minus>
        </edit>
    </match>

    <!--
    Recognize legacy ways of writing EmojiOne family name.
    -->
    <match target="pattern">
        <test qual="any" name="family"><string>EmojiOne</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Emoji One</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>EmojiOne Color</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>EmojiOne Mozilla</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <!--
    Use Twemoji when other popular fonts are being specifically requested.

    It is quite common that websites would only request Apple and Google emoji fonts.
    These aliases will make Twemoji be selected in such cases to provide good-looking emojis.

    This obviously conflicts with other emoji fonts if you have them installed.
    -->
    <match target="pattern">
        <test qual="any" name="family"><string>Apple Color Emoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Segoe UI Emoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Segoe UI Symbol</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Noto Color Emoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>NotoColorEmoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Android Emoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Noto Emoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Twitter Color Emoji</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>JoyPixels</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Twemoji Mozilla</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>TwemojiMozilla</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>EmojiTwo</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Emoji Two</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>EmojiSymbols</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>Symbola</string></test>
        <edit name="family" mode="assign" binding="same"><string>Twemoji</string></edit>
    </match>
</fontconfig>
1 Like

I have an update, I’ve made a clean Manjaro KDE 20.1 install in a new computer, and the emojis appear to be working better (although with some still missing that I will screenshot once I can). Does anybody know how to replicate this behavior on an old installation?

:innocent:

Oh, nice! When I first tried I didn’t have permission to do it, it seems I can now : )