Nerd-fonts: Include space in source / icons-only font

Created on 4 Jun 2018  ยท  11Comments  ยท  Source: ryanoasis/nerd-fonts

๐Ÿ—น Requirements

  • [x] A brief but descriptive _title_ of your issue
  • [x] I have searched the issues for my issue and found nothing related and/or helpful
  • [x] I have read or scanned the FAQ
  • [x] I have read or scanned the Wiki

๐ŸŽฏ Subject of the issue

I admire this project, having one font with all icons is simply perfect. However what I'm missing and what I would like to request is a pure icons-only font, a font with no latin characters and other stuff, but only icons in private use area (maybe also space character 0020 is needed).

There are a couple of reasons to have such font.

Firstly, the "original" fonts tend to use the same code points, and thus overlap โ€” for example, both Font Awesome and Material Design Icons start with code f000, so it is impossible to install two fonts and use icons from both fonts in the same place.

Secondly, some apps do a very cool trick and allow selecting a special font only for a certain code points range โ€” kitty terminal is one such example. The reason is that you don't have to patch fonts anymore, you can use your favorite coding font and an icons-only font simultaneously. It makes it super easy to change fonts and keep all the cool icons with no effort spent.

Lastly, I noticed you are not providing patched versions of some proprietary fonts due to licensing issues. This tends to be a burden for users of such fonts, as they need to re-patch their fonts with every new release. Having an icon-only font could be a much more pleasant way for these users to enjoy the power of Nerd Fonts.

๐Ÿ”ง Your Setup

  • _Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?_ N/A
  • _Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)?_ kitty
  • _Are you using OS X, Linux or Windows? And which specific version or distribution?_ Arch Linux

Most helpful comment

Yes, that's what I was looking for, thanks @ryanoasis! I have two requests to make the experience nicer:

  1. Can you start including this font in the Github releases? This would simplify packaging by a lot, e.g. I would like to create an AUR package for Arch Linux.

  2. Can we add space character in this font, the symbol u0020? I noticed that Font Awesome has it, and if I try to use the current Nerd Font symbol font in i3status to render ๏‚„, I get this:

    image

All 11 comments

@maximbaz Appreciate your layout and description here.

Unless I am misunderstanding the Nerd Font symbol font in the src is what you are looking for?

If so then that is cool but perhaps we aren't making it obvious :worried: , if not then I misunderstood :blush:

I admire this project, having one font with all icons is simply perfect.

Thanks

Firstly, the "original" fonts tend to use the same code points, and thus overlap โ€” for example, both Font Awesome and Material Design Icons start with code f000, so it is impossible to install two fonts and use icons from both fonts in the same place.

Right yep so many conflicts between glyph sets.

Yes, that's what I was looking for, thanks @ryanoasis! I have two requests to make the experience nicer:

  1. Can you start including this font in the Github releases? This would simplify packaging by a lot, e.g. I would like to create an AUR package for Arch Linux.

  2. Can we add space character in this font, the symbol u0020? I noticed that Font Awesome has it, and if I try to use the current Nerd Font symbol font in i3status to render ๏‚„, I get this:

    image

:+1: on the space glyph. This happens in a lot of Linux programs because one of the largest font rendering platforms (Pango) assumes that all fonts have spaces in them so their fallback algorithms don't run when encountering control characters like spaces.

Bug reports:

Many other symbol fonts have this same issue reported to them, which you can find by searching for "icon space missing".


@maximbaz - I can recommend you to install the ttf-nerd-fonts-symbols AUR package to get only the Symbol font straight via the package manager. That's how I do it. I use arch btw

Thanks for telling me about ttf-nerd-fonts-symbols, I use Arch too and yet I somehow missed this package!

By the way, I was told in #268 that the symbol font is not monospace, so it doesn't work in some terminals anyway ๐Ÿ˜ž

Maybe that is specific to some terminal emulators but it works perfectly well for me in pango-based software, like polybar, i3status, termite, rofi, gnome software, etc.

You might need to add a custom font config. Here is mine https://github.com/Mange/dotfiles/blob/master/snowflakes/fonts-conf.d/90-fallbacks.conf

(More or less) just for reference: urxvt/rxvt-unicode cannot load the symbol-only font, because it contains none of the chars that it uses to test the width (https://github.com/exg/rxvt-unicode/blob/0767fe71f667f5be4e8967ca6ea27e2b14c19daf/src/rxvtfont.C#L157-L161).

And with kitty the missing space is problematic (like mentioned already), since it gets rendered as boxed 0020 (missing glyph).

@ryanoasis
Please add a space to the source font. I've done so manually using fontforge, but I am certainly not knowing what I am doing, so will not create a PR for this myself.

@blueyed please give me a quick rundown of how you did it and I'll try to clean it up and open a PR.

Or at least fix my desktop just for myself. ๐Ÿ˜…

@Mange
Opened the ttf with fontforge, then opened another one (one of the patcched fonts), and copied the space glyph from there. Then saved it as a new .ttf. It changed the name (removed spaces IIRC). You can use fc-query โ€ฆ.ttf to query it afterwards.

I made a try at #297.

Perhaps this can be closed?

Pango 1.44 does not have this issue anymore.
https://blogs.gnome.org/mclasen/2019/07/27/more-text-rendering-updates/
โ€”https://github.com/ryanoasis/nerd-fonts/pull/297#issuecomment-535810676

Great, thanks for the update!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aswinmohanme picture aswinmohanme  ยท  4Comments

jinmel picture jinmel  ยท  6Comments

gitfool picture gitfool  ยท  3Comments

alpertuna picture alpertuna  ยท  5Comments

parkerbxyz picture parkerbxyz  ยท  4Comments