fc-cache
The fc-cache
command line tool is used to build font information cache files for the fontconfig library in Unix-like operating systems. Fontconfig is a font configuration and customization library that provides a unified interface for applications to manage and query fonts on a system.
When fonts are installed or modified on a Unix-like system, the fc-cache
tool is used to update the font cache files. These cache files contain information about available fonts, their properties, and their location on the system. By maintaining an up-to-date cache, fontconfig can quickly locate and manage fonts for various applications and user interfaces.
Running fc-cache
typically involves scanning font directories on the system, locating font files, and generating or updating the cache files. Font directories can be system-wide directories such as /usr/share/fonts
, or user-specific directories like ~/.fonts
.
The fc-cache
command can be used with different options to perform various operations. Some commonly used options include:
-f
or--force
: Forces rebuilding of the font cache files, even if no changes have been made.-v
or--verbose
: Provides verbose output during the cache generation process, displaying detailed information about the fonts being processed.-r
or--system-only
: Restricts the cache generation to system-wide font directories only, omitting user-specific directories.
fc-cache
is typically run during font installation or after making changes to the font configuration on a system. It ensures that fontconfig is aware of the available fonts, allowing applications to render text correctly and provide consistent font management across the system.
List of commands for fc-cache:
-
fc-cache:tldr:0c69d fc-cache: Erase font cache files, then generate new font cache files.$ fc-cache -rtry on your machineexplain this command
-
fc-cache:tldr:a063c fc-cache: Generate font cache files.$ fc-cachetry on your machineexplain this command
-
fc-cache:tldr:ac99b fc-cache: Force a rebuild of all font cache files, without checking if cache is up-to-date.$ fc-cache -ftry on your machineexplain this command