How to List All Installed Fonts on Linux From the Command-Line

How to List All Installed Fonts on Linux From the Command-Line

One thing we can be sure about in Linux is that there is always multiple ways to do the same thing. Graphical applications get rewritten by new developers in newer languages all the time and we in the Linux community benefit by always having a secondary option. But we can always count on older classic applications to do the basic. Most of the classic applications are non-graphical using the command line.

In this article we are going to learn how to list all the fonts installed on your system using the fc-list command and explore a few of it’s options to help us filter through searches. fc-list is part of a library called fontconfig.

Most of all Linux distributions come with fontconfig installed with the base installation. If for some reason your system doesn’t have fontconfig installed, install with the following command.

First we check if it’s installed:

which fc-list
Output
/usr/bin/fc-list

If nothing shows up, it’s not installed and proceed with following instructions. If a directory location shows up than it means it’s installed and you should skip the installation instructions.

Install Fontconfig (If Not Installed Already)

For installation on a Debian based system:

sudo apt update
sudo apt install fontconfig

For installation on a RHEL based system:

sudo dnf update
sudo dnf install fontconfig

For installation on an Arch based system:

sudo pacman -S fontconfig

Proceed until everything in the library is installed.

We check once again if the library installed correctly with:

which fc-list

Okay once we have the library installed we can use the fc-list application command.

List All Installed Fonts on Linux

If we type fc-list by itself we get all the fonts installed on your system. Go ahead try it by just typing:

fc-list
Output
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

Okay now we got the full list of fonts installed in the system that are properly installed and available to be used by any application on your computer system.

Filter List of Installed Fonts by Font Family

We got a full list of all the fonts installed but you might notice the output is a bit garbled and not easy to parse visually, specially in newer Linux distributions where over a hundred fonts can come pre-installed. Luckily for us fc-list has additional features to make it easier to read and handle all of the fonts.

One thing we can do not to overwhelm ourselves with so many fonts is to break it down by font family. With the following command we list all of the font families installed without listing each font individually.

fc-list :family

This is much easier to read and see which family of fonts are already installed and to verify if a recently installed font family got installed correctly or if the font family is being read by the system correctly.

For example I’ll check the DejaVu font family:

fc-list :DejaVu
Output
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

Filter List of Installed Fonts by Font Family & Font Style

Then we can further check which styles the family have. Styles are the different weight of a font and they are usually named as Regular, Bold, Semi Bold, Italics and much more weight options. Some of the newer professional fonts designed by font foundries now a days can have dozens of different weight, some even having 50 or 60 different options. To list all the font styles of a family of font we use the following command.

fc-list :family style

Example:

fc-list :DejaVu:style=Book
Output
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold

Now the font family is listed with all the styles next to it.

Filter List of Installed Fonts by Language Compatibility

Another useful listing of fonts is to know which font is compatible with a particular language. Because of the special characters of some languages not all fonts can be used with all languages. If you’re a non-English Linux user and you want to verify if a particular font is compatible with your language we can find out easily by listing your installed fonts applied with the two letter ISO code of your language.

For example for the Hindi language, the Romanian language and the Norwegian language.

fc-list :lang=hi
fc-list :lang=ro
fc-list :lang=no

This command will list all of the fonts installed on your system that are compatible with your language. By using a proper font with the language set in your system you can later avoid weird incompatibility glitches in some applications that are hard to diagnose but easy to attribute. It’s best recommended to always use a compatible font with your language.

Example:

fc-list :lang=no
Output
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

Filter Font Files Using Grep

One last thing that is extremely useful to know about listing all the fonts in your system is to know where the actual font files are located.

Most font files in Linux come in the format of OpenType Font and TrueType Font and they use the extensions of .otf and .ttf respectively. These files are the actual glyph designs of the font. Depending on your distribution of Linux and methods used to install a font, the font itself will reside in various directories, it can be in a directory for the local user or in a global location to be used by all system users.

The places are too many to look one by one so here we again use our friend fc-list to list the locations of all the font files in your system, along with the grep command to filter the fonts we want to find.

The following command gives you only the location of the fonts in your system.

fc-list | grep -i partial-or-complete-name-of-font-file

Example:

fc-list | grep -i "dejavuserif"
Output
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

Now you will know exactly in which directory to look for a particular font.

Conclusion

In this guide we learned how to list all of the installed fonts in your system. Then we learned how to filter the list to font families to make it easier to parse visually. We also learned how to see which font weights are available for each family to know all the available weight options of a particular font. Importantly, we also discovered how to list fonts by languages to avoid glitches and complications. And we finally learned how to locate the actual font files easily without looking directory by directory. If you have any questions or encountered any issues feel free to leave a comment.

0 Shares:
Subscribe
Notify of
guest
Receive notifications when your comment receives a reply. (Optional)
Your username will link to your website. (Optional)

0 Comments
Inline Feedbacks
View all comments
You May Also Like