Fontconfig
From Wikipedia, the free encyclopedia
Fontconfig | |
Developer: | Keith Packard |
---|---|
Latest release: | 2.4.0 / September 9, 2006 |
Preview release: | 2.3.95 / - |
OS: | Unix-like systems |
Use: | 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.
Applications can use fontconfig in two ways:
- by querying it for the available fonts on the system or
- 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
- ~/.font.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 two 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.
Fontconfig depends on FreeType, a font renderer, and expat, an XML parser library, both are free software.
[edit] Versioning scheme
The current stable version of fontconfig is 2.4.0: fontconfig uses a versioning scheme in which values of 90 or above in the last number indicate prerelease versions.
[edit] External links
- Fontconfig manual
- fontconfig.org wiki
- Fontconfig releases
- Font Configuration and Customization for Open Source Systems (PDF)