cosmic-term
cosmic-term copied to clipboard
Unable to add Nerd Fonts
I am new to cosmic environment. The terminal in cosmic environment looks great however I use nvChad as my everyday tool. NvChad uses Nerd fonts but in cosmic terminal I couldn't able to find a way to change my terminal font to nerd font. It is showing options only with pre-loaded fonts inside the View > Settings > Font
This is probably because they don't have normal and bold wights and a Stretch::Normal face. When commenting out the code in the file main lines 1348 until 1356 my nerd fonts show up in the config!
src/main.rs line 1345
// only keep fonts that have both NORMAL and BOLD weights with both having
// a `Stretch::Normal` face.
// This is important for fallbacks.
font_name_faces_map.retain(|_, v| {
let has_normal = v
.iter()
.any(|face| face.weight == Weight::NORMAL && face.stretch == Stretch::Normal);
let has_bold = v
.iter()
.any(|face| face.weight == Weight::BOLD && face.stretch == Stretch::Normal);
has_normal && has_bold
});
font_name_faces_map
here you can see the fonts showing up:
Maybe you could try to install the font's bold and normal styles? edit: I tried it with a nerd font and that works :) edit 2: also make sure you have a mono-spaced font
having this problem as well, it basically makes zellij look terrible haha
Same thing here. It'd be really cool if cosmic-term supported nerd fonts.
Same issue here. I want to use the 0xProto Nerd font in the Cosmic terminal and it is not an option...
That being said, I see it as option for the system's font.
Thanks @GrownPlanet for posting the solution!
Since I hit a few snags along the way and others seem to struggle as well, I would try to add a little more guidance:
NerdFonts come in different varieties and even if their names contain Mono, as in JetBrainsMono, it does not mean that all their varieties are strictly mono-spaced, so COSMIC Term will not recognize them (see @GrownPlanet's explanation and here).
One way to pick the right varieties is using the install script.
Download install.sh and your preferred font(s).
Now you will have to imitate the directory structure. It should look like this:
nerd-fonts-or-your-preferred-name/
├─ install.sh
├─ patched-fonts/
│ ├─ CascadiaCode/
│ ├─ CascadiaMono/
│ ├─ JetBrainsMono/
│ ├─ ...
Where JetBrainsMono is just the untared folder from JetBrainsMono.tar.xz from the release page.
Now you can simply install the fonts:
# user
./install.sh -s JetBrainsMono CascadiaCode CascadiaMono
or
# system-wide
sudo ./install.sh -s -S JetBrainsMono CascadiaCode CascadiaMono
The key here is -s. This chooses the strictly mono-spaced version which will be recognized by COSMIC Terminal.
@randomchars42 For NvChad, it is a requirement to use a non-monospace version of a NerdFont. In gnome-terminal, which is used in Pop_OS 22.04, non-monospace Nerd Fonts are recognized. So I think they should be able to be recognized in cosmic-term as well.
I am also experiencing this issue and it's the main thing preventing me from switching to cosmic terminal fully.
I am also experiencing this issue and would like more font options.
Thanks @randomchars42 and @GrownPlanet for posting the solution! Worked for me.
@Coder-Vasen It seems to work now on the latest version of cosmic-term. Does it work for you?
@Coder-Vasen It seems to work now on the latest version of cosmic-term. Does it work for you?
I use arch btw ;)