12c393a42Smrg<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ 22c393a42Smrg<!ENTITY version SYSTEM "version.sgml"> 32c393a42Smrg<!ENTITY confdir SYSTEM "confdir.sgml"> 42c393a42Smrg]> 52c393a42Smrg<!-- 62c393a42Smrg Copyright © 2003 Keith Packard 7ae02b298Smrg 82c393a42Smrg Permission to use, copy, modify, distribute, and sell this software and its 92c393a42Smrg documentation for any purpose is hereby granted without fee, provided that 102c393a42Smrg the above copyright notice appear in all copies and that both that 112c393a42Smrg copyright notice and this permission notice appear in supporting 12ca08ab68Smrg documentation, and that the name of the author(s) not be used in 132c393a42Smrg advertising or publicity pertaining to distribution of the software without 14ca08ab68Smrg specific, written prior permission. The authors make no 152c393a42Smrg representations about the suitability of this software for any purpose. It 162c393a42Smrg is provided "as is" without express or implied warranty. 17ae02b298Smrg 18a6844aabSmrg THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 192c393a42Smrg INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 20a6844aabSmrg EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 212c393a42Smrg CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 222c393a42Smrg DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 232c393a42Smrg TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 242c393a42Smrg PERFORMANCE OF THIS SOFTWARE. 252c393a42Smrg--> 262c393a42Smrg<refentry> 272c393a42Smrg<refmeta> 282c393a42Smrg <refentrytitle>fonts-conf</refentrytitle> 292c393a42Smrg <manvolnum>5</manvolnum> 302c393a42Smrg</refmeta> 312c393a42Smrg<refnamediv> 32ae02b298Smrg <refname>fonts.conf</refname> 33ae02b298Smrg <refpurpose>Font configuration files</refpurpose> 342c393a42Smrg</refnamediv> 352c393a42Smrg<refsynopsisdiv> 362c393a42Smrg<synopsis> 372c393a42Smrg &confdir;/fonts.conf 382c393a42Smrg &confdir;/fonts.dtd 392c393a42Smrg &confdir;/conf.d 40ca08ab68Smrg $XDG_CONFIG_HOME/fontconfig/conf.d 41ca08ab68Smrg $XDG_CONFIG_HOME/fontconfig/fonts.conf 42a6844aabSmrg ~/.fonts.conf.d 432c393a42Smrg ~/.fonts.conf 442c393a42Smrg</synopsis> 452c393a42Smrg</refsynopsisdiv> 462c393a42Smrg<refsect1><title>Description</title> 472c393a42Smrg <para> 482c393a42SmrgFontconfig is a library designed to provide system-wide font configuration, 492c393a42Smrgcustomization and application access. 502c393a42Smrg </para> 512c393a42Smrg</refsect1> 522c393a42Smrg<refsect1><title>Functional Overview</title> 532c393a42Smrg <para> 542c393a42SmrgFontconfig contains two essential modules, the configuration module which 552c393a42Smrgbuilds an internal configuration from XML files and the matching module 562c393a42Smrgwhich accepts font patterns and returns the nearest matching font. 572c393a42Smrg </para> 582c393a42Smrg <refsect2><title>Font Configuration</title> 592c393a42Smrg <para> 602c393a42SmrgThe configuration module consists of the FcConfig datatype, libexpat and 612c393a42SmrgFcConfigParse which walks over an XML tree and amends a configuration with 622c393a42Smrgdata found within. From an external perspective, configuration of the 632c393a42Smrglibrary consists of generating a valid XML tree and feeding that to 642c393a42SmrgFcConfigParse. The only other mechanism provided to applications for 652c393a42Smrgchanging the running configuration is to add fonts and directories to the 66ae02b298Smrglist of application-provided font files. 672c393a42Smrg </para><para> 682c393a42SmrgThe intent is to make font configurations relatively static, and shared by 692c393a42Smrgas many applications as possible. It is hoped that this will lead to more 702c393a42Smrgstable font selection when passing names from one application to another. 712c393a42SmrgXML was chosen as a configuration file format because it provides a format 722c393a42Smrgwhich is easy for external agents to edit while retaining the correct 732c393a42Smrgstructure and syntax. 742c393a42Smrg </para><para> 752c393a42SmrgFont configuration is separate from font matching; applications needing to 762c393a42Smrgdo their own matching can access the available fonts from the library and 772c393a42Smrgperform private matching. The intent is to permit applications to pick and 782c393a42Smrgchoose appropriate functionality from the library instead of forcing them to 792c393a42Smrgchoose between this library and a private configuration mechanism. The hope 802c393a42Smrgis that this will ensure that configuration of fonts for all applications 812c393a42Smrgcan be centralized in one place. Centralizing font configuration will 822c393a42Smrgsimplify and regularize font installation and customization. 832c393a42Smrg </para> 842c393a42Smrg </refsect2> 852c393a42Smrg <refsect2> 862c393a42Smrg <title>Font Properties</title> 872c393a42Smrg <para> 882c393a42SmrgWhile font patterns may contain essentially any properties, there are some 892c393a42Smrgwell known properties with associated types. Fontconfig uses some of these 902c393a42Smrgproperties for font matching and font completion. Others are provided as a 912c393a42Smrgconvenience for the applications' rendering mechanism. 922c393a42Smrg </para> 932c393a42Smrg <programlisting> 94ae02b298SmrgProperty Type Description 95ae02b298Smrg-------------------------------------------------------------- 96ae02b298Smrgfamily String Font family names 97ae02b298Smrgfamilylang String Languages corresponding to each family 98ae02b298Smrgstyle String Font style. Overrides weight and slant 99ae02b298Smrgstylelang String Languages corresponding to each style 100ae02b298Smrgfullname String Font full names (often includes style) 101ae02b298Smrgfullnamelang String Languages corresponding to each fullname 102ae02b298Smrgslant Int Italic, oblique or roman 103ae02b298Smrgweight Int Light, medium, demibold, bold or black 104ae02b298Smrgsize Double Point size 105ae02b298Smrgwidth Int Condensed, normal or expanded 106ae02b298Smrgaspect Double Stretches glyphs horizontally before hinting 107ae02b298Smrgpixelsize Double Pixel size 108ae02b298Smrgspacing Int Proportional, dual-width, monospace or charcell 109ae02b298Smrgfoundry String Font foundry name 110ae02b298Smrgantialias Bool Whether glyphs can be antialiased 111ae02b298Smrghinting Bool Whether the rasterizer should use hinting 112ae02b298Smrghintstyle Int Automatic hinting style 113ae02b298Smrgverticallayout Bool Use vertical layout 114ae02b298Smrgautohint Bool Use autohinter instead of normal hinter 115ae02b298Smrgglobaladvance Bool Use font global advance data (deprecated) 116ae02b298Smrgfile String The filename holding the font 117ae02b298Smrgindex Int The index of the font within the file 118ae02b298Smrgftface FT_Face Use the specified FreeType face object 119ae02b298Smrgrasterizer String Which rasterizer is in use (deprecated) 120ae02b298Smrgoutline Bool Whether the glyphs are outlines 121ae02b298Smrgscalable Bool Whether glyphs can be scaled 122ae02b298Smrgcolor Bool Whether any glyphs have color 123ae02b298Smrgscale Double Scale factor for point->pixel conversions 124ae02b298Smrg (deprecated) 125ae02b298Smrgdpi Double Target dots per inch 126ae02b298Smrgrgba Int unknown, rgb, bgr, vrgb, vbgr, 127ae02b298Smrg none - subpixel geometry 128ae02b298Smrglcdfilter Int Type of LCD filter 129ae02b298Smrgminspace Bool Eliminate leading from line spacing 130ae02b298Smrgcharset CharSet Unicode chars encoded by the font 131ae02b298Smrglang String List of RFC-3066-style languages this 132ae02b298Smrg font supports 133ae02b298Smrgfontversion Int Version number of the font 134ae02b298Smrgcapability String List of layout capabilities in the font 135ae02b298Smrgfontformat String String name of the font format 136ae02b298Smrgembolden Bool Rasterizer should synthetically embolden the font 137ae02b298Smrgembeddedbitmap Bool Use the embedded bitmap instead of the outline 138ae02b298Smrgdecorative Bool Whether the style is a decorative variant 139ae02b298Smrgfontfeatures String List of the feature tags in OpenType to be enabled 140ae02b298Smrgnamelang String Language name to be used for the default value of 141ae02b298Smrg familylang, stylelang, and fullnamelang 142ae02b298Smrgprgname String String Name of the running program 143ae02b298Smrgpostscriptname String Font family name in PostScript 144ae02b298Smrgfonthashint Bool Whether the font has hinting 145ae02b298Smrgorder Int Order number of the font 1462c393a42Smrg </programlisting> 1472c393a42Smrg </refsect2> 1482c393a42Smrg <refsect2> 1492c393a42Smrg <title>Font Matching</title> 1502c393a42Smrg <para> 1512c393a42SmrgFontconfig performs matching by measuring the distance from a provided 1522c393a42Smrgpattern to all of the available fonts in the system. The closest matching 1532c393a42Smrgfont is selected. This ensures that a font will always be returned, but 1542c393a42Smrgdoesn't ensure that it is anything like the requested pattern. 155ae02b298Smrg </para><para> 1562c393a42SmrgFont matching starts with an application constructed pattern. The desired 1572c393a42Smrgattributes of the resulting font are collected together in a pattern. Each 1582c393a42Smrgproperty of the pattern can contain one or more values; these are listed in 1592c393a42Smrgpriority order; matches earlier in the list are considered "closer" than 1602c393a42Smrgmatches later in the list. 1612c393a42Smrg </para><para> 1622c393a42SmrgThe initial pattern is modified by applying the list of editing instructions 1632c393a42Smrgspecific to patterns found in the configuration; each consists of a match 1642c393a42Smrgpredicate and a set of editing operations. They are executed in the order 1652c393a42Smrgthey appeared in the configuration. Each match causes the associated 1662c393a42Smrgsequence of editing operations to be applied. 1672c393a42Smrg </para><para> 1682c393a42SmrgAfter the pattern has been edited, a sequence of default substitutions are 1692c393a42Smrgperformed to canonicalize the set of available properties; this avoids the 1702c393a42Smrgneed for the lower layers to constantly provide default values for various 1712c393a42Smrgfont properties during rendering. 1722c393a42Smrg </para><para> 1732c393a42SmrgThe canonical font pattern is finally matched against all available fonts. 1742c393a42SmrgThe distance from the pattern to the font is measured for each of several 1752c393a42Smrgproperties: foundry, charset, family, lang, spacing, pixelsize, style, 1762c393a42Smrgslant, weight, antialias, rasterizer and outline. This list is in priority 1772c393a42Smrgorder -- results of comparing earlier elements of this list weigh more 1782c393a42Smrgheavily than later elements. 1792c393a42Smrg </para><para> 1802c393a42SmrgThere is one special case to this rule; family names are split into two 1812c393a42Smrgbindings; strong and weak. Strong family names are given greater precedence 1822c393a42Smrgin the match than lang elements while weak family names are given lower 1832c393a42Smrgprecedence than lang elements. This permits the document language to drive 1842c393a42Smrgfont selection when any document specified font is unavailable. 1852c393a42Smrg </para><para> 1862c393a42SmrgThe pattern representing that font is augmented to include any properties 1872c393a42Smrgfound in the pattern but not found in the font itself; this permits the 1882c393a42Smrgapplication to pass rendering instructions or any other data through the 1892c393a42Smrgmatching system. Finally, the list of editing instructions specific to 1902c393a42Smrgfonts found in the configuration are applied to the pattern. This modified 1912c393a42Smrgpattern is returned to the application. 1922c393a42Smrg </para><para> 1932c393a42SmrgThe return value contains sufficient information to locate and rasterize the 1942c393a42Smrgfont, including the file name, pixel size and other rendering data. As 1952c393a42Smrgnone of the information involved pertains to the FreeType library, 1962c393a42Smrgapplications are free to use any rasterization engine or even to take 1972c393a42Smrgthe identified font file and access it directly. 1982c393a42Smrg </para><para> 1992c393a42SmrgThe match/edit sequences in the configuration are performed in two passes 2002c393a42Smrgbecause there are essentially two different operations necessary -- the 2012c393a42Smrgfirst is to modify how fonts are selected; aliasing families and adding 2022c393a42Smrgsuitable defaults. The second is to modify how the selected fonts are 2032c393a42Smrgrasterized. Those must apply to the selected font, not the original pattern 2042c393a42Smrgas false matches will often occur. 2052c393a42Smrg </para> 2062c393a42Smrg </refsect2> 2072c393a42Smrg <refsect2><title>Font Names</title> 2082c393a42Smrg <para> 2092c393a42SmrgFontconfig provides a textual representation for patterns that the library 2102c393a42Smrgcan both accept and generate. The representation is in three parts, first a 2112c393a42Smrglist of family names, second a list of point sizes and finally a list of 2122c393a42Smrgadditional properties: 2132c393a42Smrg </para> 2142c393a42Smrg <programlisting> 215ae02b298Smrg<families>-<point sizes>:<name1>=<values1>:<name2>=<values2>... 2162c393a42Smrg </programlisting> 2172c393a42Smrg <para> 2182c393a42SmrgValues in a list are separated with commas. The name needn't include either 2192c393a42Smrgfamilies or point sizes; they can be elided. In addition, there are 2202c393a42Smrgsymbolic constants that simultaneously indicate both a name and a value. 2212c393a42SmrgHere are some examples: 2222c393a42Smrg </para> 2232c393a42Smrg <programlisting> 224ae02b298SmrgName Meaning 225ae02b298Smrg---------------------------------------------------------- 226ae02b298SmrgTimes-12 12 point Times Roman 227ae02b298SmrgTimes-12:bold 12 point Times Bold 228ae02b298SmrgCourier:italic Courier Italic in the default size 229ae02b298SmrgMonospace:matrix=1 .1 0 1 The users preferred monospace font 230ae02b298Smrg with artificial obliquing 2312c393a42Smrg </programlisting> 2322c393a42Smrg <para> 233ca08ab68SmrgThe '\', '-', ':' and ',' characters in family names must be preceded by a 2342c393a42Smrg'\' character to avoid having them misinterpreted. Similarly, values 235ca08ab68Smrgcontaining '\', '=', '_', ':' and ',' must also have them preceded by a 2362c393a42Smrg'\' character. The '\' characters are stripped out of the family name and 2372c393a42Smrgvalues as the font name is read. 2382c393a42Smrg </para> 2392c393a42Smrg </refsect2> 2402c393a42Smrg</refsect1> 241ca08ab68Smrg<refsect1 id="debug"><title>Debugging Applications</title> 2422c393a42Smrg <para> 2432c393a42SmrgTo help diagnose font and applications problems, fontconfig is built with a 2442c393a42Smrglarge amount of internal debugging left enabled. It is controlled by means 2452c393a42Smrgof the FC_DEBUG environment variable. The value of this variable is 2462c393a42Smrginterpreted as a number, and each bit within that value controls different 2472c393a42Smrgdebugging messages. 2482c393a42Smrg </para> 2492c393a42Smrg <programlisting> 250ae02b298SmrgName Value Meaning 251ae02b298Smrg--------------------------------------------------------- 252ae02b298SmrgMATCH 1 Brief information about font matching 253ae02b298SmrgMATCHV 2 Extensive font matching information 254ae02b298SmrgEDIT 4 Monitor match/test/edit execution 255ae02b298SmrgFONTSET 8 Track loading of font information at startup 256ae02b298SmrgCACHE 16 Watch cache files being written 257ae02b298SmrgCACHEV 32 Extensive cache file writing information 258ae02b298SmrgPARSE 64 (no longer in use) 259ae02b298SmrgSCAN 128 Watch font files being scanned to build caches 260ae02b298SmrgSCANV 256 Verbose font file scanning information 261ae02b298SmrgMEMORY 512 Monitor fontconfig memory usage 262ae02b298SmrgCONFIG 1024 Monitor which config files are loaded 263ae02b298SmrgLANGSET 2048 Dump char sets used to construct lang values 264ae02b298SmrgMATCH2 4096 Display font-matching transformation in patterns 2652c393a42Smrg </programlisting> 2662c393a42Smrg <para> 2672c393a42SmrgAdd the value of the desired debug levels together and assign that (in 2682c393a42Smrgbase 10) to the FC_DEBUG environment variable before running the 2692c393a42Smrgapplication. Output from these statements is sent to stdout. 2702c393a42Smrg </para> 2712c393a42Smrg</refsect1> 2722c393a42Smrg<refsect1><title>Lang Tags</title> 2732c393a42Smrg <para> 2742c393a42SmrgEach font in the database contains a list of languages it supports. This is 2752c393a42Smrgcomputed by comparing the Unicode coverage of the font with the orthography 2762c393a42Smrgof each language. Languages are tagged using an RFC-3066 compatible naming 2772c393a42Smrgand occur in two parts -- the ISO 639 language tag followed a hyphen and then 2782c393a42Smrgby the ISO 3166 country code. The hyphen and country code may be elided. 2792c393a42Smrg </para><para> 2802c393a42SmrgFontconfig has orthographies for several languages built into the library. 2812c393a42SmrgNo provision has been made for adding new ones aside from rebuilding the 2822c393a42Smrglibrary. It currently supports 122 of the 139 languages named in ISO 639-1, 2832c393a42Smrg141 of the languages with two-letter codes from ISO 639-2 and another 30 2842c393a42Smrglanguages with only three-letter codes. Languages with both two and three 2852c393a42Smrgletter codes are provided with only the two letter code. 2862c393a42Smrg </para><para> 2872c393a42SmrgFor languages used in multiple territories with radically different 2882c393a42Smrgcharacter sets, fontconfig includes per-territory orthographies. This 2892c393a42Smrgincludes Azerbaijani, Kurdish, Pashto, Tigrinya and Chinese. 2902c393a42Smrg </para> 2912c393a42Smrg</refsect1> 2922c393a42Smrg<refsect1><title>Configuration File Format</title> 2932c393a42Smrg <para> 2942c393a42SmrgConfiguration files for fontconfig are stored in XML format; this 2952c393a42Smrgformat makes external configuration tools easier to write and ensures that 2962c393a42Smrgthey will generate syntactically correct configuration files. As XML 2972c393a42Smrgfiles are plain text, they can also be manipulated by the expert user using 2982c393a42Smrga text editor. 2992c393a42Smrg </para><para> 3002c393a42SmrgThe fontconfig document type definition resides in the external entity 3012c393a42Smrg"fonts.dtd"; this is normally stored in the default font configuration 3022c393a42Smrgdirectory (&confdir;). Each configuration file should contain the 3032c393a42Smrgfollowing structure: 3042c393a42Smrg <programlisting> 305ae02b298Smrg<?xml version="1.0"?> 306ae02b298Smrg<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> 307ae02b298Smrg<fontconfig> 308ae02b298Smrg... 309ae02b298Smrg</fontconfig> 3102c393a42Smrg </programlisting> 3112c393a42Smrg </para> 3122c393a42Smrg<refsect2><title><literal><fontconfig></literal></title><para> 3132c393a42SmrgThis is the top level element for a font configuration and can contain 314ca08ab68Smrg<literal><dir></literal>, <literal><cachedir></literal>, <literal><include></literal>, <literal><match></literal> and <literal><alias></literal> elements in any order. 3152c393a42Smrg </para></refsect2> 316a4e54154Smrg <refsect2><title><literal><dir prefix="default" salt=""></literal></title><para> 3172c393a42SmrgThis element contains a directory name which will be scanned for font files 318a4e54154Smrgto include in the set of available fonts. 319a4e54154Smrg </para><para> 320a4e54154SmrgIf 'prefix' is set to "default" or "cwd", the current working directory will be added as the path prefix prior to the value. If 'prefix' is set to "xdg", the value in the XDG_DATA_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details. If 'prefix' is set to "relative", the path of current file will be added prior to the value. 321a4e54154Smrg </para><para> 322a4e54154Smrg'salt' property affects to determine cache filename. this is useful for example when having different fonts sets on same path at container and share fonts from host on different font path. 3232c393a42Smrg </para></refsect2> 324ca08ab68Smrg <refsect2><title><literal><cachedir prefix="default"></literal></title><para> 325ca08ab68SmrgThis element contains a directory name that is supposed to be stored or read 326ca08ab68Smrgthe cache of font information. If multiple elements are specified in 327ca08ab68Smrgthe configuration file, the directory that can be accessed first in the list 328ca08ab68Smrgwill be used to store the cache files. If it starts with '~', it refers to 329ca08ab68Smrga directory in the users home directory. If 'prefix' is set to "xdg", the value in the XDG_CACHE_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details. 330ca08ab68SmrgThe default directory is ``$XDG_CACHE_HOME/fontconfig'' and it contains the cache files 331953daebaSmrgnamed ``<literal><hash value></literal>-<literal><architecture></literal>.cache-<literal><version></literal>'', 332953daebaSmrgwhere <literal><version></literal> is the fontconfig cache file 333ae02b298Smrgversion number (currently 8). 3342c393a42Smrg </para></refsect2> 335ca08ab68Smrg <refsect2><title><literal><include ignore_missing="no" prefix="default"></literal></title><para> 3362c393a42SmrgThis element contains the name of an additional configuration file or 3372c393a42Smrgdirectory. If a directory, every file within that directory starting with an 3382c393a42SmrgASCII digit (U+0030 - U+0039) and ending with the string ``.conf'' will be processed in sorted order. When 3392c393a42Smrgthe XML datatype is traversed by FcConfigParse, the contents of the file(s) 3402c393a42Smrgwill also be incorporated into the configuration by passing the filename(s) to 3412c393a42SmrgFcConfigLoadAndParse. If 'ignore_missing' is set to "yes" instead of the 3422c393a42Smrgdefault "no", a missing file or directory will elicit no warning message from 343ca08ab68Smrgthe library. If 'prefix' is set to "xdg", the value in the XDG_CONFIG_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details. 3442c393a42Smrg </para></refsect2> 3452c393a42Smrg <refsect2><title><literal><config></literal></title><para> 3462c393a42SmrgThis element provides a place to consolidate additional configuration 3472c393a42Smrginformation. <literal><config></literal> can contain <literal><blank></literal> and <literal><rescan></literal> elements in any 3482c393a42Smrgorder. 349a4e54154Smrg </para></refsect2> 350a4e54154Smrg <refsect2><title><literal><description domain="fontconfig-conf"></literal></title><para> 351a4e54154SmrgThis element is supposed to hold strings which describe what a config is used for. 352a4e54154SmrgThis string can be translated through gettext. 'domain' needs to be set the proper name to apply then. 353a4e54154Smrgfontconfig will tries to retrieve translations with 'domain' from gettext. 3542c393a42Smrg </para></refsect2> 3552c393a42Smrg <refsect2><title><literal><blank></literal></title><para> 3562c393a42SmrgFonts often include "broken" glyphs which appear in the encoding but are 3572c393a42Smrgdrawn as blanks on the screen. Within the <literal><blank></literal> element, place each 3582c393a42SmrgUnicode characters which is supposed to be blank in an <literal><int></literal> element. 3592c393a42SmrgCharacters outside of this set which are drawn as blank will be elided from 3602c393a42Smrgthe set of characters supported by the font. 361a4e54154Smrg </para></refsect2> 362a4e54154Smrg <refsect2><title><literal><remap-dir prefix="default" as-path="" salt=""></literal></title><para> 363a4e54154SmrgThis element contains a directory name where will be mapped 364a4e54154Smrgas the path 'as-path' in cached information. 365a4e54154SmrgThis is useful if the directory name is an alias 366a4e54154Smrg(via a bind mount or symlink) to another directory in the system for 367a4e54154Smrgwhich cached font information is likely to exist. 368a4e54154Smrg </para><para> 369a4e54154Smrg'salt' property affects to determine cache filename as same as <literal><dir></literal> element. 370a4e54154Smrg </para></refsect2> 371a4e54154Smrg <refsect2><title><literal><reset-dirs /></literal></title><para> 372a4e54154SmrgThis element removes all of fonts directories where added by <literal><dir></literal> elements. 373a4e54154SmrgThis is useful to override fonts directories from system to own fonts directories only. 3742c393a42Smrg </para></refsect2> 3752c393a42Smrg <refsect2><title><literal><rescan></literal></title><para> 3762c393a42SmrgThe <literal><rescan></literal> element holds an <literal><int></literal> element which indicates the default 3772c393a42Smrginterval between automatic checks for font configuration changes. 3782c393a42SmrgFontconfig will validate all of the configuration files and directories and 3792c393a42Smrgautomatically rebuild the internal datastructures when this interval passes. 3802c393a42Smrg </para></refsect2> 3812c393a42Smrg <refsect2><title><literal><selectfont></literal></title><para> 3822c393a42SmrgThis element is used to black/white list fonts from being listed or matched 3832c393a42Smrgagainst. It holds acceptfont and rejectfont elements. 3842c393a42Smrg </para></refsect2> 3852c393a42Smrg <refsect2><title><literal><acceptfont></literal></title><para> 3862c393a42SmrgFonts matched by an acceptfont element are "whitelisted"; such fonts are 3872c393a42Smrgexplicitly included in the set of fonts used to resolve list and match 3882c393a42Smrgrequests; including them in this list protects them from being "blacklisted" 3892c393a42Smrgby a rejectfont element. Acceptfont elements include glob and pattern 3902c393a42Smrgelements which are used to match fonts. 3912c393a42Smrg </para></refsect2> 3922c393a42Smrg <refsect2><title><literal><rejectfont></literal></title><para> 3932c393a42SmrgFonts matched by an rejectfont element are "blacklisted"; such fonts are 3942c393a42Smrgexcluded from the set of fonts used to resolve list and match requests as if 3952c393a42Smrgthey didn't exist in the system. Rejectfont elements include glob and 3962c393a42Smrgpattern elements which are used to match fonts. 3972c393a42Smrg </para></refsect2> 3982c393a42Smrg <refsect2><title><literal><glob></literal></title><para> 3992c393a42SmrgGlob elements hold shell-style filename matching patterns (including ? and 400ae02b298Smrg*) which match fonts based on their complete pathnames. If it starts with '~', 401ae02b298Smrgit refers to a directory in the users home directory. This can be used to 4022c393a42Smrgexclude a set of directories (/usr/share/fonts/uglyfont*), or particular 4032c393a42Smrgfont file types (*.pcf.gz), but the latter mechanism relies rather heavily 4042c393a42Smrgon filenaming conventions which can't be relied upon. Note that globs 4052c393a42Smrgonly apply to directories, not to individual fonts. 4062c393a42Smrg </para></refsect2> 4072c393a42Smrg <refsect2><title><literal><pattern></literal></title><para> 4082c393a42SmrgPattern elements perform list-style matching on incoming fonts; that is, 4092c393a42Smrgthey hold a list of elements and associated values. If all of those 4102c393a42Smrgelements have a matching value, then the pattern matches the font. This can 4112c393a42Smrgbe used to select fonts based on attributes of the font (scalable, bold, 4122c393a42Smrgetc), which is a more reliable mechanism than using file extensions. 4132c393a42SmrgPattern elements include patelt elements. 4142c393a42Smrg </para></refsect2> 4152c393a42Smrg <refsect2><title><literal><patelt name="property"></literal></title><para> 4162c393a42SmrgPatelt elements hold a single pattern element and list of values. They must 4172c393a42Smrghave a 'name' attribute which indicates the pattern element name. Patelt 4182c393a42Smrgelements include int, double, string, matrix, bool, charset and const 4192c393a42Smrgelements. 4202c393a42Smrg </para></refsect2> 4212c393a42Smrg <refsect2><title><literal><match target="pattern"></literal></title><para> 4222c393a42SmrgThis element holds first a (possibly empty) list of <literal><test></literal> elements and then 4232c393a42Smrga (possibly empty) list of <literal><edit></literal> elements. Patterns which match all of the 4242c393a42Smrgtests are subjected to all the edits. If 'target' is set to "font" instead 4252c393a42Smrgof the default "pattern", then this element applies to the font name 4262c393a42Smrgresulting from a match rather than a font pattern to be matched. If 'target' 4272c393a42Smrgis set to "scan", then this element applies when the font is scanned to 4282c393a42Smrgbuild the fontconfig database. 4292c393a42Smrg </para></refsect2> 4302c393a42Smrg <refsect2><title><literal><test qual="any" name="property" target="default" compare="eq"></literal></title><para> 4312c393a42SmrgThis element contains a single value which is compared with the target 432ae02b298Smrg('pattern', 'font', 'scan' or 'default') property "property" (substitute any of the property names seen 433ca08ab68Smrgabove). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", "more_eq", "contains" or 434ca08ab68Smrg"not_contains". 'qual' may either be the default, "any", in which case the match 4352c393a42Smrgsucceeds if any value associated with the property matches the test value, or 4362c393a42Smrg"all", in which case all of the values associated with the property must 437ca08ab68Smrgmatch the test value. 'ignore-blanks' takes a boolean value. if 'ignore-blanks' is set "true", any blanks in the string will be ignored on its comparison. this takes effects only when compare="eq" or compare="not_eq". 438ca08ab68SmrgWhen used in a <match target="font"> element, 4392c393a42Smrgthe target= attribute in the <test> element selects between matching 4402c393a42Smrgthe original pattern or the font. "default" selects whichever target the 4412c393a42Smrgouter <match> element has selected. 4422c393a42Smrg </para></refsect2> 4432c393a42Smrg <refsect2><title><literal><edit name="property" mode="assign" binding="weak"></literal></title><para> 4442c393a42SmrgThis element contains a list of expression elements (any of the value or 4452c393a42Smrgoperator elements). The expression elements are evaluated at run-time and 4462c393a42Smrgmodify the property "property". The modification depends on whether 4472c393a42Smrg"property" was matched by one of the associated <literal><test></literal> elements, if so, the 4482c393a42Smrgmodification may affect the first matched value. Any values inserted into 4492c393a42Smrgthe property are given the indicated binding ("strong", "weak" or "same") 4502c393a42Smrgwith "same" binding using the value from the matched pattern element. 4512c393a42Smrg'mode' is one of: 4522c393a42Smrg <programlisting> 453ae02b298SmrgMode With Match Without Match 454ae02b298Smrg--------------------------------------------------------------------- 455ae02b298Smrg"assign" Replace matching value Replace all values 456ae02b298Smrg"assign_replace" Replace all values Replace all values 457ae02b298Smrg"prepend" Insert before matching Insert at head of list 458ae02b298Smrg"prepend_first" Insert at head of list Insert at head of list 459ae02b298Smrg"append" Append after matching Append at end of list 460ae02b298Smrg"append_last" Append at end of list Append at end of list 461ae02b298Smrg"delete" Delete matching value Delete all values 462ae02b298Smrg"delete_all" Delete all values Delete all values 4632c393a42Smrg </programlisting> 4642c393a42Smrg </para></refsect2> 4652c393a42Smrg <refsect2><title><literal><int></literal>, <literal><double></literal>, <literal><string></literal>, <literal><bool></literal></title><para> 4662c393a42SmrgThese elements hold a single value of the indicated type. <literal><bool></literal> 4672c393a42Smrgelements hold either true or false. An important limitation exists in 4682c393a42Smrgthe parsing of floating point numbers -- fontconfig requires that 4692c393a42Smrgthe mantissa start with a digit, not a decimal point, so insert a leading 4702c393a42Smrgzero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5 4712c393a42Smrginstead of -.5). 4722c393a42Smrg </para></refsect2> 4732c393a42Smrg <refsect2><title><literal><matrix></literal></title><para> 474c9710b42SmrgThis element holds four numerical expressions of an affine transformation. 475c9710b42SmrgAt their simplest these will be four <literal><double></literal> elements 476c9710b42Smrgbut they can also be more involved expressions. 477ca08ab68Smrg </para></refsect2> 478ca08ab68Smrg <refsect2><title><literal><range></literal></title><para> 479ca08ab68SmrgThis element holds the two <literal><int></literal> elements of a range 480ca08ab68Smrgrepresentation. 481ca08ab68Smrg </para></refsect2> 482ca08ab68Smrg <refsect2><title><literal><charset></literal></title><para> 483ca08ab68SmrgThis element holds at least one <literal><int></literal> element of 484ca08ab68Smrgan Unicode code point or more. 485ca08ab68Smrg </para></refsect2> 486ca08ab68Smrg <refsect2><title><literal><langset></literal></title><para> 487ca08ab68SmrgThis element holds at least one <literal><string></literal> element of 488ca08ab68Smrga RFC-3066-style languages or more. 4892c393a42Smrg </para></refsect2> 4902c393a42Smrg <refsect2><title><literal><name></literal></title><para> 4912c393a42SmrgHolds a property name. Evaluates to the first value from the property of 492c9710b42Smrgthe pattern. If the 'target' attribute is not present, it will default to 493c9710b42Smrg'default', in which case the property is returned from the font pattern 494c9710b42Smrgduring a target="font" match, and to the pattern during a target="pattern" 495c9710b42Smrgmatch. The attribute can also take the values 'font' or 'pattern' to 496c9710b42Smrgexplicitly choose which pattern to use. It is an error to use a target 497c9710b42Smrgof 'font' in a match that has target="pattern". 4982c393a42Smrg </para></refsect2> 4992c393a42Smrg <refsect2><title><literal><const></literal></title><para> 5002c393a42SmrgHolds the name of a constant; these are always integers and serve as 5012c393a42Smrgsymbolic names for common font values: 5022c393a42Smrg <programlisting> 503ae02b298SmrgConstant Property Value 504ae02b298Smrg------------------------------------- 505ae02b298Smrgthin weight 0 506ae02b298Smrgextralight weight 40 507ae02b298Smrgultralight weight 40 508ae02b298Smrglight weight 50 509ae02b298Smrgdemilight weight 55 510ae02b298Smrgsemilight weight 55 511ae02b298Smrgbook weight 75 512ae02b298Smrgregular weight 80 513ae02b298Smrgnormal weight 80 514ae02b298Smrgmedium weight 100 515ae02b298Smrgdemibold weight 180 516ae02b298Smrgsemibold weight 180 517ae02b298Smrgbold weight 200 518ae02b298Smrgextrabold weight 205 519ae02b298Smrgultrabold weight 205 520ae02b298Smrgblack weight 210 521ae02b298Smrgheavy weight 210 522ae02b298Smrgextrablack weight 215 523ae02b298Smrgultrablack weight 215 524ae02b298Smrgroman slant 0 525ae02b298Smrgitalic slant 100 526ae02b298Smrgoblique slant 110 527ae02b298Smrgultracondensed width 50 528ae02b298Smrgextracondensed width 63 529ae02b298Smrgcondensed width 75 530ae02b298Smrgsemicondensed width 87 531ae02b298Smrgnormal width 100 532ae02b298Smrgsemiexpanded width 113 533ae02b298Smrgexpanded width 125 534ae02b298Smrgextraexpanded width 150 535ae02b298Smrgultraexpanded width 200 536ae02b298Smrgproportional spacing 0 537ae02b298Smrgdual spacing 90 538ae02b298Smrgmono spacing 100 539ae02b298Smrgcharcell spacing 110 540ae02b298Smrgunknown rgba 0 541ae02b298Smrgrgb rgba 1 542ae02b298Smrgbgr rgba 2 543ae02b298Smrgvrgb rgba 3 544ae02b298Smrgvbgr rgba 4 545ae02b298Smrgnone rgba 5 546ae02b298Smrglcdnone lcdfilter 0 547ae02b298Smrglcddefault lcdfilter 1 548ae02b298Smrglcdlight lcdfilter 2 549ae02b298Smrglcdlegacy lcdfilter 3 550ae02b298Smrghintnone hintstyle 0 551ae02b298Smrghintslight hintstyle 1 552ae02b298Smrghintmedium hintstyle 2 553ae02b298Smrghintfull hintstyle 3 5542c393a42Smrg </programlisting> 5552c393a42Smrg </para> 5562c393a42Smrg </refsect2> 5572c393a42Smrg <refsect2> 5582c393a42Smrg <title><literal><or></literal>, <literal><and></literal>, <literal><plus></literal>, <literal><minus></literal>, <literal><times></literal>, <literal><divide></literal></title> 5592c393a42Smrg <para> 5602c393a42SmrgThese elements perform the specified operation on a list of expression 5612c393a42Smrgelements. <literal><or></literal> and <literal><and></literal> are boolean, not bitwise. 5622c393a42Smrg </para> 5632c393a42Smrg </refsect2> 5642c393a42Smrg <refsect2> 565ca08ab68Smrg <title><literal><eq></literal>, <literal><not_eq></literal>, <literal><less></literal>, <literal><less_eq></literal>, <literal><more></literal>, <literal><more_eq></literal>, <literal><contains></literal>, <literal><not_contains</literal></title> 5662c393a42Smrg <para> 5672c393a42SmrgThese elements compare two values, producing a boolean result. 5682c393a42Smrg </para></refsect2> 5692c393a42Smrg <refsect2><title><literal><not></literal></title><para> 5702c393a42SmrgInverts the boolean sense of its one expression element 5712c393a42Smrg </para></refsect2> 5722c393a42Smrg <refsect2><title><literal><if></literal></title><para> 5732c393a42SmrgThis element takes three expression elements; if the value of the first is 5742c393a42Smrgtrue, it produces the value of the second, otherwise it produces the value 5752c393a42Smrgof the third. 5762c393a42Smrg </para></refsect2> 5772c393a42Smrg <refsect2><title><literal><alias></literal></title><para> 5782c393a42SmrgAlias elements provide a shorthand notation for the set of common match 5792c393a42Smrgoperations needed to substitute one font family for another. They contain a 5802c393a42Smrg<literal><family></literal> element followed by optional <literal><prefer></literal>, <literal><accept></literal> and <literal><default></literal> 5812c393a42Smrgelements. Fonts matching the <literal><family></literal> element are edited to prepend the 5822c393a42Smrglist of <literal><prefer></literal>ed families before the matching <literal><family></literal>, append the 5832c393a42Smrg<literal><accept></literal>able families after the matching <literal><family></literal> and append the <literal><default></literal> 5842c393a42Smrgfamilies to the end of the family list. 5852c393a42Smrg </para></refsect2> 5862c393a42Smrg <refsect2><title><literal><family></literal></title><para> 5872c393a42SmrgHolds a single font family name 5882c393a42Smrg </para></refsect2> 5892c393a42Smrg <refsect2><title><literal><prefer></literal>, <literal><accept></literal>, <literal><default></literal></title><para> 5902c393a42SmrgThese hold a list of <literal><family></literal> elements to be used by the <literal><alias></literal> element. 5912c393a42Smrg </para></refsect2> 5922c393a42Smrg</refsect1> 5932c393a42Smrg<refsect1><title>EXAMPLE CONFIGURATION FILE</title> 5942c393a42Smrg <refsect2><title>System configuration file</title> 5952c393a42Smrg <para> 5962c393a42SmrgThis is an example of a system-wide configuration file 5972c393a42Smrg </para> 5982c393a42Smrg <programlisting> 5992c393a42Smrg<?xml version="1.0"?> 600a4e54154Smrg<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> 6012c393a42Smrg<!-- &confdir;/fonts.conf file to configure system font access --> 6022c393a42Smrg<fontconfig> 603ae02b298Smrg <!-- 604ae02b298Smrg Find fonts in these directories 605ae02b298Smrg --> 606ae02b298Smrg <dir>/usr/share/fonts</dir> 607ae02b298Smrg <dir>/usr/X11R6/lib/X11/fonts</dir> 6082c393a42Smrg 609ae02b298Smrg <!-- 610ae02b298Smrg Accept deprecated 'mono' alias, replacing it with 'monospace' 611ae02b298Smrg --> 612ae02b298Smrg <match target="pattern"> 613ae02b298Smrg <test qual="any" name="family"> 614ae02b298Smrg <string>mono</string> 615ae02b298Smrg </test> 616ae02b298Smrg <edit name="family" mode="assign"> 617ae02b298Smrg <string>monospace</string> 618ae02b298Smrg </edit> 619ae02b298Smrg </match> 6202c393a42Smrg 621ae02b298Smrg <!-- 622ae02b298Smrg Names not including any well known alias are given 'sans-serif' 623ae02b298Smrg --> 624ae02b298Smrg <match target="pattern"> 625ae02b298Smrg <test qual="all" name="family" compare="not_eq"> 626ae02b298Smrg <string>sans-serif</string> 627ae02b298Smrg </test> 628ae02b298Smrg <test qual="all" name="family" compare="not_eq"> 629ae02b298Smrg <string>serif</string> 630ae02b298Smrg </test> 631ae02b298Smrg <test qual="all" name="family" compare="not_eq"> 632ae02b298Smrg <string>monospace</string> 633ae02b298Smrg </test> 634ae02b298Smrg <edit name="family" mode="append_last"> 635ae02b298Smrg <string>sans-serif</string> 636ae02b298Smrg </edit> 637ae02b298Smrg </match> 6382c393a42Smrg 639ae02b298Smrg <!-- 640ae02b298Smrg Load per-user customization file, but don't complain 641ae02b298Smrg if it doesn't exist 642ae02b298Smrg --> 643ae02b298Smrg <include ignore_missing="yes" prefix="xdg"> 644ae02b298Smrg fontconfig/fonts.conf 645ae02b298Smrg </include> 6462c393a42Smrg 647ae02b298Smrg <!-- 648ae02b298Smrg Load local customization files, but don't complain 649ae02b298Smrg if there aren't any 650ae02b298Smrg --> 651ae02b298Smrg <include ignore_missing="yes">conf.d</include> 652ae02b298Smrg <include ignore_missing="yes">local.conf</include> 6532c393a42Smrg 654ae02b298Smrg <!-- 655ae02b298Smrg Alias well known font names to available TrueType fonts. 656ae02b298Smrg These substitute TrueType faces for similar Type1 657ae02b298Smrg faces to improve screen appearance. 658ae02b298Smrg --> 659ae02b298Smrg <alias> 660ae02b298Smrg <family>Times</family> 661ae02b298Smrg <prefer> 662ae02b298Smrg <family>Times New Roman</family> 663ae02b298Smrg </prefer> 664ae02b298Smrg <default> 665ae02b298Smrg <family>serif</family> 666ae02b298Smrg </default> 667ae02b298Smrg </alias> 668ae02b298Smrg <alias> 669ae02b298Smrg <family>Helvetica</family> 670ae02b298Smrg <prefer> 671ae02b298Smrg <family>Arial</family> 672ae02b298Smrg </prefer> 673ae02b298Smrg <default> 674ae02b298Smrg <family>sans</family> 675ae02b298Smrg </default> 676ae02b298Smrg </alias> 677ae02b298Smrg <alias> 678ae02b298Smrg <family>Courier</family> 679ae02b298Smrg <prefer> 680ae02b298Smrg <family>Courier New</family> 681ae02b298Smrg </prefer> 682ae02b298Smrg <default> 683ae02b298Smrg <family>monospace</family> 684ae02b298Smrg </default> 685ae02b298Smrg </alias> 6862c393a42Smrg 687ae02b298Smrg <!-- 688ae02b298Smrg Provide required aliases for standard names 689ae02b298Smrg Do these after the users configuration file so that 690ae02b298Smrg any aliases there are used preferentially 691ae02b298Smrg --> 692ae02b298Smrg <alias> 693ae02b298Smrg <family>serif</family> 694ae02b298Smrg <prefer> 695ae02b298Smrg <family>Times New Roman</family> 696ae02b298Smrg </prefer> 697ae02b298Smrg </alias> 698ae02b298Smrg <alias> 699ae02b298Smrg <family>sans</family> 700ae02b298Smrg <prefer> 701ae02b298Smrg <family>Arial</family> 702ae02b298Smrg </prefer> 703ae02b298Smrg </alias> 704ae02b298Smrg <alias> 705ae02b298Smrg <family>monospace</family> 706ae02b298Smrg <prefer> 707ae02b298Smrg <family>Andale Mono</family> 708ae02b298Smrg </prefer> 709ae02b298Smrg </alias> 710ca08ab68Smrg 711ae02b298Smrg <-- 712ae02b298Smrg The example of the requirements of OR operator; 713ae02b298Smrg If the 'family' contains 'Courier New' OR 'Courier' 714ae02b298Smrg add 'monospace' as the alternative 715ae02b298Smrg --> 716ae02b298Smrg <match target="pattern"> 717ae02b298Smrg <test name="family" compare="eq"> 718ae02b298Smrg <string>Courier New</string> 719ae02b298Smrg </test> 720ae02b298Smrg <edit name="family" mode="prepend"> 721ae02b298Smrg <string>monospace</string> 722ae02b298Smrg </edit> 723ae02b298Smrg </match> 724ae02b298Smrg <match target="pattern"> 725ae02b298Smrg <test name="family" compare="eq"> 726ae02b298Smrg <string>Courier</string> 727ae02b298Smrg </test> 728ae02b298Smrg <edit name="family" mode="prepend"> 729ae02b298Smrg <string>monospace</string> 730ae02b298Smrg </edit> 731ae02b298Smrg </match> 732ca08ab68Smrg 7332c393a42Smrg</fontconfig> 7342c393a42Smrg </programlisting> 7352c393a42Smrg </refsect2> 7362c393a42Smrg <refsect2><title>User configuration file</title> 7372c393a42Smrg <para> 7382c393a42SmrgThis is an example of a per-user configuration file that lives in 739ca08ab68Smrg$XDG_CONFIG_HOME/fontconfig/fonts.conf 7402c393a42Smrg </para> 7412c393a42Smrg <programlisting> 7422c393a42Smrg<?xml version="1.0"?> 743a4e54154Smrg<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> 7442c393a42Smrg<!-- 745ae02b298Smrg $XDG_CONFIG_HOME/fontconfig/fonts.conf for per-user font configuration 7462c393a42Smrg--> 747ae02b298Smrg<fontconfig> 7482c393a42Smrg 749ae02b298Smrg <!-- 750ae02b298Smrg Private font directory 751ae02b298Smrg --> 752ae02b298Smrg <dir prefix="xdg">fonts</dir> 753ae02b298Smrg 754ae02b298Smrg <!-- 755ae02b298Smrg use rgb sub-pixel ordering to improve glyph appearance on 756ae02b298Smrg LCD screens. Changes affecting rendering, but not matching 757ae02b298Smrg should always use target="font". 758ae02b298Smrg --> 759ae02b298Smrg <match target="font"> 760ae02b298Smrg <edit name="rgba" mode="assign"> 761ae02b298Smrg <const>rgb</const> 762ae02b298Smrg </edit> 763ae02b298Smrg </match> 764ae02b298Smrg <!-- 765ae02b298Smrg use WenQuanYi Zen Hei font when serif is requested for Chinese 766ae02b298Smrg --> 767ae02b298Smrg <match> 768ae02b298Smrg <!-- 769ae02b298Smrg If you don't want to use WenQuanYi Zen Hei font for zh-tw etc, 770ae02b298Smrg you can use zh-cn instead of zh. 771ae02b298Smrg Please note, even if you set zh-cn, it still matches zh. 772ae02b298Smrg if you don't like it, you can use compare="eq" 773ae02b298Smrg instead of compare="contains". 774ae02b298Smrg --> 775ae02b298Smrg <test name="lang" compare="contains"> 776ae02b298Smrg <string>zh</string> 777ae02b298Smrg </test> 778ae02b298Smrg <test name="family"> 779ae02b298Smrg <string>serif</string> 780ae02b298Smrg </test> 781ae02b298Smrg <edit name="family" mode="prepend"> 782ae02b298Smrg <string>WenQuanYi Zen Hei</string> 783ae02b298Smrg </edit> 784ae02b298Smrg </match> 785ae02b298Smrg <!-- 786ae02b298Smrg use VL Gothic font when sans-serif is requested for Japanese 787ae02b298Smrg --> 788ae02b298Smrg <match> 789ae02b298Smrg <test name="lang" compare="contains"> 790ae02b298Smrg <string>ja</string> 791ae02b298Smrg </test> 792ae02b298Smrg <test name="family"> 793ae02b298Smrg <string>sans-serif</string> 794ae02b298Smrg </test> 795ae02b298Smrg <edit name="family" mode="prepend"> 796ae02b298Smrg <string>VL Gothic</string> 797ae02b298Smrg </edit> 798ae02b298Smrg </match> 7992c393a42Smrg</fontconfig> 8002c393a42Smrg </programlisting> 8012c393a42Smrg </refsect2> 8022c393a42Smrg</refsect1> 8032c393a42Smrg<refsect1><title>Files</title> 8042c393a42Smrg <para> 8052c393a42Smrg<emphasis>fonts.conf</emphasis> 8062c393a42Smrgcontains configuration information for the fontconfig library 8072c393a42Smrgconsisting of directories to look at for font information as well as 8082c393a42Smrginstructions on editing program specified font patterns before attempting to 809ca08ab68Smrgmatch the available fonts. It is in XML format. 8102c393a42Smrg </para> 8112c393a42Smrg <para> 8122c393a42Smrg<emphasis>conf.d</emphasis> 8132c393a42Smrgis the conventional name for a directory of additional configuration files 8142c393a42Smrgmanaged by external applications or the local administrator. The 8152c393a42Smrgfilenames starting with decimal digits are sorted in lexicographic order 816ca08ab68Smrgand used as additional configuration files. All of these files are in XML 817ae02b298Smrgformat. The master fonts.conf file references this directory in an 8182c393a42Smrg<include> directive. 8192c393a42Smrg </para> 8202c393a42Smrg <para> 8212c393a42Smrg<emphasis>fonts.dtd</emphasis> 8222c393a42Smrgis a DTD that describes the format of the configuration files. 8232c393a42Smrg </para> 8242c393a42Smrg <para> 825ca08ab68Smrg<emphasis>$XDG_CONFIG_HOME/fontconfig/conf.d</emphasis> and <emphasis>~/.fonts.conf.d</emphasis> 826a6844aabSmrgis the conventional name for a per-user directory of (typically 827a6844aabSmrgauto-generated) configuration files, although the 828ca08ab68Smrgactual location is specified in the global fonts.conf file. please note that ~/.fonts.conf.d is deprecated now. it will not be read by default in the future version. 829a6844aabSmrg </para> 830a6844aabSmrg <para> 831ca08ab68Smrg<emphasis>$XDG_CONFIG_HOME/fontconfig/fonts.conf</emphasis> and <emphasis>~/.fonts.conf</emphasis> 8322c393a42Smrgis the conventional location for per-user font configuration, although the 833ca08ab68Smrgactual location is specified in the global fonts.conf file. please note that ~/.fonts.conf is deprecated now. it will not be read by default in the future version. 8342c393a42Smrg </para> 8352c393a42Smrg <para> 836ca08ab68Smrg<emphasis>$XDG_CACHE_HOME/fontconfig/*.cache-*</emphasis> and <emphasis> ~/.fontconfig/*.cache-*</emphasis> 8372c393a42Smrgis the conventional repository of font information that isn't found in the 838ca08ab68Smrgper-directory caches. This file is automatically maintained by fontconfig. please note that ~/.fontconfig/*.cache-* is deprecated now. it will not be read by default in the future version. 839ca08ab68Smrg </para> 840ca08ab68Smrg</refsect1> 841ca08ab68Smrg<refsect1><title>Environment variables</title> 842ca08ab68Smrg <para> 843ca08ab68Smrg<emphasis>FONTCONFIG_FILE</emphasis> 844ca08ab68Smrgis used to override the default configuration file. 845ca08ab68Smrg </para> 846ca08ab68Smrg <para> 847ca08ab68Smrg<emphasis>FONTCONFIG_PATH</emphasis> 848ca08ab68Smrgis used to override the default configuration directory. 849ca08ab68Smrg </para> 850ca08ab68Smrg <para> 851a32e9e42Smrg<emphasis>FONTCONFIG_SYSROOT</emphasis> 852a32e9e42Smrgis used to set a default sysroot directory. 853a32e9e42Smrg </para> 854a32e9e42Smrg <para> 855ca08ab68Smrg<emphasis>FC_DEBUG</emphasis> 856ca08ab68Smrgis used to output the detailed debugging messages. see <link linkend="debug">Debugging Applications</link> section for more details. 857ca08ab68Smrg </para> 858ca08ab68Smrg <para> 859953daebaSmrg<emphasis>FC_DBG_MATCH_FILTER</emphasis> 860953daebaSmrgis used to filter out the patterns. this takes a comma-separated list of object names and effects only when FC_DEBUG has MATCH2. see <link linkend="debug">Debugging Applications</link> section for more details. 861953daebaSmrg </para> 862953daebaSmrg <para> 863953daebaSmrg<emphasis>FC_LANG</emphasis> 864953daebaSmrgis used to specify the default language as the weak binding in the query. if this isn't set, the default language will be determined from current locale. 865953daebaSmrg </para> 866953daebaSmrg <para> 867ca08ab68Smrg<emphasis>FONTCONFIG_USE_MMAP</emphasis> 868ca08ab68Smrgis used to control the use of mmap(2) for the cache files if available. this take a boolean value. fontconfig will checks if the cache files are stored on the filesystem that is safe to use mmap(2). explicitly setting this environment variable will causes skipping this check and enforce to use or not use mmap(2) anyway. 8692c393a42Smrg </para> 870a32e9e42Smrg <para> 871a32e9e42Smrg<emphasis>SOURCE_DATE_EPOCH</emphasis> 872a32e9e42Smrgis used to ensure <literal>fc-cache(1)</literal> generates files in a deterministic manner in order to support reproducible builds. When set to a numeric representation of UNIX timestamp, fontconfig will prefer this value over using the modification timestamps of the input files in order to identify which cache files require regeneration. If <literal>SOURCE_DATE_EPOCH</literal> is not set (or is newer than the mtime of the directory), the existing behaviour is unchanged. 873a32e9e42Smrg </para> 8742c393a42Smrg</refsect1> 8752c393a42Smrg<refsect1><title>See Also</title> 8762c393a42Smrg <para> 877a32e9e42Smrgfc-cat(1), fc-cache(1), fc-list(1), fc-match(1), fc-query(1), <ulink url="https://reproducible-builds.org/specs/source-date-epoch/">SOURCE_DATE_EPOCH</ulink>. 8782c393a42Smrg </para> 8792c393a42Smrg</refsect1> 8802c393a42Smrg<refsect1><title>Version</title> 881ae02b298Smrg <para> 8822c393a42SmrgFontconfig version &version; 883ae02b298Smrg </para> 8842c393a42Smrg</refsect1> 8852c393a42Smrg</refentry> 886