Skip to content

A repo with the fonts I use for Shells and Programming, most of them with Ligatures and Powerline support!

Notifications You must be signed in to change notification settings

BoscoDomingo/best-coding-fonts

Repository files navigation

Best Coding Fonts

A repo with the fonts I recommend for Shells and Programming, most of them with Ligatures and Powerline/NerdFont glyphs (icons) support!

Note: The fonts included in this repo are ones I've patched or are worth keeping as a backup. If I use the base Nerd Font, I will try to simply link to the original author's repo/website.

Table of Contents

  1. Font Names (in alphabetical order):
  2. Which font?
  3. VS Code
  4. Great places to find more fonts
    1. (Mostly) Only ligatures -> can apply the Nerd Fonts' Patcher for glyphs/icons
    2. (Mostly) Glyphs/Icons -> can apply Ligaturizer
  5. Using the Nerd Fonts' Patcher
    1. Windows/WSL
    2. Linux/MacOS
      1. Gyphs/Icons (Nerd Font patcher)
      2. Ligaturizer

Font Names (in alphabetical order):

USE QUOTES ('') IN FONTS THAT HAVE A + IN THEIR NAME IF THEY GIVE YOU ERRORS

0xProto: '0xProto v1.6 Ligaturised NF', '0xProto v2 Ligaturised NF', '0xProto v2 NF', '0xProto v2 Nerd Font'

No ligatures (forgot to take screenshots after patching):
v1.6 Ligaturised: v2 Ligaturised: v2 Nerd Font:

Cascadia Code: Cascadia Code NF, Cascadia Code PL <- Both should include ligatures, but NF has more icons. You may want another font as a backup in any case

Code New Roman: Code New Roman NF Ligaturized

Consolas: Consolasligaturizedv2 NF, ConsolasLigaturizedV3 Nerd Font

There's barely any differences, so I only took one screenshot:

Cousine: 'FiraCode+Cousine NF'

DejaVuSans: DejaVuSansCode NF

Fragment Mono: FragmentMono Nerd Font, Fragment Mono Regular

Geist Mono: GeistMono Nerd Font

Hack: 'FiraCode+Hack NF'

Hasklig: Hasklug NF

Inconsolata NF g: 'FiraCode+Inconsolata NF g'

Inconsolata: 'FiraCode+Inconsolata NF'

InconsolataGo Nerd Font: InconsolataGo Nerd Font

JetBrains Mono: JetBrainsMono NF

Julia Mono: JuliaMono

Lilex Nerd Font: Lilex Nerd Font

Maple Mono: Maple Mono V7 NF, Maple Mono v6 Ligaturised NF, Maple Mono NF

I personally use v7, but v6 is quite great too.
v6: v7:

NotoMono Nerd Font: NotoMono Nerd Font

Roboto Mono: 'FiraCode+RobotoMono NF'

SF Mono Ligaturised: SF Mono Ligatures

SF Mono Powerline: SF Mono Powerline

UbuntuMono: 'FiraCode+UbuntuMono NF'

Which font?

From Nerd Fonts' documentation:

  • If you are limited to monospaced fonts (because of your terminal, etc) then pick a font with Nerd Font Mono (or NFM).
  • If you want to have bigger icons (usually around 1.5 normal letters wide) pick a font without Mono i.e. Nerd Font (or NF). Most terminals support this, but ymmv.
  • If you work in a proportional context (GUI elements or edit a presentation etc) pick a font with Nerd Font Propo (or NFP).

VS Code

VS Code's integrated terminal will use icons from the fonts you provide in the order provided. That is, if the first font doesn't have the icon you want, it will fall back to the second font, and so on. That's why it's crucial to provide at least one fallback font. Nerd Fonts provides such font, but it's not included in the repo and I haven't found it useful. I personally always use Consolas ligaturized v2 NF as my fallback font. E.g.

"editor.fontFamily": "Your font,Consolasligaturizedv2 NF,monospace"

Great places to find more fonts

(Mostly) Only ligatures -> can apply the Nerd Fonts' Patcher for glyphs/icons

(Mostly) Glyphs/Icons -> can apply Ligaturizer

Using the Nerd Fonts' Patcher

This is more for me than for you, but I've included the steps I use to patch the fonts in this repo.

Windows/WSL

I have tried on Windows but FontForge is a pain to use, so in case you want to recreate what I did I suggest using Linux or at least WSL, which is far easier.

Linux/MacOS

Gyphs/Icons (Nerd Font patcher)

Optionally you can get it from Nerd Font's website or from the repo.

# Pre-requisites
sudo add-apt-repository ppa:fontforge/fontforge -y
sudo apt update -y
sudo apt install software-properties-common python3-fontforge -y
brew install python-setuptools fontforge # or the alternative for your Linux distro

# Download and extract manually, then
cd Downloads/FontPatcher/
# Or
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FontPatcher.zip
unzip FontPatcher.zip -d font-patcher
cd font-patcher
# Or
git clone --depth 1 https://github.com/betaboon/nerd-fonts-patcher.git
cd nerd-fonts-patcher

# Then run:
fontforge -script ./font-patcher -l -c --careful -out /path/to/output_dir --ext otf /path/to/font
# And the new files should be in the output folder chosen

# Example (in WSL)
fontforge -script ./font-patcher -l -c --careful -out ./patched-fonts --ext otf /mnt/d/Users/Bosco/Downloads/Fonts/0xProto/0xProto-Regular.otf

# You can drop the --careful if you want to override the existing icons

You can use the ./patch-fonts.sh script to patch all the fonts contained in a folder. Play around with it if you desire.

The other option is using Docker, as per the font-patcher's README. This may probably be easier and faster, but I haven't tried it.

# To obtain the ligatures
git clone --recurse-submodules https://github.com/ToxicFrog/Ligaturizer.git

# Do not remove any of the fonts in `fonts/`, they're needed for the ligaturizer to work

# Make sure to move the fonts you want changed into their own folder in Ligaturizer/fonts
# e.g. Ligaturizer/fonts/Code New Roman/

# Add them to build.py, whether on the prefixed_fonts or renamed_fonts. e.g
# build.py
renamed_fonts = {
  'fonts/Code New Roman/*.otf': 'Code New Roman NF Ligaturized',
}

# Then run
make

# And the files should be in the output folder with the correct name