#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-491

### Chapter 10. Graphics and Font Libraries

- Prev

  FreeType-2.14.3

- Next

  FriBidi-1.0.16

- Up
- Home

# Fontconfig-2.17.1

## Introduction to Fontconfig

The Fontconfig package contains a library and support programs used for configuring and customizing font access.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/2.17.1/fontconfig-2.17.1.tar.xz

- Download MD5 sum: f68f95052c7297b98eccb7709d817f6a

- Download size: 1.3 MB

- Estimated disk space required: 18 MB (with tests)

- Estimated build time: 0.4 SBU (with tests)

### Fontconfig Dependencies

#### Required

FreeType-2.14.3

#### Optional

bubblewrap-0.11.2 (used by some tests), cURL-8.19.0 and libarchive-3.8.7 (both used by some tests for downloading and extracting test files), JSON-C-0.18, DocBook-utils-0.6.14 and libxml2-2.15.3, texlive-20250308 (or install-tl-unx)

### Note

An Internet connection is needed for some tests of this package. The system certificate store may need to be set up with make-ca-1.16.1 before testing this package.

### Note

If you have DocBook Utils installed and you remove the `--disable-docs` parameter from the configure command below, you must also have SGMLSpm-1.1 and texlive-20250308 installed, or the Fontconfig build will fail.

## Installation of Fontconfig

Install Fontconfig by running the following commands:

    ./configure --prefix=/usr        \
                --sysconfdir=/etc    \
                --localstatedir=/var \
                --disable-docs       \
                --docdir=/usr/share/doc/fontconfig-2.17.1 &&
    make

To test the results, issue: make check. One test is known to fail if the kernel does not support user namespaces. Some tests will download some font files via Internet, but will be unable to retrieve the files and will fail the test.

Now, as the `root` user:

    make install

If you did not remove the `--disable-docs` parameter from the configure command, you can install the pre-generated documentation by using the following commands as the `root` user:

    install -v -dm755 \
            /usr/share/{man/man{1,3,5},doc/fontconfig-2.17.1} &&
    install -v -m644 fc-*/*.1         /usr/share/man/man1 &&
    install -v -m644 doc/*.3          /usr/share/man/man3 &&
    install -v -m644 doc/fonts-conf.5 /usr/share/man/man5 &&
    install -v -m644 doc/*.{pdf,sgml,txt,html} \
                                      /usr/share/doc/fontconfig-2.17.1

## Command Explanations

`--disable-docs`: This switch avoids building the documentation (the release tarball includes pre-generated documentation).

## Configuring Fontconfig

### Config Files

`/etc/fonts/*, /etc/fonts/conf.d/* and /usr/share/fontconfig/conf.avail/*`

### Configuration Information

The main configuration file for Fontconfig is `/etc/fonts/fonts.conf`. Generally you do not want to edit this file. It will also read `/etc/fonts/local.conf` and any files in `/etc/fonts/conf.d`. To put a new font directory in the configuration, create (or update) the `/etc/fonts/local.conf` file with your local information or add a new file in `/etc/fonts/conf.d`. The default location of fonts in Fontconfig is:

- /usr/share/fonts

- ~/.local/share/fonts

- ~/.fonts (this is now deprecated, but for the moment it still works)

Fontconfig also ships many example configuration files in the `/usr/share/fontconfig/conf.avail` directory. Symlinking specific files to `/etc/fonts/conf.d` will enable them. The default setup is generally good enough for most users. See `/etc/fonts/conf.d/README` for a description of the configuration files.

More information about configuring Fontconfig can be found in the user's manual in file:///usr/share/doc/fontconfig-2.17.1/fontconfig-user.html.

## Contents

Installed Programs: fc-cache, fc-cat, fc-conflist, fc-list, fc-match, fc-pattern, fc-query, fc-scan, and fc-validate
Installed Library: libfontconfig.so
Installed Directories: /etc/fonts, /usr/include/fontconfig, /usr/share/doc/fontconfig-2.17.1, /usr/share/fontconfig, /usr/share/xml/fontconfig, and /var/cache/fontconfig

### Short Descriptions

fc-cache | is used to create font information caches
fc-cat | is used to read font information caches
fc-conflist | shows the ruleset files' information on the system
fc-list | is used to create font lists
fc-match | is used to match available fonts, or find fonts that match a given pattern
fc-pattern | is used to parse pattern (empty pattern by default) and show the parsed result
fc-query | is used to query fonts files and print resulting patterns
fc-scan | is used to scan font files and directories, and print resulting patterns
fc-validate | is used to validate font files
`libfontconfig.so` | contains functions used by the Fontconfig programs and also by other programs to configure or customize font access

- Prev

  FreeType-2.14.3

- Next

  FriBidi-1.0.16

- Up
- Home