How to Add New Fonts in Linux: A Complete Guide for User

how-to-add-new-fonts-in-linux

Adding new fonts to Linux operating system allows you to enhance the appearance of documents, websites, and user interfaces. This guide will lead you through how to install new fonts on Linux, covering both system-wide and user-specific installations. I’ll also explore how to install fonts manually and via package managers.

Method 1: Install Fonts Manually

If you’ve downloaded a font (in .ttf, .otf, or .ttc format), follow these steps to install it.

Step 1: Download Fonts

You can download fonts from trusted sources like:

Step 2: Create a Fonts Directory

To install fonts for the current user only, create a ~/.fonts directory:

mkdir -p ~/.fonts

For system-wide installation (available to all users), create or use /usr/local/share/fonts:

sudo mkdir -p /usr/local/share/fonts

Step 3: Copy the Font Files

Move the downloaded .ttf or .otf files to the appropriate directory.

For current user:

cp ~/Downloads/*.ttf ~/.fonts/

For system-wide:

sudo cp ~/Downloads/*.ttf /usr/local/share/fonts/

Step 4: Refresh the Font Cache

Update the system font cache to recognize the new fonts:

fc-cache -fv

Method 2: Install Fonts via Package Manager

Many popular fonts are available in your distribution’s repositories. You can install them using the package manager.

Install on Debian/Ubuntu-based Systems

sudo apt update
sudo apt install fonts-firacode fonts-noto fonts-roboto -y

Install on Fedora-based Systems

sudo dnf install fira-code-fonts google-noto-sans-fonts roboto-fonts -y

Install on Arch-based Systems

sudo pacman -S ttf-fira-code noto-fonts ttf-roboto

Method 3: Install Google Fonts Using Font Manager

Google Fonts offers a vast collection of open-source fonts. You can install and manage these using a tool like Font Manager.

Step 1: Install Font Manager

On Ubuntu/Debian:

sudo apt install font-manager -y

On Fedora:

sudo dnf install font-manager -y

Step 2: Install Fonts with Font Manager

  1. Open Font Manager from the application menu.
  2. Click + (Add) to install new fonts.
  3. Select your downloaded fonts and install them.

Method 4: Verify and Use Installed Fonts

Once installed, you can verify that the fonts are available using:

fc-list | grep 'FontName'

How to Use Installed Fonts in Applications

  • LibreOffice: Open any LibreOffice document, click Format > Character, and select your new font from the font list.
  • GIMP: In GIMP, go to Text Tool, and you’ll see the installed fonts listed.
  • VS Code: Open Settings in VS Code, search for “Font Family,” and type the name of the newly installed font.
Thats it.