LinuxCommandLibrary

fc-pattern

Show font matching pattern details

TLDR

Display default information about a font

$ fc-pattern [[-d|--default]] '[DejaVu Serif]'
copy

Display configuration information about a font
$ fc-pattern [[-c|--config]] '[DejaVu Serif]'
copy

SYNOPSIS

fc-pattern [-h | -V | -d | -s | -c] [pattern…]

PARAMETERS

-h, --help
    Print command line options.

-V, --version
    Print version of the program.

-d, --default
    Print patterns for the default font.

-s, --sort
    Sort output using font name.

-c, --canonical
    Use canonical form of pattern.

DESCRIPTION

The fc-pattern command is a utility from the fontconfig library used to query and display available font patterns on Linux systems. Font patterns are structured descriptions defining font properties like family, style, weight, slant, spacing, pixel size, and more. Fontconfig uses these patterns to match fonts for applications.

When run without arguments, fc-pattern outputs all known patterns from the fontconfig cache. Specifying a partial pattern filters results to matching fonts. For instance, fc-pattern 'family=serif' lists serif family patterns, aiding font debugging, scripting, or verifying configurations.

Output format shows properties as property=value pairs per pattern. Options enable customization like sorting by name, canonical syntax, or default pattern dump. It's lightweight, relying on pre-built font cache for speed, making it ideal for terminal-based font inspection.

CAVEATS

Depends on up-to-date fontconfig cache; run fc-cache -fv if fonts are missing. Output verbose with many fonts; pipe to grep for filtering.
May require fontconfig-devel or fonts installed.

EXAMPLES

fc-pattern → List all patterns.
fc-pattern 'family=Arial' → Match Arial fonts.
fc-pattern -s 'weight=40' → Sorted bold(ish) fonts.

SEE ALSO

fc-list(1), fc-match(1), fc-cache(1), fc-scan(1)

Copied to clipboard