I want to use UbuntuMono Nerd Font as my main terminal font but render emoji characters using Noto Color Emoji. I have configured LXTerminal to use font UbuntuMono Nerd Font.
I can see the primary and first fallback font files for this font with:
~ > fc-match "UbuntuMono Nerd Font" -s | head -n 2
Ubuntu Mono Nerd Font Complete.ttf: "UbuntuMono Nerd Font" "Regular"
fa-brands-400.ttf: "Font Awesome 6 Brands" "Regular"
To use Noto Color Emoji as the preferred fallback font for emoji characters not within UbuntuMono Nerd Font, I configure ~/.config/fontconfig/fonts.conf as follows:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>UbuntuMono Nerd Font</family>
<prefer>
<family>Noto Color Emoji</family>
</prefer>
</alias>
</fontconfig>
With this config, the output of fc-match indicates to me that this should work!
~ > fc-match "UbuntuMono Nerd Font" -s | head -n 2
Ubuntu Mono Nerd Font Complete.ttf: "UbuntuMono Nerd Font" "Regular"
NotoColorEmoji.ttf: "Noto Color Emoji" "Regular"
But it doesn't: '' is rendered within LXTerminal as a black & white smiley.
I have also tried using <match> elements:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="lang" compare="eq">
<string>und-zsye</string>
</test>
<edit name="family" mode="prepend_first" binding="strong">
<string>Noto Color Emoji</string>
</edit>
</match>
</fontconfig>
The only way I can get the coloured '' to render is by blacklisting all other fonts. Why is a less precedent font overruling Noto Color Emoji when the output of fc-match is listing it as the preferred fallback?