# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 fontconfig

查看 fontconfig 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:fontconfig
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install fontconfig
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install fontconfig
```

  证据: MacPorts ports tree: graphics/fontconfig/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add fontconfig
```

  证据: Alpine Linux edge package indexes: fontconfig from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install fontconfig
```

  证据: Debian stable package indexes: fontconfig from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install fontconfig
```

  证据: Fedora Rawhide package metadata: fontconfig from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#fontconfig
```

  证据: nixpkgs package indexes: fontconfig from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S fontconfig
```

  证据: Arch Linux sync databases: fontconfig from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install fontconfig
```

  证据: openSUSE Tumbleweed package metadata: fontconfig from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:fontconfig
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/fontconfig>
- **版本:** 2.18.2
- **来源摘要:** XML-based font configuration API for X Windows
- **主页:** <https://wiki.freedesktop.org/www/Software/fontconfig/>
- **上游文档:** <https://wiki.freedesktop.org/www/Software/fontconfig/>
- **许可证:** HPND-sell-variant AND Unicode-3.0 AND MIT-Modern-Variant AND MIT AND LicenseRef-Homebrew-public-domain
- **源码归档:** <https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/2.18.2/fontconfig-2.18.2.tar.gz>
- **最后更新:** 2026-07-29T17:23:24+01:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- fc-cache (cli)
- fc-cat (cli)
- fc-conflist (cli)
- fc-genconf (cli)
- fc-list (cli)
- fc-match (cli)
- fc-pattern (cli)
- fc-query (cli)
- fc-scan (cli)
- fc-validate (cli)
- fc-cache (别名)
- fc-cat (别名)
- fc-conflist (别名)
- fc-genconf (别名)
- fc-list (别名)
- fc-match (别名)
- fc-pattern (别名)
- fc-query (别名)
- fc-scan (别名)
- fc-validate (别名)

## 依赖

- freetype
- gettext

## 构建依赖

- gettext
- meson
- ninja
- pkgconf

## macOS 提供的库

- expat

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 2.18.2
- 管理器更新时间: 2026-07-29
- 本地数据: OK
- 上游仓库: https://wiki.freedesktop.org/www/Software/fontconfig/
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

fontconfig is the freedesktop.org font discovery, matching, and configuration library used by Unix-like desktop and application stacks to centralize font access.

### 项目历史

The freedesktop project page describes fontconfig as a library for configuring and customizing font access. Its README and user documentation emphasize automatic font discovery, font-name substitution, language coverage matching, XML configuration, and cooperation with FreeType and the X Render Extension.

The user documentation explains the core architecture: a configuration module builds internal state from XML files, while a matching module accepts font patterns and returns the nearest matching font. The design goal was to centralize font installation and customization so applications would not each invent private font configuration systems.

### 采用历史

fontconfig became infrastructure rather than an end-user application. Its value came from being shared by many applications and toolkits, independent of the X Window System, with command-line utilities such as `fc-cache`, `fc-list`, `fc-match`, `fc-query`, and related inspection tools.

The release directory and tag history show a long-running 2.x series, from early `fcpackage` and 2.2-era releases through current stable releases documented on the freedesktop project page.

### 使用方式

Administrators and users configure fontconfig through XML files such as `/etc/fonts/fonts.conf`, `/etc/fonts/conf.d`, `$XDG_CONFIG_HOME/fontconfig/fonts.conf`, and per-user legacy files. Applications use the library to locate fonts, substitute missing families, and obtain file and rendering metadata.

The command-line tools form a practical maintenance layer: `fc-cache` refreshes caches, `fc-list` enumerates fonts, `fc-match` shows matching decisions, and `fc-query` or `fc-scan` inspect font files.

### 为什么软件包爱好者会关心

fontconfig is one of the packages that makes desktop Linux font behavior feel coherent. Package maintainers care about it because bad cache handling, misplaced config snippets, or mismatched defaults can affect text rendering across a whole system.

### 时间线

- 2000s: Early fontconfig 2.x and `fcpackage` tags appear in the freedesktop release history.
- 2012: The release directory lists fontconfig 2.10.0.
- 2018: The release directory lists fontconfig 2.13.0.
- 2025: The release directory lists fontconfig 2.16.0.
- 2026: The project page identifies the current stable series as 2.17.1, while repository tags show later 2.18.x tags.

### Related projects

- fontconfig is explicitly related to FreeType and the X Render Extension, and it sits alongside freedesktop.org desktop plumbing used by font-aware applications and toolkits.

### 来源

- <https://gitlab.freedesktop.org/fontconfig/fontconfig/-/raw/main/README.md>
- <https://wiki.freedesktop.org/www/Software/fontconfig>
- <https://www.freedesktop.org/software/fontconfig/fontconfig-user.html>
- <https://www.freedesktop.org/software/fontconfig/release/>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: /etc/fonts/fonts.conf, /etc/fonts/conf.d, $XDG_CONFIG_HOME/fontconfig/fonts.conf, $XDG_CONFIG_HOME/fontconfig/conf.d, ~/.fonts.conf, ~/.fonts.conf.d
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** fontconfig
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Debian apt - fontconfig - 2.15.0-2.3: normalized package name match | Debian stable package indexes: fontconfig from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generic font configuration library - support binaries | https://www.freedesktop.org/wiki/Software/fontconfig/
- Debian apt - fontconfig-config - 2.15.0-2.3: normalized package name match | Debian stable package indexes: fontconfig-config from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generic font configuration library - configuration | https://www.freedesktop.org/wiki/Software/fontconfig/
- Debian apt - libfontconfig-dev - 2.15.0-2.3: normalized package name match | Debian stable package indexes: libfontconfig-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generic font configuration library - development | https://www.freedesktop.org/wiki/Software/fontconfig/
- Debian apt - libfontconfig-doc - 2.15.0-2.3: normalized package name match | Debian stable package indexes: libfontconfig-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generic font configuration library - documentation | https://www.freedesktop.org/wiki/Software/fontconfig/
- Debian apt - libfontconfig1 - 2.15.0-2.3: normalized package name match | Debian stable package indexes: libfontconfig1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generic font configuration library - runtime | https://www.freedesktop.org/wiki/Software/fontconfig/
- Debian apt - libfontconfig1-dev - 2.15.0-2.3: normalized package name match | Debian stable package indexes: libfontconfig1-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generic font configuration library - dummy package | https://www.freedesktop.org/wiki/Software/fontconfig/
- Nix - fontconfig: normalized package name match | nixpkgs package indexes: fontconfig from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - fontconfig - 2.15.0-1.1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: fontconfig from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | generic font configuration library - support binaries | https://www.freedesktop.org/wiki/Software/fontconfig/
- Ubuntu apt - fontconfig-config - 2.15.0-1.1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: fontconfig-config from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | generic font configuration library - configuration | https://www.freedesktop.org/wiki/Software/fontconfig/
- Ubuntu apt - libfontconfig-dev - 2.15.0-1.1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libfontconfig-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | generic font configuration library - development | https://www.freedesktop.org/wiki/Software/fontconfig/
- Ubuntu apt - libfontconfig-doc - 2.15.0-1.1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libfontconfig-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | generic font configuration library - documentation | https://www.freedesktop.org/wiki/Software/fontconfig/
- Ubuntu apt - libfontconfig1 - 2.15.0-1.1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libfontconfig1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | generic font configuration library - runtime | https://www.freedesktop.org/wiki/Software/fontconfig/
- Ubuntu apt - libfontconfig1-dev - 2.15.0-1.1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libfontconfig1-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | generic font configuration library - dummy package | https://www.freedesktop.org/wiki/Software/fontconfig/
- apk - fontconfig - 2.18.1-r0: normalized package name match | Alpine Linux edge package indexes: fontconfig from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Library for configuring and customizing font access | https://www.freedesktop.org/wiki/Software/fontconfig
- apk - fontconfig-dev - 2.18.1-r0: normalized package name match | Alpine Linux edge package indexes: fontconfig-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Library for configuring and customizing font access (development files) | https://www.freedesktop.org/wiki/Software/fontconfig
- apk - fontconfig-doc - 2.18.1-r0: normalized package name match | Alpine Linux edge package indexes: fontconfig-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Library for configuring and customizing font access (documentation) | https://www.freedesktop.org/wiki/Software/fontconfig


## 相关链接

- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Media and graphics packages](https://pkg.so/zh-hans/media-graphics-tools/) - Matched media, image, audio, video, or graphics metadata.
- [gettext](https://pkg.so/zh-hans/brew/gettext/) - Runtime dependency declared by Homebrew.
- [freetype](https://pkg.so/zh-hans/brew/freetype/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [ninja](https://pkg.so/zh-hans/brew/ninja/) - Build dependency declared by Homebrew.
- [meson](https://pkg.so/zh-hans/brew/meson/) - Build dependency declared by Homebrew.
- [pango](https://pkg.so/zh-hans/brew/pango/) - Popular package that depends on this formula.
- [cairo](https://pkg.so/zh-hans/brew/cairo/) - Popular package that depends on this formula.
- [poppler](https://pkg.so/zh-hans/brew/poppler/) - Popular package that depends on this formula.
- [tesseract](https://pkg.so/zh-hans/brew/tesseract/) - Popular package that depends on this formula.
- [librsvg](https://pkg.so/zh-hans/brew/librsvg/) - Popular package that depends on this formula.
- [graphviz](https://pkg.so/zh-hans/brew/graphviz/) - Popular package that depends on this formula.
- [libbluray](https://pkg.so/zh-hans/brew/libbluray/) - Popular package that depends on this formula.
- [ghostscript](https://pkg.so/zh-hans/brew/ghostscript/) - Popular package that depends on this formula.
- [fontforge](https://pkg.so/zh-hans/brew/fontforge/) - Shares pkgdb curated category or tags: cli, fonts, media.
- [feh](https://pkg.so/zh-hans/brew/feh/) - Shares pkgdb curated category or tags: cli, media, x11.
- [xfig](https://pkg.so/zh-hans/brew/xfig/) - Shares pkgdb curated category or tags: cli, media, x11.
- [font-util](https://pkg.so/zh-hans/brew/font-util/) - Shares pkgdb curated category or tags: cli, fonts, media.
- [mftrace](https://pkg.so/zh-hans/brew/mftrace/) - Shares pkgdb curated category or tags: cli, fonts, media.
- [xplanet](https://pkg.so/zh-hans/brew/xplanet/) - Shares pkgdb curated category or tags: cli, media, x11.
- [eot-utils](https://pkg.so/zh-hans/brew/eot-utils/) - Shares pkgdb curated category or tags: cli, fonts, media.
- [pulseaudio](https://pkg.so/zh-hans/brew/pulseaudio/) - Local package facts share a topical domain. Shared terms: cli, gettext, media.

## Combined YAML source

View the package source record on GitHub. [combined/fontconfig.yml](https://github.com/mxcl/pkgdb/blob/main/combined/fontconfig.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
