Dear Maintainer,
I am using Debian testing. Running neovim in KDE Konsole with "Hack" as
the selected font, I observed that certain Nerd Font symbols are
rendered as unrelated glyphs, although the package fonts-nerd-symbols is
installed.
For example, the following test renders four unrelated glyphs instead of
the expected icons:
printf 'Terminal: \uf120 Folder: \uf07b GitHub: \uf09b Linux: \uf17c\n'
The command
for cp in f120 f07b f09b f17c; do
printf 'U+%s -> ' "$cp"
fc-match "Hack:charset=$cp" --format='%{family} | %{file}\n'
done
produces the output
U+f120 -> UnDotum,은 돋움 |
/usr/share/fonts/truetype/unfonts-core/UnDotum.ttf
U+f07b -> UnDotum,은 돋움 |
/usr/share/fonts/truetype/unfonts-core/UnDotum.ttf
U+f09b -> UnDotum,은 돋움 |
/usr/share/fonts/truetype/unfonts-core/UnDotum.ttf
U+f17c -> UnDotum,은 돋움 |
/usr/share/fonts/truetype/unfonts-core/UnDotum.ttf
Hence, for all four code points, Fontconfig selects the UnDotum font.
The expected glyphs are available in the FontAwesome family provided by
the package fonts-font-awesome. As I understand the packaging changes
for version 3.4.0+dfsg1-1, icon sets already provided by other Debian
packages were omitted when rebuilding the Symbols Nerd Font, see
https://github.com/klondikemarlen/fonts-nerd-symbols/issues/22
If these glyph sets are intentionally supplied by separate Debian
packages, I would expect fonts-nerd-symbols either to depend on or
recommend the relevant packages and to configure them as suitable fallbacks.
The generic Fontconfig fallback list in
/etc/fonts/conf.d/65-nonlatin.conf
includes UnDotum, whereas FontAwesome is not included in the fallback chain.
As a local workaround, I added a user Fontconfig rule that places
FontAwesome after Hack in the preferred family list: Create a file
~/.config/fontconfig/conf.d/99-hack-fontawesome.conf
with the content
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>Hack</family>
<prefer>
<family>FontAwesome</family>
</prefer>
</alias>
</fontconfig>
After rebuilding the font cache via fc-cache -f
and restarting Konsole, all four icons were rendered correctly.
Could the package's Fontconfig configuration be extended so that the
fonts intended to replace omitted glyph sets are selected before
unrelated fallback fonts? If additional Debian font packages are
required, should fonts-nerd-symbols recommend or depend on them?
Thank you.