Sublime Forum

Unable to use Nerd Fonts

#1

I am currently using the Fira Code font with Sublime Text, my command prompt, and other code-related editors in Windows and it works great.

{
  "font_face": "Fira Code"
  "font_options":
  [
    "gray_antialias",
    "subpixel_antialias",
    "dlig"
  ]
}

I was trying to move to the corresponding Nerd Font so I could have additional ligature support. My understanding is they take the existing fonts and patch in additional ligatures, but it should still work. There is a patched version of Fira Code in there.

I’ve tried installing the patched fonts marked “Windows Compatible” (since I’m on Windows) - both the “mono” and non-monospaced versions (which is only an indicator of how the patched-in ligatures work, not the rest of the font) and then I tried updating the font_face to use the new font… but it doesn’t work. Instead, it reverts to a default font whenever I try it.

{
  "font_face": "FuraCode NF"
}

Now, for the font_face value I’ve tried a number of things:

  • FuraCode NF
  • Fura Code NF
  • FuraCode
  • Fura Code
  • Fura Code Regular Nerd Font Complete Mono Windows Compatible

In all but the last one, the font reverts to a different, default monospaced font.

For the last one, the font looked like it stayed pretty close to the same but it wouldn’t display ligatures.

I’ve tried the Inconsolata patched font from there, too, with no luck.

I can see the fonts in the Windows font settings/browser and I can get them to work in, say, VS Code, so I know they’re there, it’s just Sublime and the console window really arguing with me about it.

Is there something about these fonts that makes them not work with Sublime? I see articles about registry hacks to get fonts into the Windows console - is this connected?

0 Likes

#2

Likely you haven’t identified the name that Windows uses to load the font. Each platform uses slightly different fields in the font to identify the font, and I don’t recall off of the top of my head exactly how Windows does it.

In terms of ligatures, that depends on a number of factors. See https://www.sublimetext.com/docs/3/ligatures.html for more info about font options and syntax definitions. Since you’ve got the dlig option, it is possible the syntax definition is breaking the symbols up into distinct tokens.

1 Like

#3

You’re probably right about my failing to identify the font name properly. I’m not sure what else to try, but I’m open to suggestions.

I’m able to get the ligatures in Fira Code (the base font) just fine, it’s switching fonts that hoses it up… likely, as you mentioned, because I haven’t identified it to Sublime properly.

That said, in my continued research I’m finding that there may be some actual issues with the fonts and they’re not properly identifying as monospaced. Apparently there are some previously released versions that do work, so I’ll try those… but if anyone has info on how to figure out what the right text is to identify a font in Windows, I’m all ears.

0 Likes

#4

You can upload the font to https://opentype.js.org/font-inspector.html and check the naming table info.

2 Likes

#5

This could be a problem with the font_option using gdi…
Had a similar issue with a custom made Nerd Font (built over Operator Mono), once I successfully found the right name I noticed the font option switched form “directwrite” to “gdi” (had this message in console: font face “Operator ML NF” could not be used with direct write, using gdi instead). I did a test with another custom version of Operator (with just ligatures) and switching to gdi “breaks” the ligatures while directwrite renders them flawlessly.
So basically, you may have found the right name (the longest one) but you got them with gdi (and no liga)…

0 Likes

#6

I’m trying to put “DaddyTimeMono NF” (as Windows show it to be the name of the face type (did I translate that correctly?)):
image

But Sublime will only say

font face "DaddyTimeMono NF" could not be found, defaulting to "Consolas"

I tried using the full name as shown on Control Panel (below), but the same error happens again.

image

As suggested, i’ve thrown the font file on opentype.js font inspector, tried every single option to no success.

I even left a special character I use on a comment on the Preferences to keep watching… and nothing.

0 Likes

#7

This is what I did to make it work:
1- Download a Nerd Font of your choice (I used CaskaydiaCove NF; I am working in Windows, so I installed in my system the “Windows Compatible” one).
2- Sublime -> Settings: Add “font_face”: “CaskaydiaCove NF”,
3- Notice that it doesn’t work!! / calm down / next step
4- go to https://opentype.js.org/font-inspector.html and upload your font, then clik on “Naming Table” and COPY the postScriptName.
5- Sublime -> Settings: “font_face”: “CaskaydiaCoveNerdFontComplete-Regular”,
6- Note that “CaskaydiaCoveNerdFontComplete-Regular” is the postScriptName of CaskaydiaCove NF, the font I am using. Enjoy your beautiful font!!

3 Likes