Fontconfig

From Wikipedia, the free encyclopedia

Fontconfig
Developed by Keith Packard
Latest release 2.6.0 / May 29, 2008 (2008-05-29); 10 days ago
OS Unix-like systems
Genre Font handling library
Website http://fontconfig.org/

Fontconfig (the name is spelled in both capitalized and uncapitalized form) is a library designed to provide system-wide font configuration, customization, and application access. Fontconfig is written and maintained by Keith Packard.

Fontconfig is distributed under a permissive free software licence, and is thus free software.[1]

Applications can use fontconfig in two ways:

  1. by querying it for the available fonts on the system or
  2. by asking it for a font matching certain parameters (pattern). Fontconfig will then return a font whose properties match those specified in the pattern as closely as possible.

To perform font matching, fontconfig stores a lot of typesetting information about all of the installed fonts, such as the name of the font family, style, weight, DPI, Unicode coverage etc. This information is also used to perform font substitution.

Contents

[edit] Files

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

Master configuration file is usually /etc/fonts/fonts.conf; it references a few other configuration locations which may or may not exist:

  • /etc/fonts/local.conf
  • /etc/fonts/conf.d directory
  • ~/.fonts.conf

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>

See the fontconfig manual for details.

[edit] Utilities

fontconfig ships with four command line utilities to manage the font configuration:

  • fc-list: Lists all fonts fontconfig knows about or all fonts matching a pattern.
  • fc-cache: Creates a cache of all FreeType readable fonts in a specified directory or create a cache of all FreeType readable fonts from all directories specified in Configuration files.
  • fc-cat: reads the font information from cache files or related to font directories and emits it in ASCII form.
  • fc-match: matches font-pattern (empty pattern by default) using the normal fontconfig matching rules to find the best font available.

Fontconfig depends on FreeType, a font renderer, and expat, an XML parser library, both are free software.

Fontmatrix is a tool at a higher level that help with a graphic user interface, to display, choose and manage fontes, using fontconfig, over the system.

[edit] Versioning scheme

fontconfig uses a versioning scheme in which values of 90 or above in the last number indicate prerelease versions.

[edit] External links

[edit] References

  1. ^ fontconfig-2.6.0.tar.gz (see file "COPYING"). “Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Keith Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission...”
Languages