pop-os / cosmic-term

WIP COSMIC terminal emulator
GNU General Public License v3.0
389 stars 71 forks source link

Unable to add Nerd Fonts #226

Open Coder-Vasen opened 4 months ago

Coder-Vasen commented 4 months ago

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

Screenshot

GrownPlanet commented 4 months ago

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: screenshot_fonts

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

luccahuguet commented 3 months ago

having this problem as well, it basically makes zellij look terrible haha

PhoenixPhantom commented 3 weeks ago

Same thing here. It'd be really cool if cosmic-term supported nerd fonts.

alexlangev commented 1 week ago

Same issue here. I want to use the 0xProto Nerd font in the Cosmic terminal and it is not an option... screenshot-2024-11-01-20-38-12

That being said, I see it as option for the system's font. screenshot-2024-11-01-20-37-07