LinuxCommandLibrary

fc-query

extract font file information

TLDR

Query font file

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

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).
--format FORMAT
Output format string.
--index N
Font index in collection.
-v, --verbose
Verbose output.
--help
Display help information.

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)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community