fc-query
Query font files for information
SYNOPSIS
fc-query [ -Vh ] [ --verbose ] [ --help ] { file... }
PARAMETERS
file...
One or more paths to font files (e.g., .ttf, .otf) whose Fontconfig properties are to be queried.
-V, --version
Displays the Fontconfig version and exits.
-h, --help
Displays a brief help message explaining command usage and options, then exits.
-v, --verbose
Displays more detailed Fontconfig properties for each queried font file. This can include additional internal attributes.
DESCRIPTION
fc-query
is a command-line utility provided by the Fontconfig library. Its primary purpose is to display the Fontconfig properties of specific font files. Unlike fc-list
which queries the entire Fontconfig database or fc-match
which finds the best matching font for a given pattern, fc-query
focuses on individual font files.
When given one or more font file paths as arguments, fc-query
parses each file and outputs the Fontconfig properties (like family, style, slant, weight, size, spacing, etc.) that Fontconfig would associate with that particular font. This makes it an invaluable diagnostic tool for font developers, system administrators, or users debugging font issues. It helps in understanding how Fontconfig interprets the metadata within a font file and how those properties might influence font matching and rendering in applications.
CAVEATS
fc-query
operates directly on specified font files and does not consult the Fontconfig caches or global configuration files (like fonts.conf
) for resolving aliases or default values, except for how it parses the intrinsic properties of the font file itself. This means the output might not exactly reflect the final properties a font would have after full Fontconfig pattern matching and rule application within an application. It's a low-level inspection tool.
OUTPUT FORMAT
The output of fc-query
for each font file is a list of Fontconfig properties, presented as `property: type = value`. For instance, `family: string = "DejaVu Sans"` indicates the font family, while `weight: int = 80` represents the weight property. The specific properties displayed depend on the font file's metadata and the verbosity level.
USAGE EXAMPLE
To query the properties of a specific font file, for example, '/usr/share/fonts/dejavu/DejaVuSans.ttf', you would use the command:fc-query /usr/share/fonts/dejavu/DejaVuSans.ttf
To see more detailed information, including internal Fontconfig attributes, use the verbose flag:fc-query -v /usr/share/fonts/dejavu/DejaVuSans.ttf
HISTORY
fc-query
is an integral part of the Fontconfig library, which was originally developed by Keith Packard and others to provide a standard and efficient way for applications on Unix-like systems, particularly those using the X Window System, to discover, select, and manage fonts. Fontconfig emerged as a crucial component for modern desktop environments (like GNOME and KDE) to handle font rendering consistently across applications, abstracting away the complexities of various font formats and locations. fc-query
specifically serves as a diagnostic utility to inspect the metadata of individual font files as interpreted by Fontconfig.
SEE ALSO
fc-list(1), fc-match(1), fc-cache(1), fc-cat(1), fc-conflist(1), fc-validate(1), fonts.conf(5)