Install Fonts in Linux

Installing Fonts In A Linux System

Installing fonts in Linux is actually pretty straightforward. There are three mains ways that this can be done.

1. Software Repository

Have a look in your distribution’s software repository/store/manager or whatever they call it. You may find that there are bundles of fonts in there. Looking in the distribution that I am using right now - Linux Mint, I can see various packages including a Microsoft True Type core fonts bundle, this installs some of the most popular Microsoft fonts.

Mint Software Centre

Though when I look in Ubuntu’s own software centre, when you do a search for “font” you do have to scroll though a number of apparently, unrelated packages before you get to something about fonts. Then there are a number of font manager type applications before I get to the actual fonts. There are a bunch of fonts in there, you just have to scroll down a bit.

Download & Install

The next two methods call for you to download the font from a website, then install then onto your system. So, how do you find and download fonts for Linux?

Well, start by doing an online search, there are loads and loads of sites that allow you to download fonts, just use a search engine. There is no need to append the search with “linux” as fonts are generally not OS dependant.

Fonts Search

Or you can look for a specific type of font for example, if I need an outlined font:

Outline Font Search

Pick a site, have a look and they are mostly laid out pretty clearly, though some have a few too many adverts and pop-ups. As you can see on this site (1001FreeFonts.com) it is all easy to navigate. Just pick a font to download.

Font Website

They are frequently compressed into a .zip file, so you will need to extract them first. Sometimes there are multiple files for the one font, and sometimes only one file. It depends in the font developer if they have made various versions such as italic, bold etc.

Now, how to install them:

2. Install with A GUI Font Manager

Some Linux distributions come with a font manager already installed, so you can download fonts from various places online and install them on your system using the graphical font manager. The main Ubuntu distribution comes with “Gnome Fonts”, Linux Mint Cinnamon edition’s manager appears to be simply called “Fonts”, as does Fedora’s. Looking at Manjaro KDE edition, they have a “Font Management” application, which appears to be a built-in KDE application. You can install your own font manager if your distribution doesn’t come with one.

Installing A Font

So, you have downloaded a font and extracted it, now to install. Just right click on the font and choose the option to install:

Install Fonts 1

When your font manger opens (it will look different for each font manager) choose to install:

Install Fonts 2

That’s it, your fonts are installed.

3. Command Line Install

Not as complicated as it sound to new users, you are really just copying the downloaded fonts to a folder.

There are a few places that Linux stores fonts for:

  • User Fonts
  • All User’s Fonts
  • System Fonts

User Fonts

These are fonts available for one user only, you would use this if you are the only person to use this computer and nobody else that logs on with their own account. Or, if you only want the font to be available to you and not any other users who uses that computer.

The directory for user fonts is:

~/.local/share/fonts

NOTE: If you didn’t know, the tilde ~ means your home directory. In my case /home/paul

This directory may or may not exist on your system. If it doesn’t you can create it in your terminal by:

mkdir -p ~/.local/share/fonts

Now you have that directory, copy your downloaded font to it. I will use the example of the font I downloaded above. I am assuming that I have the extracted font directly in my “Downloads” folder.

cp ~/Downloads/AgentOrange.ttf ~/.local/share/fonts/

A Side Note About File Organisation The ‘Linux Way’ is to have things well organised in a logical way. Though, just copying a font directly to this folder will work just fine, if you were going to copy a number over like this, you may want to organise them a bit. For example, this is a True Type Font as we can tell from it’s extension (.ttf). So, you can organise different font types into different directories - true types into their own sub-directory, open fonts into their own sub-directory etc. This is not obligatory, just a suggestion as it will work either way. If we were going to do that, then you would create your sub-directory and copy your font to that e.g.

mkdir -p ~/.local/share/fonts/truetype
cp ~/Downloads/AgentOrange.ttf ~/.local/share/fonts/truetype/

Now that your font is copied over, you need to update the font cache so your system can tell you that the font is available in your applications. You can do this in a couple of different ways: re-boot or use the command line to update the cache:

This will update the font cache for all the fonts in your system:

fc-cache -fv

Or, you can update only the cache from the changed directory by stating the directory to update, like this:

fc-cache -fv ~/.local/share/fonts/truetype/

