Fonts fonts fonts ..and fonts. On VoidLinux while using DWM window manager and a desire to use that fancy icons, emoji, glyphs
So what’s the plan
To use and see symbols, icons, glyphs like or this or this 📶 specific fonts have to be installed. What should be a trivial task from first view sometimes can be very tramedous task and time consuming job.
Basic install of VoidLinux does not iclude much of fonts for fancy symbols display. While installing X server /Xorg/ it is recommended to install x fonts metapackage
However this is not enough for rendering and displaying emoji and other specific symbols.
To have max symbols, icons, emoji rendering and displaying coverage do
install fonts
|
|
set-up fonts config file
sudo nvim /etc/fonts/local.conf # nvim editor (change to vim, or nano, or whatever)
add the following configs to
/etc/fonts/local.conf*
|
|
Install Xorg’s tool xrdb
to setup some X fonts’ specific configs in .Xresources
file.
sudo xbps-install -S xorg-xrdb
add the following to ~/.Xresources
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
and run command xrdb -merge ~/.Xresources
.
Create required symbolic links for text rendering effects to work:
sudo ln -s /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/
sudo ln -s /usr/share/fontconfig/conf.avail/10-hinting-slight.conf /etc/fonts/conf.d/
sudo ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/
Refresh the font cache files by running the following command.
sudo fc-cache -fv && fc-cache -fv
Add font definition to DWM’s config file (config.h
or config.def.h
)
static const char *fonts[] = { "JetBrainsMono Nerd Font Mono:size=10:antialias=true:autohint=true" };
static const char dmenufont[] = "JetBrainsMono Nerd Font Mono:size=10";
Now rebuild and reinstall DWM
make && sudo make install
Update X start configs to get fonts for Xord
add to .xinitrc
xrdb -merge ~/.Xresources
# prepend fonts' paths to know by X
xset +fp $HOME/.local/share/fonts
xset fp rehash
Reboot.
Problems
Disk size
The Font JetBrainsMono of Nerd Font group is located in package nerd-fonts
. The installation of this package will consume ~ 11G of disk. Too much for just having nice symbols and icons. So there should be options to:
use different symbols, icons, emoji, which is included in another font’s package
install separatelly just required font like JetBrainsMono and not to install whole nerd-fonts group of fonts
use/find any other fonts group alternative which encompasses glyphs for rendering required symbols and icons
Used materials
Arch Linux Font Improvement Guide
Tuning Fontconfig on Linux From Scratch Docs
stackexchange: Determine missing font for a specific unicode character
superuser: How to check which font the system uses?
reddit: Does anyone have an example of a “dwm” config.h “nerd-font” that I can copy? :/