Finding Installed Fonts on Your System (with examples)
Example 1: Return a list of installed fonts in your system
fc-list
Motivation
This command allows you to view a list of all the fonts that are installed on your system. It can be helpful when you are searching for a specific font or want to get an overview of the available fonts.
Explanation
Executing the fc-list
command without any arguments will display a list of all the fonts installed on your system. The command uses the fc-list
utility, which is part of the Fontconfig library, to retrieve the font information.
Example Output
DejaVuSerif.ttf: DejaVu Serif:style=Book
DejaVuSans-BoldOblique.ttf: DejaVu Sans:style=Bold Oblique
DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
...
Example 2: Return a list of installed fonts with given name
fc-list | grep 'DejaVu Serif'
Motivation
This command allows you to search for a specific font by its name. If you know the name of a font you are interested in, you can use this command to quickly check if it is installed on your system.
Explanation
The fc-list
command is piped (|
) to the grep
command, which searches for lines containing the specified font name, in this case, ‘DejaVu Serif’. The grep
command is a powerful text search utility in Linux systems.
Example Output
DejaVuSerif.ttf: DejaVu Serif:style=Book
DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
DejaVuSerif-Italic.ttf: DejaVu Serif:style=Italic
...
Example 3: Return the number of installed fonts in your system
fc-list | wc -l
Motivation
This command allows you to quickly determine the total number of fonts installed on your system. This information can be useful for various reasons, such as diagnosing font-related issues or comparing the font collection across multiple systems.
Explanation
The fc-list
command is piped (|
) to the wc
command with the -l
option. This combination counts the number of lines in the command output, which corresponds to the number of installed fonts.
Example Output
235
In conclusion, the fc-list
command is a powerful tool for listing and exploring the fonts installed on your system. Whether you want to view all installed fonts, search for a specific font, or determine the total number of fonts, these examples provide you with the necessary commands and explanations to accomplish these tasks.