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 [ -vV ] { pattern ... }

PARAMETERS

-v
    Enable verbose output. This provides more detailed information about the parsing process and the resulting pattern attributes.

-V
    Display the version of the Fontconfig library and exit.

pattern ...
    One or more font pattern strings to be parsed and displayed. These are the input patterns that Fontconfig will interpret.

DESCRIPTION

The fc-pattern command is a utility provided by the Fontconfig library, designed to parse a given font pattern string and display the resulting Fontconfig pattern in a canonical, human-readable format. This tool is invaluable for debugging Fontconfig configurations, understanding precisely how specific font patterns are interpreted, and verifying the syntax of pattern strings before they are used by applications.

It takes one or more font pattern strings as arguments and outputs the detailed, parsed pattern for each. The output includes various font properties like family, style, weight, slant, size, and other specific features that Fontconfig uses to match fonts. By showing exactly what attributes Fontconfig extracts from a pattern, fc-pattern greatly aids developers and system administrators in troubleshooting font rendering issues, diagnosing unexpected font selections, and fine-tuning font configuration files.

CAVEATS

fc-pattern is primarily a diagnostic and debugging tool; it does not modify system configuration or font caches.
Understanding its output requires familiarity with Fontconfig's internal representation of font attributes.
It requires the Fontconfig library to be installed on the system.

FONT PATTERN SYNTAX

A font pattern is a string that specifies a desired font by a series of attributes. For example, 'serif:bold:size=12' is a simple pattern. Fontconfig parses these patterns into a structured set of properties. fc-pattern helps to visualize this internal representation, showing how 'serif' becomes a family name, 'bold' becomes a weight property, and 'size=12' sets the font size attribute. More complex patterns can include multiple families, specific languages, spacing types, and other advanced features.

HISTORY

fc-pattern is an integral part of the Fontconfig project, which was initiated by Keith Packard around 2000. Fontconfig was developed to provide a standard, robust, and extensible method for managing fonts on Linux and other Unix-like operating systems. As a core utility, fc-pattern has been present since the early versions of Fontconfig, serving its fundamental role in helping users and developers understand how font pattern strings are interpreted by the library.

SEE ALSO

fc-match(1), fc-list(1), fc-cache(1), fonts.conf(5), Fontconfig(3)

Copied to clipboard