How to Install New Fonts in Ubuntu Linux

If you’ve ever used Ubuntu before, you knew that installing free fonts online wasn’t that difficult. Just open Nautilus (the default file browser), and type the following into the address bar:

fonts://

After that, all you needed to do was drop your fonts into that folder, and you were all set.

Unfortunately, as of Ubuntu 8.04 – Hardy Heron – that no longer works. Now that Ubuntu is using gvfs, locations such as “fonts://” no longer work (as Nautilus will tell you if you try to navigate there!).

So, what to do?

If you were using Mac OSX, you could simply double-click a font package. The Mac OSX font preview application would open and if you liked the font, there was a handy “install” button available. Click that, and the font is installed! Sadly, although Ubuntu does allow you to view fonts in the same manner, there is no “install” option to be found.

There are, however, a couple of ways to install fonts, depending on how comfortable you are with the Terminal and/or whether or not you want the fonts to be available for all users, or just for yourself. This actually is a consideration, since many commercial font licenses may only allow a single user, while free fonts can typically be shared with anyone.

Let’s assume, for the first instance (and for whatever reason), that you want to install the fonts and have them just be for you, and for you alone.

Open a Nautilus window and in the address bar type the following:

/home/username/.fonts/

If the fonts folder is inside your home directory (note the leading “.” before fonts… that’s what makes the directory invisible), it will now open and all you need to do is drag your new fonts into that folder and they’ll instantly be available… but only for you.

There is a chance, especially if you haven’t installed any fonts since installing the operating system, that the .fonts folder doesn’t exist. In that case, you’ll want to create it. Simply go to the View menu and select the Show Hidden Files. You should now see a bunch of folders that weren’t there a second ago (along with some new files), all with the “.” before their names. Simply click the File menu to create a new folder, and give it the “.fonts” name. Now, simply drag your fonts into it, return to the Edit menu and deselect the “Show Hidden Files” and all those folders, including the one you just created, will disappear. And the font or fonts you now installed will now be available!

The above can also be done via the Terminal if you want. Remember, though, that if the .fonts folder doesn’t exist, we’ll need to create it first, so this might need two commands. The first command we’ll type into the Terminal will create the .fonts folder, while the second one will move the font into the newly-created folder. For the sake of this example, let’s assume that your new fonts are called “NewFonts.ttf” and that they were downloaded to the desktop. Here’s the first command:

  • mkdir /home/username/.fonts
  • The second command will take that font (NewFonts.ttf) and put it into the new folder:
  • mv /home/username/Desktop/NewFonts.ttf /home/usernamme/.fonts

Again, the above command actually moves the files into the folder, so they’ll be gone from wherever they were before that command. If you only want to copy the font into the folder, the same command is still good, only you’ll want to change “mv” to “cp” and then you’ll have the identical font in both places.

Okay, that’s the first way to install a font into your Ubuntu system, assuming you only want it to be available for yourself. But what if you want the font to be available for everyone? Simple. In fact, it’s actually almost the same, except for a couple of differences.

In Ubuntu, fonts that are available for everyone who uses the computer are stored in the following folder:

/usr/share/fonts

So, to mv a font into that folder (which will definitely already exist), we’d type in the following command (again assuming we’re moving the same font from the previous example, which was located on the desktop):

sudo mv /home/username/Desktop/NewFonts.ttf /usr/share/fonts

And again, if you only want to copy the font into the fonts folder, you would change “mv” to “cp” and leave everything else the same.

One thing to notice about the previous command, as opposed to the other, is the addition of “sudo” at the beginning. In Linux parlance, “Sudo” is shorthand for “Super User,” analogous to the Administrator in Windows or Mac OSX. The Super User can pretty much do anything he/she wants, so it’s a good idea to be careful whenever you’re asked for a password. In this case, however, you’re being asked for the password simply because you’re accessing a part of the system (the /usr folder) that everyone uses, so the system wants to make sure you have the right to modify this common area.

Emma

About Emma

Emma Logan is the content coordinator of Beverly Lahaye Institute. She’s been freelancing for many years and now focuses on WordPress development and blog design