Fontconfig

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Fontconfig
Developer(s) Keith Packard
Stable release 2.8.0 / November 18, 2009; 2 years ago (2009-11-18)
Operating system Unix-like systems
Type Font handling library
Website http://fontconfig.org/

Fontconfig (or fontconfig) is a computer program library designed to provide system-wide font configuration, customization, and application access. Fontconfig is written and was originally maintained by Keith Packard. Its current maintainer is Behdad Esfahbod.[1]

Fontconfig is free software distributed under a permissive free software license.[2]

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 typesetting information about all of the installed fonts, including the name of the font family, style, weight, DPI, and Unicode coverage. This information is also used to perform font substitution.

Contents

[edit] Files

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:

  • /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>

[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 most appropriate font available.

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

Fontconfig is commonly used under GNU and Unix-like systems for querying and listing installed fonts and their properties. It is used by toolkits like GTK+ and Qt, document preparation systems like XeTeX (which also uses it under MS Windows), font managers like Fontmatrix, and other applications like Mozilla Firefox.

[edit] Versioning scheme

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

[edit] See also

[edit] References

  1. ^ http://lists.freedesktop.org/archives/fontconfig/2009-June/003177.html
  2. ^ "fontconfig-2.6.0.tar.gz (see file "COPYING")". http://fontconfig.org/release/fontconfig-2.6.0.tar.gz. "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..." 

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages