Nerd-fonts: Nerd fonts are not shown in gnome terminal and gvim font selection list

Created on 23 Jan 2019  Â·  7Comments  Â·  Source: ryanoasis/nerd-fonts

🎯 Subject of the issue

The cause should be that nerd fonts have proportional spacing property for mono spacing fonts. See attached image.

🔧 Your Setup

  • _Tried a lot of mono fonts_
  • _Using gnome terminal_
  • _Using Ubuntu_

★ Optional

2019-01-23 17-56-42

Most helpful comment

i run into some similar issue and i believe the problem is nerd fonts does not declare spacing.
powerline font has no problem to be used in gvim but nerdfont simply show double width.

diff -u <(fc-query -b Hack\ Regular\ Nerd\ Font\ Complete\ Mono.ttf) <(fc-query -b Hack-Regular.ttf) 
--- /dev/fd/63  2019-02-08 14:05:53.641296122 -0800
+++ /dev/fd/62  2019-02-08 14:05:53.641296122 -0800
@@ -1,15 +1,16 @@
-Pattern has 22 elts (size 32)
-   family: "Hack Nerd Font Mono"(s)
+Pattern has 23 elts (size 32)
+   family: "Hack"(s)
    familylang: "en"(s)
    style: "Regular"(s)
    stylelang: "en"(s)
-   fullname: "Hack Regular Nerd Font Complete Mono"(s)
+   fullname: "Hack Regular"(s)
    fullnamelang: "en"(s)
    slant: 0(i)(s)
    weight: 80(f)(s)
    width: 100(f)(s)
+   spacing: 100(i)(s)
    foundry: "SRC"(s)
-   file: "Hack Regular Nerd Font Complete Mono.ttf"(s)
+   file: "Hack-Regular.ttf"(s)
    index: 0(i)(s)
    outline: True(s)
    scalable: True(s)
@@ -17,7 +18,7 @@
    capability: "otlayout:DFLT otlayout:latn"(s)
    fontformat: "TrueType"(s)
    decorative: False(s)
-   postscriptname: "HackNerdFontCompleteM-Regular"(s)
+   postscriptname: "Hack-Regular"(s)
    color: False(s)
    symbol: False(s)
    variable: False(s)

the thing that matters is spacing: 100(i)(s)

All 7 comments

I've been experiencing the same issue on Ubuntu 18.10. The issue seems to be that the Gnome Terminal application only accepts monospaced fonts and for some reason it's not recognizing these fonts as monospaced.

A possible temporary workaround is to set the system font to whichever font you want and then tell the Terminal application to use the system font instead of a custom font.

i run into some similar issue and i believe the problem is nerd fonts does not declare spacing.
powerline font has no problem to be used in gvim but nerdfont simply show double width.

diff -u <(fc-query -b Hack\ Regular\ Nerd\ Font\ Complete\ Mono.ttf) <(fc-query -b Hack-Regular.ttf) 
--- /dev/fd/63  2019-02-08 14:05:53.641296122 -0800
+++ /dev/fd/62  2019-02-08 14:05:53.641296122 -0800
@@ -1,15 +1,16 @@
-Pattern has 22 elts (size 32)
-   family: "Hack Nerd Font Mono"(s)
+Pattern has 23 elts (size 32)
+   family: "Hack"(s)
    familylang: "en"(s)
    style: "Regular"(s)
    stylelang: "en"(s)
-   fullname: "Hack Regular Nerd Font Complete Mono"(s)
+   fullname: "Hack Regular"(s)
    fullnamelang: "en"(s)
    slant: 0(i)(s)
    weight: 80(f)(s)
    width: 100(f)(s)
+   spacing: 100(i)(s)
    foundry: "SRC"(s)
-   file: "Hack Regular Nerd Font Complete Mono.ttf"(s)
+   file: "Hack-Regular.ttf"(s)
    index: 0(i)(s)
    outline: True(s)
    scalable: True(s)
@@ -17,7 +18,7 @@
    capability: "otlayout:DFLT otlayout:latn"(s)
    fontformat: "TrueType"(s)
    decorative: False(s)
-   postscriptname: "HackNerdFontCompleteM-Regular"(s)
+   postscriptname: "Hack-Regular"(s)
    color: False(s)
    symbol: False(s)
    variable: False(s)

the thing that matters is spacing: 100(i)(s)

https://unix.stackexchange.com/questions/363365/command-to-list-all-monospace-fonts-known-to-fontconfig

The command fc-list can list all available fonts according to their properties. In your case one needs to search for the spacing corresponding to mono, that would be 100, so fc-list :spacing=100. Simpler form fc-list :mono should probably work too.

Is there any solution for this issue ? Beside the fact that they aren't recognised by the terminal the horizontal spacing is horrible!

As a workaround, is there something we can add to the fontconfig fonts.conf file to set the spacing appropriately?

As a workaround, on pop os, I used dconf to force it.

I copied the otf files to ~/.local/share/fonts

and then ran:
dconf write /org/gnome/terminal/legacy/profiles:/\/font "'Fura Mono NF 12'"

(you can tab complete the directory path, or do "dconf list /org/gnome/terminal/legacy/profiles:/" to find your profile id).

@lmagomes it works, thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fornwall picture fornwall  Â·  5Comments

blueyed picture blueyed  Â·  6Comments

maxwellmckinnon picture maxwellmckinnon  Â·  3Comments

ffernand picture ffernand  Â·  4Comments

boolim picture boolim  Â·  4Comments