Install Nerd Fonts To Add Glyphs In Your Code On Linux

  • Post author:
  • Post category:Tech

This short tutorial explains what the Nerd Fonts project is, how to install Nerd fonts under Linux and how to add glyphs (icons and characters) to your code or simply print icons in a shell with Nerd fonts.

Busy Fonts – The developer’s goal is to fixfonts.

Nerd Fonts is a project to create patented fonts. The wage font is a font in which a stack of symbols is inserted. Nerd Fonts takes popular software fonts and corrects them with lots of glyphs (symbols). Popular iconic fonts such as Font Awesome, Devicons, font logos, hardware design icons, powerline symbols, octicons, weather symbols and more have been added.

Nerd Fonts currently contains more than 50 ready-made fonts for developers. All patch fonts have over 3600 symbols and characters composed of popular symbol sets. The Nerd Fonts project also has a font patch script that allows you to create your own patch fonts. This is an open source project hosted in the GitHub.

Installation of botanical scripts under Linux

The installation of Nerd fonts is the same as the usual installation of fonts under Linux. Download your favorite nerd font from the official nerd font download page. Unpack the downloaded zip file and copy the fonts to the font folder of your system. The location of the font folder depends on the Linux distribution you are using.

On Debian-based systems such as Ubuntu and its derivatives, copy the font files to /usr/share/fonts/ or /usr/local/share/fonts/ to install fonts for all users, i.e. the entire system. If you want to install fonts for a specific user, copy them to ~/.local/share/fonts/location. I only wanted to install fonts for my current account, so I copied the font files to the ~/.local/share/fonts/ directory.

Custom layout of Ubuntu fonts

You can also do it from the command line, as shown below Use wget or curl to download the font files. Unzip the zip file with the unzip command and then copy the font files to the font folder with the cp or mv commands.

wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hermit.zip
$ unpack Hermit.zip
$ cp ~/Downloads/Hermit/Hurmit*.otf ~/.local/share/fonts/.

If you have many fonts, you can use subdirectories to organize your font collection.

Nerd fonts are also packaged for Arch Linux and available in the AUR. Install any botanical font using the AUR as Yay utility as shown below:

$ yay -S nerd-fonts hermit

After copying or installing fonts, run the following command to create a font information cache for applications that use fontconfig to work with fonts… :

$ fc-cache -fv

Taking samples:

/usr/share/fonts/type1 : Cache, new cache content: 0 fonts, 2 folders
/usr/share/fonts/type1/gsfonts : Cache, new cache content: 35 fonts, 0 directories
/usr/share/fonts/type1/urw-base35 : Caching, new cache content: 35 fonts, 0 directories
/usr/local/share/fonts : Caching, new cache content: 0 fonts, 0 folders
/home/sk/.local/share/fonts : Cache, new cache content: 68 fonts, 0 dirs
[…].

Construction of a font information buffer with fc cache

In the same way, you can download more fonts and move them all to the system font folder and update the font cache.

Make sure that the specific font is added or not from the command line by using the ls and grep commands:

$ ls ~/.local/share/fonts/ | grep Hurmit

Taking samples:

Hurmit Daring Nerd Font Completed by Mono Windows Compatible.otfHurmit Daring Nerd Font Completed by Mono Windows Compatible.otfHurmit Daring Nerd Font Completed by Mono Windows Compatible.otfHurmit Bold Nerd Font Completed by Mono Windows Compatible.otfHurmit Light Nerd Font Completed by Mono Windows Compatible.otfDrop Light Nerd Font Completed.otfEject Light Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject Medium Nerd Font Completed by Mono Windows Compatible.otfEject

Use this command to list all available fonts in your system:

List of fonts

Adding glyphs to the code using Nerdfonts

Once nerd fonts are added to your system, you can use them literally anywhere on your system. I tried nerd fonts in Deepin Terminal, GNOME Terminal, gedit, and Gimp. Everything worked well, and I can add different kinds of symbols and characters to the text and code.

Go to the Nerd Fonts page, where you will find many symbols and characters, and choose the symbol you want to use. There is a search string for a specific symbol or icon that will help you find it quickly. To display all available symbol sets, place the mouse pointer in the search bar and press ENTER.

Botanists’ fonts p.Botanists’ fonts p.Botanists’ fonts p.Botanists’ fonts p.Botanists’ fonts p.Botanists’ typeface p.Botanists’ fonts

To copy an icon or symbol, point the mouse to the icon, class or hexadecimal code and click on the icon, class or hexadecimal code to copy it.

Cheating with icons and symbols Botanist FontsCopy the cheating icons and symbols Botanist FontsCopy the cheating icons and symbols Botanist FontsCopy the cheating icons and symbols Botanist Fonts

Stick the copied symbol wherever you want.

You can also copy the class and paste the code into your CSS or HTML code. Here are two examples for your information.

Besides, I really use
.

Printing of icons and symbols in the shell with nerd fontsScripts

If you don’t want to copy the glyphs of the Nerd Fonts cheat, use the Nerd Fonts scripts to print the symbols/characters directly into your shell, and then copy them into your code or anywhere else.

Download the scripts offered here and save them as ~/.local/share/fonts/. I’m going to download the Linux font icons with the command

$ wget https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/bin/scripts/lib/i_linux.sh -P ~/.local/share/fonts/.

The source of the download script:

Source ~/.local/share/fonts/i_linux.sh

Check that you can print the symbols in the terminal using one of the following commands:

echo $i_linux_archlinux
$ echo $i_linux_centos
$ echo $i_linux_debian
$ echo $i_linux_fedora
$ echo $i_linux_ubuntu

Printing Nerd Icons and Schelps Symbols

As already mentioned, there are currently more than 50 corrected fonts available. If your favorite font has not yet been determined, you can do it with Nerd Fonts’ Font Patcher. More information can be found under the project links below.

Source:

Sounds like reading:

Related Tags:

hack nerd font arch,monaco nerd font,nerd-fonts aur,download hack font patched,cheat sheet nerd fonts,alacritty nerd font,windows terminal nerd font,hack nerd font vscode,powerlinesymbols,nerdy fonts,meslo font,how to install nerd fonts windows,powerlevel9k,vim-devicons,oh my posh,hack font,cascadia code,nerd fonts windows,how to use nerd fonts,cascadia code nerd font,fira code nerd font,nerd font cheat sheet,arch nerd-fonts,meslo nerd font