One way to add personalization to the documents or presentations that you create in Linux desktop is via using custom fonts. In Linux desktop, you can download and add custom fonts to the desktop system as you wish. There are many free, open-source fonts you can download from the web (e.g., Google Web Fonts).
In this tutorial, I will describe how to install custom fonts in Linux desktop environment.
Linux desktop supports both TrueType fonts and OpenType fonts. I will describe installation instructions for both types of fonts. In the tutorial, I assume that you already downloaded custom fonts (e.g., custom_font.ttf or custom_font.otf) from somewhere.
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.
$ 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:
$ sudo mkdir /usr/share/fonts/truetype/my_custom_fonts
$ sudo cp custom_font.ttf /usr/share/fonts/truetype/my_custom_fonts
To install a OpenType font (e.g., custom_font.otf), use /usr/share/fonts/opentype directory to install fonts.
$ 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:
$ 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:
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.
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_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.
The installed fonts can only be accessible when you log in to your Linux desktop.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to switch from NetworkManager to systemd-networkd on Linux - August 31, 2015
- How to set up a system status page of your infrastructure - August 25, 2015
- How to configure virtual hosts in Apache HTTP server - August 24, 2015