You are not logged in.
This sounds simple enough, but I somehow can't get it to work. I want to use the glyphs from ttf-font-awesome and the text from JetBrains Mono.
My fontconfig in .config/fontconfig/fonts.conf is loaded correctly as renaming it affects the font loaded on some apps.
It looks like:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>monospace</family>
<prefer>
<family>FontAwesome6Free</family>
<family>JetBrainsMono</family>
</prefer>
</alias>
</fontconfig>
This is inspired by section 2.7.2 of https://wiki.archlinux.org/title/Font_configuration
Both FontAwesome6Free and JetBrainsMono are correctly recognized by fc-match, so I assume that's not the problem.
I am testing this with
echo "Hello " | dmenu -fn "monospace:size=18"
Where the glyph AND text from JetBrainsMonoNerdFont is used instead.
Pasting the glyph in a gtk/qt app like dolphin also uses the nerdfont
fc-match monospace --sort | head -n 10
JetBrainsMono-Regular.ttf: "JetBrains Mono" "Regular"
fa-regular-400.ttf: "Font Awesome 6 Free" "Regular"
fa-solid-900.ttf: "Font Awesome 6 Free" "Solid"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
DejaVuSansMono-Oblique.ttf: "DejaVu Sans Mono" "Oblique"
cour.ttf: "Courier New" "Regular"
dotum.ttf: "Baekmuk Dotum" "Regular"
FreeMono.otf: "FreeMono" "Regular"
fa-brands-400.ttf: "Font Awesome 6 Brands" "Regular"
Now that the rubber duck is starting to take effect, I noticed that fontawesome also ships with text, not just glyphs. Is it still possible to use the glyphs from one and text from the other?
Otherwise I suppose I could remove the text from the fontawesome ttf and it would work?
Offline
wtf do you mean by "glyphs" and "text" - fonts exclusively contain https://en.wikipedia.org/wiki/Glyph
I assume you mean some lating range vs emojis or some private use area?
This is inspired by section 2.7.2
Where does that section randomly omit blanks?
Please use the correct names you get from "fc-list".
The font substitution list is run down until a font provides the requested glyph.
No "JetBrainsMonoNerdFont" shows up in your list, but if there's a collision in the private use area, I'd just use the not-nerd variant (that doesn't have that private use glyphs) and use "Font Awesome 6 Free" as secondary.
You can test which fonts provide a specific codepoint
fc-list :charset=F025
and
FC_DEBUG=4 pango-view --font="monospace" -t "" | grep family:
to see how at least pango resolves a specific glyph.
Offline