LinuxCommandLibrary

fc-list

List available fonts

TLDR

Return a list of installed fonts

$ fc-list
copy

Return a list of installed fonts with given name
$ fc-list | grep '[DejaVu Serif]'
copy

Return the number of installed fonts
$ fc-list | wc [[-l|--lines]]
copy

Return a list of installed fonts that support the language based on its locale code
$ fc-list :lang=[jp]
copy

Return a list of installed fonts that contain the glyph specified by its Unicode code-point
$ fc-list :charset=[f303]
copy

SYNOPSIS

fc-list [options] [pattern...]

PARAMETERS

--version
    Print version information and exit.


--quiet
    Suppress all normal messages and warnings.


--help
    Display usage help and exit.


-f format, --format=format
    Use printf-like format string for output (e.g., '%{family}\n').


DESCRIPTION

fc-list is a command-line tool from the fontconfig package, used on Linux and Unix-like systems to enumerate fonts registered with the fontconfig library. Fontconfig handles font configuration, discovery, and matching for applications like X11 clients, GTK, Qt, and more.

Without arguments, fc-list displays all available fonts, showing details such as file path, family name, style, weight, slant, spacing, and other properties from the fontconfig database. This database is built by fc-cache, scanning font directories defined in configuration files like /etc/fonts/fonts.conf.

Users can filter results using pattern arguments, based on fontconfig's pattern syntax. For example, fc-list "DejaVu Sans" lists fonts matching that family, while fc-list :slant=italic shows italic fonts. Complex queries support elements like language (:lang=zh), weight, or pixel size.

The --format option enables customizable output with printf-style strings and placeholders (e.g., %{family}, %{file}, %{weight}), ideal for scripting or generating font lists. fc-list reads the same config as applications, ensuring consistent results, but may miss uncached fonts until fc-cache is run.

CAVEATS

Depends on up-to-date font cache (run fc-cache -fv after installing fonts). Output varies by fontconfig version and config files. Patterns are case-sensitive.

EXAMPLES

fc-list
List all fonts.

fc-list :spacing=mono
List monospace fonts.

fc-list -f '%{family}\t%{style}\n' | sort -u
Unique family/style pairs.

fc-list ++file ++family
Show files and families.

FORMAT PLACEHOLDERS

Common: %{family} (name), %{style} (style), %{file} (path), %{weight} (weight), %{slant} (slant), %{spacing} (spacing), %{lang} (languages), %{pixelsize} (size).
See fontconfig-user man page.

HISTORY

Developed as part of fontconfig by Keith Packard in 2001 for XFree86/X.org to standardize font handling across X11 applications. Evolved with fontconfig releases; current versions (2.13+) support advanced pattern matching and extenso patterns.

SEE ALSO

Copied to clipboard