fc-query

extract font file information

TLDR

Query font file
$ fc-query [font.ttf]
Show specific property
$ fc-query --format '%{family}\n' [font.ttf]
List all properties
$ fc-query --format '%{=unparse}\n' [font.ttf]
Query font index
$ fc-query --index [0] [font.ttc]

SYNOPSIS

fc-query [options] font-file

DESCRIPTION

fc-query extracts and displays information from font files without installing them. It's part of fontconfig and shows font properties like family, style, weight, and supported languages.The tool queries individual font files directly rather than the system font cache. Format strings allow extracting specific properties. For font collections (.ttc), specific fonts can be selected by index.fc-query is useful for examining fonts before installation or scripting font management tasks.

PARAMETERS

FONT-FILE

Font file to query (.ttf, .otf, .ttc).
-f, --format FORMAT
Output format string.
-i, --index N
Only query the face at the given index of each file.
-b, --ignore-blanks
Ignore blank glyphs when computing supported languages.
--help
Display help information.

INSTALL

sudo apt install fontconfig
sudo dnf install fontconfig
sudo pacman -S fontconfig
sudo apk add fontconfig
sudo zypper install fontconfig
brew install fontconfig
nix profile install nixpkgs#fontconfig

CAVEATS

Only reads single files, not directories. Format string syntax requires learning. Some fonts may have incomplete metadata.

HISTORY

fc-query is part of fontconfig, the font configuration library created by Keith Packard for X.org. It provides programmatic access to font metadata used by the fontconfig system.

SEE ALSO

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

RESOURCES

Source code · Homepage