If you’re a Linux user, you probably have at least one Google and Microsoft font installed. If not, you can install them easily using the following steps:

  1. First, install the Google Fonts package on your Linux system. This will add the Google fonts to your system’s font cache.
  2. Next, install the Microsoft Fonts package on your Linux system. This will add the Microsoft fonts to your system’s font cache.
  3. To use these fonts on your Linux systems, you’ll need to set up a few environment variables: GOOGL_FONT_DIR , GOOGL_MFT_DIR , and GOOGL_FONT_TYPE . For example, if you want to use the Google fonts in a project called “MyProject” and they are located in /usr/share/fonts/composer/misc/GOOGL-misc-100dpi-Regular , then you would set these environment variables to be: GOOGL_FONT_DIR=/usr/share/fonts/composer/misc GOOGL_MFT_DIR=/usr/share/fonts/${GOOGL_FONT_TYPE}/${VERSION}/${PACKAGE} GOOGL_FONT_TYPE=100dpi

How to Install Google Fonts on Linux

To add one of Google’s open-source fonts, you have two options: downloading directly from the Google Fonts website, or using a graphical installer called TypeCatcher. The website method is more straightforward and reliable but involves a little bit of command line work. You might feel more comfortable with TypeCatcher, but depending on your distribution, it may not be easy to install.

Option 1: Google Fonts Website

First, head over to the Google Fonts site and select the font family you want to install. Download the font archive by clicking the “Download Family” button located in the top-right corner.

Launch the terminal and create a new directory to store the downloaded fonts. Then, navigate to the newly-created folder using the cd command.

Unzip the archive to the newly-created folder using the unzip command. Make sure to replace FontArchive.zip in the command below with the name of the archive you just downloaded.

Register the fonts on your system with the fc-cache command.

Then, verify if the new font was successfully added by running:

Don’t forget to replace FontName with the name of the font that you added. For example, if you downloaded the Loto Sans font, the aforementioned command will become fc-match LotoSans.

If the output displays the name of the font—Loto Sans, for example—then the font was successfully added to the system. In case the font name in the output is different, consider going through the installation steps again.

Option 2: TypeCatcher

If working with the command line isn’t your strong suit, you can install Google fonts using TypeCatcher, a graphical application that allows users to search, install, and uninstall Google fonts on Linux.

TypeCatcher is available in the Debian repositories and can be downloaded using APT.

Arch users can install TypeCatcher from the AUR using an AUR helper like yay.

RELATED: How to Install, Remove, and Manage Fonts on Windows, Mac, and Linux

How to Install Microsoft Fonts on Linux

Unlike Google fonts, there’s no central repository for downloading Microsoft fonts for Linux. Therefore, you’ll have to either install the fonts using a Microsoft fonts package or extract them from an active Windows installation or the ISO image.

Option 1: Using the Microsoft Fonts Linux Package

You can install the ttf-mscorefonts-installer package on Debian-based distros like Ubuntu and Linux Mint to install Microsoft fonts on your system.

The aforementioned package provides several Microsoft fonts, including, but not limited to:

Times New Roman Arial Black Arial Comic Sans MS Courier New Impact Verdana

On Arch Linux, you’ll have to download multiple packages from the AUR, each providing a distinct set of Microsoft fonts.

To install Microsoft fonts on Fedora, CentOS, and other RHEL-based distros, you’ll have to download the mscorefonts2 RPM package. But first, install the necessary support packages needed for the installation.

Finally, download and install mscorefonts2 using the rpm command as follows:

After installing the aforementioned packages, there’s nothing else that you need to do. The system will automatically add the fonts to your system during the installation process.

To verify if the Microsoft fonts were added to your system, run the following command:

The output should return the name of the font.

Option 2: Extracting Fonts From the Windows ISO

If you have a Windows ISO lying around on your computer, you can extract the fonts directly from the installation image. Don’t have the ISO? You can download one for free from the Microsoft website.

With the ISO in hand, you’ll need p7zip to extract the fonts. Install p7zip on your system by issuing the commands below depending on the distribution you’re using, or find it in your distribution’s software center.

On Ubuntu and Debian-based distros:

On Arch Linux and other derivatives:

To install p7zip on RHEL-based distros like Fedora:

Navigate to the directory where you’ve downloaded the ISO. Then, extract the “install.wim” Windows Image file from the ISO using p7zip as follows:

Make sure to specify the exact name of the ISO file you downloaded in the above command.

Now, extract the Fonts folder from the “install.wim” archive. Note that there’s no space between the -o flag and the directory path.

The aforementioned command will extract every font file (TTF and TTC) from the “install.wim” image, and store it in the WindowsFonts directory.

Move the WindowsFonts folder to the /usr/share/fonts directory using mv.

Regenerate the font cache using the sudo fc-cache -fv command.

Option 3: Extracting Fonts From a Dual-Booted Windows Partition

If you’ve dual-booted Windows and Linux on your computer, you can directly copy all Microsoft fonts from the Windows partition.

To start, mount the Windows partition to an appropriate directory. Copy all the font files present in the C:\Windows\Fonts directory and paste them under /usr/share/fonts/WindowsFonts. Then, regenerate the font cache by typing sudo fc-cache -fv in the terminal.

You can also create a symlink between C:\Windows\Fonts and /usr/share/Fonts/WindowsFonts directories. Let’s assume you’ve mounted the Windows partition at “/windows.” Run the following command to create the symlink:

Install Any Font on Linux

Regardless of where they’re coming from, adding new fonts on Linux is a straightforward process. All you have to do is download the font archive and move it to the /usr/share/fonts directory on Linux.

You can also add individual fonts instead of adding a whole font family. To do that, simply double-click on the font file, and click “Install.”

RELATED: The 7 Best Websites for Downloading Free Fonts