Fonts

How to Install Custom Fonts in Linux

This article will explain how to install custom Fonts in Linux using various graphical and command line tools. You can use these methods to install system-wide fonts that will be automatically available to all major apps installed on your Linux system.

GNOME Font Viewer

GNOME Font Viewer is available by default on all major Linux distributions using GNOME Shell or other GNOME based desktop environments. It allows you to view all fonts installed on your system and browse their properties. It can also be used to install system wide custom fonts.

To install a custom font using GNOME Font Viewer, right click on a “.ttf” or “.otf” file and click on “Open With Fonts” menu entry.

Click on the “Install” button on the top header bar to install the font. GNOME Font Viewer may take a few seconds to install the font and refresh the font cache, so wait for the process to finish.

Once installed, you can use system settings to select a new font or use an app like “GNOME Tweaks” to switch system wide fonts. Installed font will also be available to other system and third party apps.

You can install GNOME Font Viewer in Ubuntu using the command specified below:

$ sudo apt install gnome-font-viewer

GNOME Font Viewer is also available as a Flatpak package that can be installed on all major Linux distributions.

Font Manager

Font Manager, as the name suggests, is a tool for managing and installing custom fonts on Linux. You can use it to preview, enable, disable and compare system wide fonts. It features a multi-pane and tabbed layout that nicely categorizes fonts and their properties under various headings. It also provides a way to directly download fonts from Google Fonts website. Unlike GNOME Font Viewer, Font Manager allows you to directly change system wide fonts from the app itself, so you don’t need any other third party app to switch fonts. It also includes numerous options to customize look and feel of fonts and you can use it to tweak hinting and anti aliasing of fonts.

To install a new font using Font Manager, just click on the “+” (plus) icon on the top header bar.

You can install Font Manager in Ubuntu using the command specified below:

$ sudo apt install font-manager

Font Manager is also available as a Flatpak package that can be installed on all major Linux distributions.

Font Finder

Font Finder is a frontend application for Google Fonts repository available online. Written in Rust and GTK3, it allows you to directly preview, browse, and install fonts from Google Fonts website. It also features some options to sort and filter results and an optional dark theme to preview fonts.

Font Finder is available as a Flatpak package. To install it in Ubuntu, use the following commands in succession:

$ sudo apt install flatpak
$ flatpak remote-add --if-not-exists flathub <a href="https://flathub.org/repo/flathub.flatpakrepo">https://flathub.org/repo/flathub.flatpakrepo</a>
$ flatpak install flathub io.github.mmstick.FontFinder

You can install Font Finder in other other Linux distributions from its Flathub store listing available here.

Command Line Method

To install custom fonts using the command line interface, you will need to copy font files to certain directories. If you want to install fonts for all users, copy font files to the following directory (root access is required):

[cc lang=”text”]
/usr/share/fonts
[/cc]

If you want to install fonts for current user only, use the following location instead (create folder if it doesn’t exist):

[cc lang=”text”]
$HOME/.local/share/fonts
[/cc]

Once the font files are copied to these locations, you need to refresh system wide font cache to complete the installation. To do so, run the following command:

$ sudo fc-cache -f -v

Alternatively, you can just reboot the system to refresh the font cache.

You can also create subdirectories in the two locations mentioned above and add fonts to these folders to neatly categorize them. Font cache will automatically pick them once you refresh it.

Conclusion

It is pretty straightforward to install custom fonts in Ubuntu and other major Linux distributions as both graphical apps and command line methods are available. Custom fonts can be used in a number of different ways and they are especially useful for artists, designers, programmers and writers.

About the author

Nitesh Kumar

Nitesh Kumar

I am a freelancer software developer and content writer who loves Linux, open source software and the free software community.