How to use the command fc-match (with examples)
The fc-match
command is used to match available fonts on a system. It provides information about the best matching font for a given pattern.
Use case 1: Return a sorted list of best matching fonts
Code:
fc-match -s 'DejaVu Serif'
Motivation: This use case is useful when you want to find the matching fonts available on your system for a given font pattern.
Explanation: The -s
option in the fc-match
command is used to sort the list of matching fonts based on their quality. The font pattern to match against is specified as an argument, in this case, ‘DejaVu Serif’.
Example output:
DejaVuSerif.ttf: "DejaVu Serif" "Book"
In this example, the best matching font for the pattern ‘DejaVu Serif’ is ‘DejaVuSerif.ttf’. The font is of style ‘Book’.
Conclusion:
The fc-match
command is a handy tool for matching available fonts on a system. It can be used to get information about the best matching font for a given pattern. By using the -s
option, the list of matching fonts can be sorted based on their quality.