How to install custom Fonts in Debian

All operating systems come with a large set of fonts already installed in them. However, sometimes, you may need a new font that is not available in the preinstalled fonts. In that case, you will need to manually download and install that font in your system.

This article is about explaining how to download and install a new font on your Debian system. However, try not to install too many fonts as they might slow down your system.

We will use Debian 10 for running the commands and procedures mentioned in this article.

Viewing Fonts Installed on Debian

You can view the fonts installed in our system using the LibreOffice Writer application. Open the LibreOffice Writer and click the drop-down arrow to view the fonts as shown in the following screenshot. When the drop-down appears, you will see a list of fonts that are preinstalled in the system.

You can also view all the fonts on a system through the Gnome fonts. Hit the super key on your keyboard and search for the Gnome Fonts using the fonts keyword. When the icon appears as follows, click on it to open.

When Gnome Fonts will open, you will see all the fonts that are available on your system.

Installing a new Font on Debian

Follow the below steps to install a new font on your system.

Step 1: Download a font file from the internet

To download the new font from the internet, there are two ways that are from a web browser and the command line.

1. Using a web browser

Open any web browser in your system and go to any website for downloading fonts such as https://www.1001freefonts.com/. Find your desirable font by clicking the Download button. The downloaded file will be saved as .zip file in your Downloads directory.

2. Using the Command-Line Terminal

You can also use the Terminal application in order to download fonts from the website. To open the Terminal application, go to the Activities tab in the top left corner of your desktop, then by using the search bar, search for the Terminal. When the result appears, click on the Terminal icon.

When the Terminal opens, run the following command in it to download the font from the www.1001freefonts.com website. If you are downloading from another website, then replace the link with the link to that website.

$ wget -O ~/Downloads/dephiana.zip https://www.1001freefonts.com/d/25249/dephiana.zip

Once downloaded, it will be saved in your Downloads directory. Then run the following command to unzip the downloaded file.

$ unzip -p ~/Downloads/lemon-brush.zip lemon-brush.ttf > ~/Downloads/lemon-brush.ttf

Once downloaded, it will be saved in your Downloads directory. Then run the following command to unzip the downloaded file.

$ unzip -p ~/Downloads/lemon-brush.zip lemon-brush.ttf > ~/Downloads/lemon-brush.ttf

Step 2: Download Font Manager

The next step will be to download the Font Manager. Font manager provides an easy way to install and manage fonts in your system. To download the Font Manager, you can either use the Software center or the command line Terminal.

If you want to use the Terminal, then use the following command in order to install the font manager.

$ sudo apt update && sudo apt -y install font-manager

Once installed, you can access the font manager by hitting the super key and searching for the font manager using the fonts keyword. When the result appears, click on the Font manager icon to open it.

Step 3: Install a Downloaded Font

In this step, we will install a font using the Font manager. Click the "+" button on the top bar of the Font Manager window as shown in the following screenshot.

Then add the .zip file from the Downloads directory. By doing so, the selected font will be installed on your system.

To verify if the new font has been successfully installed on your system, open LibreOffice writer application. Now, you will find the newly installed font in the LibreOffice Writer.

Install Fonts for all users on Debian

The above-installed fonts are only available for the user who has installed it. To allow the font to be used by all users, run the following command in Terminal:

$ sudo mkdir /usr/local/share/fonts/example

Enter the password for sudo and then run the following command:

$ sudo cp ~/Downloads/dephiana.ttf /usr/local/share/fonts/example/

That is all there is to it! This was a brief overview of how to download and install any font in your system. I hope it will be helpful whenever you need to use any font that is not available in your system.