My dmenu is not able to detect the noto color emoji font. It can detect other fonts but not this one. How to solve this?
➜ fc-list | grep -i "notocoloremoji"
/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular
➜ dmenu -fn "Noto Color Emoji"
no fonts could be loaded.
Several suckless tools like
dmenu
andst
use a library calledlibxft
to handle font rendering. This library has a bug that prevents it from rendering color fonts. Fortunately, this bug has actually been fixed, but for whatever reason hasn't been merged upstream. So, to get color fonts working you need to install this patched version oflibxft
and then remove a check indmenu
that manually disables colored fonts (because of this bug). I've written the manual steps for doing this below, but as an easier solution you can just install this fork ofdmenu
that does this for you: https://github.com/valeriangalliat/dmenumojiManual Steps
On arch linux you can install a patched version of
libxft
(replacing the old version) with this package: libxft-bgra. On other distros you'll need to download the source for libxft, apply the patch, and then manually compile and install the patched version of libxft.Once you've got the patched library you need to edit dmenu's source to remove the code that disables (formerly broken) color fonts. This check is near the top of
drw.c
and looks like this:Remove this bit of code and recompile dmenu and you'll be able to use color fonts! Here's a blog post.