Some applications such as Libre Office will need you to quit the application, then open it up again for the font to be available when you recreate the font cache like this from the command line.

All User’s Fonts

These are fonts that are available to you and all the other users who have an account on your computer system. This is probably the default location for adding fonts. Unless you are adding a font that is private, there isn’t any reason not to share with anyone else on your system now or in the future.

The directory for All User’s Fonts is:

/usr/local/share/fonts

This directory, may or may not already exist. If it doesn’t you simple create it in terminal by:

mkdir -p /usr/local/share/fonts

Now you have that directory, copy your downloaded font to it. I will use the example of the font I downloaded above. I am assuming that I have the extracted font directly in my “Downloads” folder.

cp ~/Downloads/AgentOrange.ttf /usr/local/share/fonts/

A Side Note About File Organisation The ‘Linux Way’ is to have things well organised in a logical way. Though, just copying a font directly to this folder will work just fine, if you were going to copy a number over like this, you may want to organise them a bit. For example, this is a True Type Font as we can tell from it’s extension (.ttf). So, you can organise different font types into different directories - true types into their own sub-directory, open fonts into their own sub-directory etc. This is not obligatory, just a suggestion as it will work either way. If we were going to do that, then you would create your sub-directory and copy your font to that e.g.

mkdir -p /usr/local/share/fonts/truetype
cp ~/Downloads/AgentOrange.ttf /usr/local/share/fonts/truetype/

Now your font is copied over, you need to update the font cache so your system can tell you that the font is available in your typing application. You can do this in two different ways: re-boot or use the command line to update the cache:

This will update the font cache for all the fonts in your system

fc-cache -fv

Or, you can update only the cache from the changed directory by stating the directory to update, like this:

fc-cache -fv /usr/local/share/fonts

Some applications such as Libre Office will need you to quit the application, then open it up again for the font to be available when you recreate the font cache like this from the command line.

That’s how to install fonts on a Linux system

System Fonts

OK, lets look at the System Fonts. Firstly, you will probably never need to mess with these, so this information is for anyone who does need to know or is just interested.

Each distribution can have it’s own slight variations on where system fonts directories are. Luckily, it’s easy to figure out.

On the command line you want to have a look at the fonts configuration file in “/etc/fonts/fonts.conf”.

You can “cat” the file and scroll though until you find what you need, or use the “grep” command to find just the bit we are interested in like this:

cat /etc/fonts/fonts.conf | grep -iA 10 "font directory"

You will then see something like this:

<!-- Font directory list -->

	<dir>/usr/share/fonts</dir>
	<dir>/usr/local/share/fonts</dir>
	<dir prefix="xdg">fonts</dir>
	<!-- the following element will be removed in the future -->
	<dir>~/.fonts</dir>

This tells me that fonts are stored in “/usr/local/share/fonts” which we have just looked at (All User’s Fonts). Fonts are also available in “/usr/share/fonts”. On this system, this is the System Fonts directory. When you look at the fonts configuration file on your system, there amy be other places too. These are normally specific use cases such as for directories used by X11 or kde for fonts.

On my system, the contents of “/usr/share/fonts” is:

drwxr-xr-x   2 root root  4096 Jul 17  2018 cmap/
drwxr-xr-x   2 root root  4096 Jul 17  2018 cMap/
drwxr-xr-x   4 root root  4096 Jul 24  2019 opentype/
drwxr-xr-x  51 root root  4096 Sep 26  2019 truetype/
drwxr-xr-x   3 root root  4096 Jul 17  2018 type1/
drwxr-xr-x   6 root root  4096 Jul 17  2018 X11/

Earlier in this article, I mentioned in a couple of places how it is more in keeping with the “Linux Way” to organise directories into font types. As you can see this is exactly how the systems font directory is organised. Also where on some systems, there is a separate directory outside of “/usr/share/fonts” for X11 specific fonts, this system has them organised within that directory.

As a side note, do you see the lines:

<!-- the following element will be removed in the future -->
<dir>~/.fonts</dir>

If you search online regarding installing fonts on Linux, you often see people telling you to add them to the .fonts directory in your home folder. This used to be the correct method of installing fonts for a single user. This has now been deprecated in favour of the methods mentioned in this article.

In conclusion, Installing fonts is simple Linux - it’s at least, just as easy as in MS Windows.