How to install custom fonts in Linux desktop

Last updated on October 3, 2020 by Dan Nanni

One way to add personalization to the documents or presentations that you create is via using custom fonts. In Linux desktop, you can download and add custom fonts as you wish. Linux desktop supports both TrueType fonts and OpenType fonts. For those wanting to use custom fonts, there are many free, open-source fonts you can download from the web (e.g., TrueType fonts from Google Web Fonts).

In this tutorial, I will describe how to install custom fonts in Linux desktop environment.

Let's say you already downloaded TrueType and OpenType custom fonts (e.g., custom_font.ttf or custom_font.otf) from somewhere. Verify that those fonts are not installed on your system by using this tutorial. Once you verify that those fonts are not available on your Linux desktop, proceed as follows to install them on your system.

Install Custom Fonts System-wide

If you want to make the custom fonts available system-wide (i.e., any user who logs in to your desktop can use the fonts), install the fonts in a system-widely accessible location as follows.

To install a TrueType font (e.g., custom_font.ttf), copy the font under /usr/share/fonts/truetype directory. Make sure to make the fonts readable by others.

$ chmod 644 custom_font.ttf
$ sudo cp custom_font.ttf /usr/share/fonts/truetype

If you want, you can create any sub-directory under /usr/share/fonts/truetype, and copy the font in there instead:

$ chmod 644 custom_font.ttf
$ sudo mkdir /usr/share/fonts/truetype/google_fonts
$ sudo cp custom_font.ttf /usr/share/fonts/truetype/google_fonts

To install an OpenType font (e.g., custom_font.otf), use /usr/share/fonts/opentype directory to install fonts.

$ chmod 644 custom_font.otf
$ sudo cp custom_font.otf /usr/share/fonts/opentype

Similar to TrueType fonts, you can create any number of sub-directories under /usr/share/fonts/opentype:

$ chmod 644 custom_font.otf
$ sudo mkdir /usr/share/fonts/opentype/my_custom_fonts
$ sudo cp custom_font.otf /usr/share/fonts/opentype/my_custom_fonts

After copying your font to an appropriate font directory as described above, rebuild a system-wide font cache, simply by running:

$ sudo fc-cache -fv

At this point, you should be able to use the installed fonts in office suites like LibreOffice.

Install Custom Fonts on a Per-User Basis

If you want to install custom fonts per-user (i.e., make custom fonts available to you only), you can install the fonts in your home directory.

For this, create .fonts directory in your home directory.

$ mkdir ~/.fonts

Then (optionally) create any number of sub-directories, and copy any types of fonts (e.g., TrueType or OpenType) under ~/.fonts. For example:

$ mkdir ~/.fonts/my_truetype_fonts
$ mkdir ~/.fonts/my_opentype_fonts
$ cp custom_fonts.ttf ~/.fonts/my_truetype_fonts
$ cp custom_fonts.otf ~/.fonts/my_opentype_fonts

Once you have copies custom fonts in ~/.fonts directory, rebuild your font cache, without using sudo.

$ fc-cache -fv

The installed fonts can only be accessible when you log in to your Linux desktop.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean