Fontconfig

Fontconfig
Original authorKeith Packard
Release18 December 2000; 25 years ago (2000-12-18)
Stable release
2.18.4 Edit this on Wikidata / 18 November 2026; 16 days ago (18 November 2026)
Preview release
2.13.96 Edit this on Wikidata / 4 February 2022; 4 years ago (4 February 2022)
Written inC
Operating systemUnix-like systems
TypeFont handling library
LicenseMIT
Websitefontconfig.org
Repository

Fontconfig is a free software program library designed to provide configuration, enumeration and substitution of fonts to other programs. Fontconfig was originally written and maintained by Keith Packard, and is currently maintained by Behdad Esfahbod.

Fontconfig is typically used on graphical Linux (and other Unix-like) desktops, such as Xorg and Wayland, where it remains an important part of handling fonts. However, it is also sometimes used on other platforms, notably including Windows versions of software that use Pango for laying out and rendering text, such as GIMP.

Usage

End-users can use fontconfig, directly or indirectly, to customize and configure fonts on the system.

Applications can use fontconfig in two ways:

  1. by querying it for the available fonts on the system, or
  2. by querying it for a font matching certain parameters (comprising a pattern) as closely as possible.

To perform font matching, fontconfig stores typesetting information about all of the installed fonts, including the name of the font family, style, weight, dots per inch (DPI), and Unicode coverage. This information is also used to perform font substitution.

Configuration

Fontconfig uses XML format for its configuration files. The document type definition (DTD) for fontconfig files is normally located at /etc/fonts/fonts.dtd.

The master configuration file - usually /etc/fonts/fonts.conf - references a few other configuration locations which may or may not exist:

A simple example of a configuration file:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <!-- Enable antialiasing for all fonts -->
    <match target="font">
        <edit mode="assign" name="antialias"><bool>true</bool></edit>
    </match>
</fontconfig>

Utilities

Fontconfig ships with eight command line utilities to manage and query fonts and the font configuration of the system:

See also