LinuxCommandLibrary

fc-query

Query font files for information

SYNOPSIS

fc-query [options] [pattern(s)]

PARAMETERS

-v
    Verbose output. Lists all properties for matching fonts.

-f FORMAT
    Use FORMAT string for output. See fontconfig documentation for details.

-e ELEMENT
    Print value of ELEMENT for matching fonts.

-s
    Do not display fonts that are not scalable.

-V
    Show version number and exit.

--help
    Show help message and exit.

pattern
    Font name pattern to match, e.g. 'Arial:bold'. If omitted, all fonts are queried. You can specify multiple patterns.

DESCRIPTION

The `fc-query` command is a utility used to query font information from the font configuration system. It allows you to retrieve details about fonts that are available on your system, based on the fontconfig configuration. This includes font names, styles, file paths, and other properties. It's particularly useful for identifying fonts that match specific criteria or for understanding how fontconfig is resolving font requests. The command provides a powerful way to inspect the font environment and diagnose font-related issues within graphical applications. `fc-query` is an essential tool for developers and system administrators working with fonts on Linux systems. It relies on the fontconfig library for information and configuration, ensuring consistency across applications that use the same fontconfig setup. It is often used in conjunction with other fontconfig utilities like `fc-list` and `fc-cache` to manage the font environment.

CAVEATS

The output and behavior of `fc-query` depend heavily on the fontconfig configuration. Ensure your fontconfig is correctly set up for accurate results. Changes to the fontconfig settings might not be reflected immediately; running `fc-cache -f -v` can force an update.

FONT PATTERNS

The 'pattern' argument accepts a font pattern string that allows you to filter the fonts to be queried. This pattern can specify font family names, styles, and other font properties. For example, 'Arial:bold' queries only Arial fonts with bold style.

OUTPUT FORMATTING

The `-f` option allows you to customize the output format using a format string similar to `printf`. Consult the fontconfig documentation for details on available format specifiers. This is essential for scripting and automated processing of font information.

SEE ALSO

Copied to clipboard