fontconfig-user.sgml revision a4e54154
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
72c393a42Smrg   
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.
172c393a42Smrg   
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>
322c393a42Smrg	<refname>fonts.conf</refname>
332c393a42Smrg	<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
662c393a42Smrglist 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>
942c393a42Smrg  Property        Type    Description
952c393a42Smrg  --------------------------------------------------------------
962c393a42Smrg  family          String  Font family names
972c393a42Smrg  familylang      String  Languages corresponding to each family
982c393a42Smrg  style           String  Font style. Overrides weight and slant
992c393a42Smrg  stylelang       String  Languages corresponding to each style
1002c393a42Smrg  fullname        String  Font full names (often includes style)
1012c393a42Smrg  fullnamelang    String  Languages corresponding to each fullname
1022c393a42Smrg  slant           Int     Italic, oblique or roman
1032c393a42Smrg  weight          Int     Light, medium, demibold, bold or black
1042c393a42Smrg  size            Double  Point size
1052c393a42Smrg  width           Int     Condensed, normal or expanded
1062c393a42Smrg  aspect          Double  Stretches glyphs horizontally before hinting
1072c393a42Smrg  pixelsize       Double  Pixel size
1082c393a42Smrg  spacing         Int     Proportional, dual-width, monospace or charcell
1092c393a42Smrg  foundry         String  Font foundry name
1102c393a42Smrg  antialias       Bool    Whether glyphs can be antialiased
1112c393a42Smrg  hinting         Bool    Whether the rasterizer should use hinting
1122c393a42Smrg  hintstyle       Int     Automatic hinting style
1132c393a42Smrg  verticallayout  Bool    Use vertical layout
1142c393a42Smrg  autohint        Bool    Use autohinter instead of normal hinter
115ca08ab68Smrg  globaladvance   Bool    Use font global advance data (deprecated)
1162c393a42Smrg  file            String  The filename holding the font
1172c393a42Smrg  index           Int     The index of the font within the file
1182c393a42Smrg  ftface          FT_Face Use the specified FreeType face object
1196fc018e4Smrg  rasterizer      String  Which rasterizer is in use (deprecated)
1202c393a42Smrg  outline         Bool    Whether the glyphs are outlines
1212c393a42Smrg  scalable        Bool    Whether glyphs can be scaled
122953daebaSmrg  color           Bool    Whether any glyphs have color
123953daebaSmrg  scale           Double  Scale factor for point->pixel conversions (deprecated)
1242c393a42Smrg  dpi             Double  Target dots per inch
1252c393a42Smrg  rgba            Int     unknown, rgb, bgr, vrgb, vbgr,
1262c393a42Smrg                          none - subpixel geometry
1272c393a42Smrg  lcdfilter       Int     Type of LCD filter
1282c393a42Smrg  minspace        Bool    Eliminate leading from line spacing
1292c393a42Smrg  charset         CharSet Unicode chars encoded by the font
1302c393a42Smrg  lang            String  List of RFC-3066-style languages this
1312c393a42Smrg                          font supports
1322c393a42Smrg  fontversion     Int     Version number of the font
1332c393a42Smrg  capability      String  List of layout capabilities in the font
134953daebaSmrg  fontformat      String  String name of the font format
1352c393a42Smrg  embolden        Bool    Rasterizer should synthetically embolden the font
136953daebaSmrg  embeddedbitmap  Bool    Use the embedded bitmap instead of the outline
137953daebaSmrg  decorative      Bool    Whether the style is a decorative variant
138c9710b42Smrg  fontfeatures    String  List of the feature tags in OpenType to be enabled
139953daebaSmrg  namelang        String  Language name to be used for the default value of
140953daebaSmrg                          familylang, stylelang, and fullnamelang
141c9710b42Smrg  prgname         String  String  Name of the running program
142953daebaSmrg  postscriptname  String  Font family name in PostScript
143a4e54154Smrg  fonthashint     Bool    Whether the font has hinting
144a4e54154Smrg  order           Int     Order number of the font
1452c393a42Smrg    </programlisting>
1462c393a42Smrg  </refsect2>
1472c393a42Smrg  <refsect2>
1482c393a42Smrg  <title>Font Matching</title>
1492c393a42Smrg    <para>
1502c393a42SmrgFontconfig performs matching by measuring the distance from a provided
1512c393a42Smrgpattern to all of the available fonts in the system.  The closest matching
1522c393a42Smrgfont is selected.  This ensures that a font will always be returned, but
1532c393a42Smrgdoesn't ensure that it is anything like the requested pattern.
1542c393a42Smrg    </para><para> 
1552c393a42SmrgFont matching starts with an application constructed pattern.  The desired
1562c393a42Smrgattributes of the resulting font are collected together in a pattern.  Each
1572c393a42Smrgproperty of the pattern can contain one or more values; these are listed in
1582c393a42Smrgpriority order; matches earlier in the list are considered "closer" than
1592c393a42Smrgmatches later in the list.
1602c393a42Smrg    </para><para>
1612c393a42SmrgThe initial pattern is modified by applying the list of editing instructions
1622c393a42Smrgspecific to patterns found in the configuration; each consists of a match
1632c393a42Smrgpredicate and a set of editing operations.  They are executed in the order
1642c393a42Smrgthey appeared in the configuration.  Each match causes the associated
1652c393a42Smrgsequence of editing operations to be applied.
1662c393a42Smrg    </para><para>
1672c393a42SmrgAfter the pattern has been edited, a sequence of default substitutions are
1682c393a42Smrgperformed to canonicalize the set of available properties; this avoids the
1692c393a42Smrgneed for the lower layers to constantly provide default values for various
1702c393a42Smrgfont properties during rendering.
1712c393a42Smrg    </para><para>
1722c393a42SmrgThe canonical font pattern is finally matched against all available fonts.
1732c393a42SmrgThe distance from the pattern to the font is measured for each of several
1742c393a42Smrgproperties: foundry, charset, family, lang, spacing, pixelsize, style,
1752c393a42Smrgslant, weight, antialias, rasterizer and outline.  This list is in priority
1762c393a42Smrgorder -- results of comparing earlier elements of this list weigh more
1772c393a42Smrgheavily than later elements.
1782c393a42Smrg    </para><para>
1792c393a42SmrgThere is one special case to this rule; family names are split into two
1802c393a42Smrgbindings; strong and weak.  Strong family names are given greater precedence
1812c393a42Smrgin the match than lang elements while weak family names are given lower
1822c393a42Smrgprecedence than lang elements.  This permits the document language to drive
1832c393a42Smrgfont selection when any document specified font is unavailable.
1842c393a42Smrg    </para><para>
1852c393a42SmrgThe pattern representing that font is augmented to include any properties
1862c393a42Smrgfound in the pattern but not found in the font itself; this permits the
1872c393a42Smrgapplication to pass rendering instructions or any other data through the
1882c393a42Smrgmatching system.  Finally, the list of editing instructions specific to
1892c393a42Smrgfonts found in the configuration are applied to the pattern.  This modified
1902c393a42Smrgpattern is returned to the application.
1912c393a42Smrg    </para><para>
1922c393a42SmrgThe return value contains sufficient information to locate and rasterize the
1932c393a42Smrgfont, including the file name, pixel size and other rendering data.  As
1942c393a42Smrgnone of the information involved pertains to the FreeType library,
1952c393a42Smrgapplications are free to use any rasterization engine or even to take
1962c393a42Smrgthe identified font file and access it directly.
1972c393a42Smrg    </para><para>
1982c393a42SmrgThe match/edit sequences in the configuration are performed in two passes
1992c393a42Smrgbecause there are essentially two different operations necessary -- the
2002c393a42Smrgfirst is to modify how fonts are selected; aliasing families and adding
2012c393a42Smrgsuitable defaults.  The second is to modify how the selected fonts are
2022c393a42Smrgrasterized.  Those must apply to the selected font, not the original pattern
2032c393a42Smrgas false matches will often occur.
2042c393a42Smrg    </para>
2052c393a42Smrg  </refsect2>
2062c393a42Smrg  <refsect2><title>Font Names</title>
2072c393a42Smrg    <para>
2082c393a42SmrgFontconfig provides a textual representation for patterns that the library
2092c393a42Smrgcan both accept and generate.  The representation is in three parts, first a
2102c393a42Smrglist of family names, second a list of point sizes and finally a list of
2112c393a42Smrgadditional properties:
2122c393a42Smrg    </para>
2132c393a42Smrg    <programlisting>
2142c393a42Smrg	&lt;families&gt;-&lt;point sizes&gt;:&lt;name1&gt;=&lt;values1&gt;:&lt;name2&gt;=&lt;values2&gt;...
2152c393a42Smrg    </programlisting>
2162c393a42Smrg    <para>
2172c393a42SmrgValues in a list are separated with commas.  The name needn't include either
2182c393a42Smrgfamilies or point sizes; they can be elided.  In addition, there are
2192c393a42Smrgsymbolic constants that simultaneously indicate both a name and a value.
2202c393a42SmrgHere are some examples:
2212c393a42Smrg    </para>
2222c393a42Smrg    <programlisting>
2232c393a42Smrg  Name                            Meaning
2242c393a42Smrg  ----------------------------------------------------------
2252c393a42Smrg  Times-12                        12 point Times Roman
2262c393a42Smrg  Times-12:bold                   12 point Times Bold
2272c393a42Smrg  Courier:italic                  Courier Italic in the default size
2282c393a42Smrg  Monospace:matrix=1 .1 0 1       The users preferred monospace font
2292c393a42Smrg                                  with artificial obliquing
2302c393a42Smrg    </programlisting>
2312c393a42Smrg    <para>
232ca08ab68SmrgThe '\', '-', ':' and ',' characters in family names must be preceded by a
2332c393a42Smrg'\' character to avoid having them misinterpreted. Similarly, values
234ca08ab68Smrgcontaining '\', '=', '_', ':' and ',' must also have them preceded by a
2352c393a42Smrg'\' character. The '\' characters are stripped out of the family name and
2362c393a42Smrgvalues as the font name is read.
2372c393a42Smrg    </para>
2382c393a42Smrg  </refsect2>
2392c393a42Smrg</refsect1>
240ca08ab68Smrg<refsect1 id="debug"><title>Debugging Applications</title>
2412c393a42Smrg  <para>
2422c393a42SmrgTo help diagnose font and applications problems, fontconfig is built with a
2432c393a42Smrglarge amount of internal debugging left enabled. It is controlled by means
2442c393a42Smrgof the FC_DEBUG environment variable. The value of this variable is
2452c393a42Smrginterpreted as a number, and each bit within that value controls different
2462c393a42Smrgdebugging messages.
2472c393a42Smrg  </para>
2482c393a42Smrg  <programlisting>
2492c393a42Smrg  Name         Value    Meaning
2502c393a42Smrg  ---------------------------------------------------------
2512c393a42Smrg  MATCH            1    Brief information about font matching
2522c393a42Smrg  MATCHV           2    Extensive font matching information
2532c393a42Smrg  EDIT             4    Monitor match/test/edit execution
2542c393a42Smrg  FONTSET          8    Track loading of font information at startup
2552c393a42Smrg  CACHE           16    Watch cache files being written
2562c393a42Smrg  CACHEV          32    Extensive cache file writing information
2572c393a42Smrg  PARSE           64    (no longer in use)
2582c393a42Smrg  SCAN           128    Watch font files being scanned to build caches
2592c393a42Smrg  SCANV          256    Verbose font file scanning information
2602c393a42Smrg  MEMORY         512    Monitor fontconfig memory usage
2612c393a42Smrg  CONFIG        1024    Monitor which config files are loaded
2622c393a42Smrg  LANGSET       2048    Dump char sets used to construct lang values
263953daebaSmrg  MATCH2        4096    Display font-matching transformation in patterns
2642c393a42Smrg  </programlisting>
2652c393a42Smrg  <para>
2662c393a42SmrgAdd the value of the desired debug levels together and assign that (in
2672c393a42Smrgbase 10) to the FC_DEBUG environment variable before running the
2682c393a42Smrgapplication. Output from these statements is sent to stdout.
2692c393a42Smrg  </para>
2702c393a42Smrg</refsect1>
2712c393a42Smrg<refsect1><title>Lang Tags</title>
2722c393a42Smrg  <para>
2732c393a42SmrgEach font in the database contains a list of languages it supports.  This is
2742c393a42Smrgcomputed by comparing the Unicode coverage of the font with the orthography
2752c393a42Smrgof each language.  Languages are tagged using an RFC-3066 compatible naming
2762c393a42Smrgand occur in two parts -- the ISO 639 language tag followed a hyphen and then
2772c393a42Smrgby the ISO 3166 country code.  The hyphen and country code may be elided.
2782c393a42Smrg  </para><para>
2792c393a42SmrgFontconfig has orthographies for several languages built into the library.
2802c393a42SmrgNo provision has been made for adding new ones aside from rebuilding the
2812c393a42Smrglibrary.  It currently supports 122 of the 139 languages named in ISO 639-1,
2822c393a42Smrg141 of the languages with two-letter codes from ISO 639-2 and another 30
2832c393a42Smrglanguages with only three-letter codes.  Languages with both two and three
2842c393a42Smrgletter codes are provided with only the two letter code.
2852c393a42Smrg  </para><para>
2862c393a42SmrgFor languages used in multiple territories with radically different
2872c393a42Smrgcharacter sets, fontconfig includes per-territory orthographies.  This
2882c393a42Smrgincludes Azerbaijani, Kurdish, Pashto, Tigrinya and Chinese.
2892c393a42Smrg  </para>
2902c393a42Smrg</refsect1>
2912c393a42Smrg<refsect1><title>Configuration File Format</title>
2922c393a42Smrg  <para>
2932c393a42SmrgConfiguration files for fontconfig are stored in XML format; this
2942c393a42Smrgformat makes external configuration tools easier to write and ensures that
2952c393a42Smrgthey will generate syntactically correct configuration files.  As XML
2962c393a42Smrgfiles are plain text, they can also be manipulated by the expert user using
2972c393a42Smrga text editor.
2982c393a42Smrg  </para><para>
2992c393a42SmrgThe fontconfig document type definition resides in the external entity
3002c393a42Smrg"fonts.dtd"; this is normally stored in the default font configuration
3012c393a42Smrgdirectory (&confdir;).  Each configuration file should contain the
3022c393a42Smrgfollowing structure:
3032c393a42Smrg    <programlisting>
3042c393a42Smrg	&lt;?xml version="1.0"?&gt;
305a4e54154Smrg	&lt;!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"&gt;
3062c393a42Smrg	&lt;fontconfig&gt;
3072c393a42Smrg	...
3082c393a42Smrg	&lt;/fontconfig&gt;
3092c393a42Smrg    </programlisting>
3102c393a42Smrg  </para>
3112c393a42Smrg<refsect2><title><literal>&lt;fontconfig&gt;</literal></title><para>
3122c393a42SmrgThis is the top level element for a font configuration and can contain
313ca08ab68Smrg<literal>&lt;dir&gt;</literal>, <literal>&lt;cachedir&gt;</literal>, <literal>&lt;include&gt;</literal>, <literal>&lt;match&gt;</literal> and <literal>&lt;alias&gt;</literal> elements in any order.
3142c393a42Smrg  </para></refsect2>
315a4e54154Smrg  <refsect2><title><literal>&lt;dir prefix="default" salt=""&gt;</literal></title><para>
3162c393a42SmrgThis element contains a directory name which will be scanned for font files
317a4e54154Smrgto include in the set of available fonts.
318a4e54154Smrg  </para><para>
319a4e54154SmrgIf '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.
320a4e54154Smrg  </para><para>
321a4e54154Smrg'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.
3222c393a42Smrg  </para></refsect2>
323ca08ab68Smrg  <refsect2><title><literal>&lt;cachedir prefix="default"&gt;</literal></title><para>
324ca08ab68SmrgThis element contains a directory name that is supposed to be stored or read
325ca08ab68Smrgthe cache of font information.  If multiple elements are specified in
326ca08ab68Smrgthe configuration file, the directory that can be accessed first in the list
327ca08ab68Smrgwill be used to store the cache files.  If it starts with '~', it refers to
328ca08ab68Smrga 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.
329ca08ab68SmrgThe default directory is ``$XDG_CACHE_HOME/fontconfig'' and it contains the cache files
330953daebaSmrgnamed ``<literal>&lt;hash value&gt;</literal>-<literal>&lt;architecture&gt;</literal>.cache-<literal>&lt;version&gt;</literal>'',
331953daebaSmrgwhere <literal>&lt;version&gt;</literal> is the fontconfig cache file
332953daebaSmrgversion number (currently 7).
3332c393a42Smrg  </para></refsect2>
334ca08ab68Smrg  <refsect2><title><literal>&lt;include ignore_missing="no" prefix="default"&gt;</literal></title><para>
3352c393a42SmrgThis element contains the name of an additional configuration file or
3362c393a42Smrgdirectory.  If a directory, every file within that directory starting with an
3372c393a42SmrgASCII digit (U+0030 - U+0039) and ending with the string ``.conf'' will be processed in sorted order.  When
3382c393a42Smrgthe XML datatype is traversed by FcConfigParse, the contents of the file(s)
3392c393a42Smrgwill also be incorporated into the configuration by passing the filename(s) to
3402c393a42SmrgFcConfigLoadAndParse.  If 'ignore_missing' is set to "yes" instead of the
3412c393a42Smrgdefault "no", a missing file or directory will elicit no warning message from
342ca08ab68Smrgthe 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.
3432c393a42Smrg  </para></refsect2>
3442c393a42Smrg  <refsect2><title><literal>&lt;config&gt;</literal></title><para>
3452c393a42SmrgThis element provides a place to consolidate additional configuration
3462c393a42Smrginformation.  <literal>&lt;config&gt;</literal> can contain <literal>&lt;blank&gt;</literal> and <literal>&lt;rescan&gt;</literal> elements in any
3472c393a42Smrgorder.
348a4e54154Smrg  </para></refsect2>
349a4e54154Smrg  <refsect2><title><literal>&lt;description domain="fontconfig-conf"&gt;</literal></title><para>
350a4e54154SmrgThis element is supposed to hold strings which describe what a config is used for.
351a4e54154SmrgThis string can be translated through gettext. 'domain' needs to be set the proper name to apply then.
352a4e54154Smrgfontconfig will tries to retrieve translations with 'domain' from gettext.
3532c393a42Smrg  </para></refsect2>
3542c393a42Smrg  <refsect2><title><literal>&lt;blank&gt;</literal></title><para>
3552c393a42SmrgFonts often include "broken" glyphs which appear in the encoding but are
3562c393a42Smrgdrawn as blanks on the screen.  Within the <literal>&lt;blank&gt;</literal> element, place each
3572c393a42SmrgUnicode characters which is supposed to be blank in an <literal>&lt;int&gt;</literal> element.
3582c393a42SmrgCharacters outside of this set which are drawn as blank will be elided from
3592c393a42Smrgthe set of characters supported by the font.
360a4e54154Smrg  </para></refsect2>
361a4e54154Smrg  <refsect2><title><literal>&lt;remap-dir prefix="default" as-path="" salt=""&gt;</literal></title><para>
362a4e54154SmrgThis element contains a directory name where will be mapped
363a4e54154Smrgas the path 'as-path' in cached information.
364a4e54154SmrgThis is useful if the directory name is an alias
365a4e54154Smrg(via a bind mount or symlink) to another directory in the system for
366a4e54154Smrgwhich cached font information is likely to exist.
367a4e54154Smrg  </para><para>
368a4e54154Smrg'salt' property affects to determine cache filename as same as <literal>&lt;dir&gt;</literal> element.
369a4e54154Smrg  </para></refsect2>
370a4e54154Smrg  <refsect2><title><literal>&lt;reset-dirs /&gt;</literal></title><para>
371a4e54154SmrgThis element removes all of fonts directories where added by <literal>&lt;dir&gt;</literal> elements.
372a4e54154SmrgThis is useful to override fonts directories from system to own fonts directories only.
3732c393a42Smrg  </para></refsect2>
3742c393a42Smrg  <refsect2><title><literal>&lt;rescan&gt;</literal></title><para>
3752c393a42SmrgThe <literal>&lt;rescan&gt;</literal> element holds an <literal>&lt;int&gt;</literal> element which indicates the default
3762c393a42Smrginterval between automatic checks for font configuration changes.
3772c393a42SmrgFontconfig will validate all of the configuration files and directories and
3782c393a42Smrgautomatically rebuild the internal datastructures when this interval passes.
3792c393a42Smrg  </para></refsect2>
3802c393a42Smrg  <refsect2><title><literal>&lt;selectfont&gt;</literal></title><para>
3812c393a42SmrgThis element is used to black/white list fonts from being listed or matched
3822c393a42Smrgagainst.  It holds acceptfont and rejectfont elements.
3832c393a42Smrg  </para></refsect2>
3842c393a42Smrg  <refsect2><title><literal>&lt;acceptfont&gt;</literal></title><para>
3852c393a42SmrgFonts matched by an acceptfont element are "whitelisted"; such fonts are
3862c393a42Smrgexplicitly included in the set of fonts used to resolve list and match
3872c393a42Smrgrequests; including them in this list protects them from being "blacklisted"
3882c393a42Smrgby a rejectfont element.  Acceptfont elements include glob and pattern
3892c393a42Smrgelements which are used to match fonts.
3902c393a42Smrg  </para></refsect2>
3912c393a42Smrg  <refsect2><title><literal>&lt;rejectfont&gt;</literal></title><para>
3922c393a42SmrgFonts matched by an rejectfont element are "blacklisted"; such fonts are
3932c393a42Smrgexcluded from the set of fonts used to resolve list and match requests as if
3942c393a42Smrgthey didn't exist in the system.  Rejectfont elements include glob and
3952c393a42Smrgpattern elements which are used to match fonts.
3962c393a42Smrg  </para></refsect2>
3972c393a42Smrg  <refsect2><title><literal>&lt;glob&gt;</literal></title><para>
3982c393a42SmrgGlob elements hold shell-style filename matching patterns (including ? and
3992c393a42Smrg*) which match fonts based on their complete pathnames.  This can be used to
4002c393a42Smrgexclude a set of directories (/usr/share/fonts/uglyfont*), or particular
4012c393a42Smrgfont file types (*.pcf.gz), but the latter mechanism relies rather heavily
4022c393a42Smrgon filenaming conventions which can't be relied upon.  Note that globs
4032c393a42Smrgonly apply to directories, not to individual fonts.
4042c393a42Smrg  </para></refsect2>
4052c393a42Smrg  <refsect2><title><literal>&lt;pattern&gt;</literal></title><para>
4062c393a42SmrgPattern elements perform list-style matching on incoming fonts; that is,
4072c393a42Smrgthey hold a list of elements and associated values.  If all of those
4082c393a42Smrgelements have a matching value, then the pattern matches the font.  This can
4092c393a42Smrgbe used to select fonts based on attributes of the font (scalable, bold,
4102c393a42Smrgetc), which is a more reliable mechanism than using file extensions.
4112c393a42SmrgPattern elements include patelt elements.
4122c393a42Smrg  </para></refsect2>
4132c393a42Smrg  <refsect2><title><literal>&lt;patelt name="property"&gt;</literal></title><para>
4142c393a42SmrgPatelt elements hold a single pattern element and list of values.  They must
4152c393a42Smrghave a 'name' attribute which indicates the pattern element name.  Patelt
4162c393a42Smrgelements include int, double, string, matrix, bool, charset and const
4172c393a42Smrgelements.
4182c393a42Smrg  </para></refsect2>
4192c393a42Smrg  <refsect2><title><literal>&lt;match target="pattern"&gt;</literal></title><para>
4202c393a42SmrgThis element holds first a (possibly empty) list of <literal>&lt;test&gt;</literal> elements and then
4212c393a42Smrga (possibly empty) list of <literal>&lt;edit&gt;</literal> elements.  Patterns which match all of the
4222c393a42Smrgtests are subjected to all the edits.  If 'target' is set to "font" instead
4232c393a42Smrgof the default "pattern", then this element applies to the font name
4242c393a42Smrgresulting from a match rather than a font pattern to be matched. If 'target'
4252c393a42Smrgis set to "scan", then this element applies when the font is scanned to
4262c393a42Smrgbuild the fontconfig database.
4272c393a42Smrg  </para></refsect2>
4282c393a42Smrg  <refsect2><title><literal>&lt;test qual="any" name="property" target="default" compare="eq"&gt;</literal></title><para>
4292c393a42SmrgThis element contains a single value which is compared with the target
4302c393a42Smrg('pattern', 'font', 'scan' or 'default') property "property" (substitute any of the property names seen 
431ca08ab68Smrgabove). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", "more_eq", "contains" or
432ca08ab68Smrg"not_contains".  'qual' may either be the default, "any", in which case the match
4332c393a42Smrgsucceeds if any value associated with the property matches the test value, or
4342c393a42Smrg"all", in which case all of the values associated with the property must
435ca08ab68Smrgmatch 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".
436ca08ab68SmrgWhen used in a &lt;match target="font"&gt; element,
4372c393a42Smrgthe target= attribute in the &lt;test&gt; element selects between matching
4382c393a42Smrgthe original pattern or the font.  "default" selects whichever target the
4392c393a42Smrgouter &lt;match&gt; element has selected.
4402c393a42Smrg  </para></refsect2>
4412c393a42Smrg  <refsect2><title><literal>&lt;edit name="property" mode="assign" binding="weak"&gt;</literal></title><para>
4422c393a42SmrgThis element contains a list of expression elements (any of the value or
4432c393a42Smrgoperator elements).  The expression elements are evaluated at run-time and
4442c393a42Smrgmodify the property "property".  The modification depends on whether
4452c393a42Smrg"property" was matched by one of the associated <literal>&lt;test&gt;</literal> elements, if so, the
4462c393a42Smrgmodification may affect the first matched value.  Any values inserted into
4472c393a42Smrgthe property are given the indicated binding ("strong", "weak" or "same")
4482c393a42Smrgwith "same" binding using the value from the matched pattern element.
4492c393a42Smrg'mode' is one of:
4502c393a42Smrg    <programlisting>
4512c393a42Smrg  Mode                    With Match              Without Match
4522c393a42Smrg  ---------------------------------------------------------------------
4532c393a42Smrg  "assign"                Replace matching value  Replace all values
4542c393a42Smrg  "assign_replace"        Replace all values      Replace all values
4552c393a42Smrg  "prepend"               Insert before matching  Insert at head of list
4562c393a42Smrg  "prepend_first"         Insert at head of list  Insert at head of list
4572c393a42Smrg  "append"                Append after matching   Append at end of list
4582c393a42Smrg  "append_last"           Append at end of list   Append at end of list
459c9710b42Smrg  "delete"                Delete matching value   Delete all values
460c9710b42Smrg  "delete_all"            Delete all values       Delete all values
4612c393a42Smrg    </programlisting>
4622c393a42Smrg  </para></refsect2>
4632c393a42Smrg  <refsect2><title><literal>&lt;int&gt;</literal>, <literal>&lt;double&gt;</literal>, <literal>&lt;string&gt;</literal>, <literal>&lt;bool&gt;</literal></title><para>
4642c393a42SmrgThese elements hold a single value of the indicated type.  <literal>&lt;bool&gt;</literal>
4652c393a42Smrgelements hold either true or false.  An important limitation exists in
4662c393a42Smrgthe parsing of floating point numbers -- fontconfig requires that
4672c393a42Smrgthe mantissa start with a digit, not a decimal point, so insert a leading
4682c393a42Smrgzero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
4692c393a42Smrginstead of -.5).
4702c393a42Smrg  </para></refsect2>
4712c393a42Smrg  <refsect2><title><literal>&lt;matrix&gt;</literal></title><para>
472c9710b42SmrgThis element holds four numerical expressions of an affine transformation.
473c9710b42SmrgAt their simplest these will be four <literal>&lt;double&gt;</literal> elements
474c9710b42Smrgbut they can also be more involved expressions.
475ca08ab68Smrg  </para></refsect2>
476ca08ab68Smrg  <refsect2><title><literal>&lt;range&gt;</literal></title><para>
477ca08ab68SmrgThis element holds the two <literal>&lt;int&gt;</literal> elements of a range
478ca08ab68Smrgrepresentation.
479ca08ab68Smrg  </para></refsect2>
480ca08ab68Smrg  <refsect2><title><literal>&lt;charset&gt;</literal></title><para>
481ca08ab68SmrgThis element holds at least one <literal>&lt;int&gt;</literal> element of
482ca08ab68Smrgan Unicode code point or more.
483ca08ab68Smrg  </para></refsect2>
484ca08ab68Smrg  <refsect2><title><literal>&lt;langset&gt;</literal></title><para>
485ca08ab68SmrgThis element holds at least one <literal>&lt;string&gt;</literal> element of
486ca08ab68Smrga RFC-3066-style languages or more.
4872c393a42Smrg  </para></refsect2>
4882c393a42Smrg  <refsect2><title><literal>&lt;name&gt;</literal></title><para>
4892c393a42SmrgHolds a property name.  Evaluates to the first value from the property of
490c9710b42Smrgthe pattern.  If the 'target' attribute is not present, it will default to
491c9710b42Smrg'default', in which case the property is returned from the font pattern
492c9710b42Smrgduring a target="font" match, and to the pattern during a target="pattern"
493c9710b42Smrgmatch.  The attribute can also take the values 'font' or 'pattern' to
494c9710b42Smrgexplicitly choose which pattern to use.  It is an error to use a target
495c9710b42Smrgof 'font' in a match that has target="pattern".
4962c393a42Smrg  </para></refsect2>
4972c393a42Smrg  <refsect2><title><literal>&lt;const&gt;</literal></title><para>
4982c393a42SmrgHolds the name of a constant; these are always integers and serve as
4992c393a42Smrgsymbolic names for common font values:
5002c393a42Smrg    <programlisting>
5012c393a42Smrg  Constant        Property        Value
5022c393a42Smrg  -------------------------------------
5032c393a42Smrg  thin            weight          0
5042c393a42Smrg  extralight      weight          40
5052c393a42Smrg  ultralight      weight          40
5062c393a42Smrg  light           weight          50
507953daebaSmrg  demilight       weight          55
508953daebaSmrg  semilight       weight          55
5092c393a42Smrg  book            weight          75
5102c393a42Smrg  regular         weight          80
5112c393a42Smrg  normal          weight          80
5122c393a42Smrg  medium          weight          100
5132c393a42Smrg  demibold        weight          180
5142c393a42Smrg  semibold        weight          180
5152c393a42Smrg  bold            weight          200
5162c393a42Smrg  extrabold       weight          205
5172c393a42Smrg  black           weight          210
5182c393a42Smrg  heavy           weight          210
5192c393a42Smrg  roman           slant           0
5202c393a42Smrg  italic          slant           100
5212c393a42Smrg  oblique         slant           110
5222c393a42Smrg  ultracondensed  width           50
5232c393a42Smrg  extracondensed  width           63
5242c393a42Smrg  condensed       width           75
5252c393a42Smrg  semicondensed   width           87
5262c393a42Smrg  normal          width           100
5272c393a42Smrg  semiexpanded    width           113
5282c393a42Smrg  expanded        width           125
5292c393a42Smrg  extraexpanded   width           150
5302c393a42Smrg  ultraexpanded   width           200
5312c393a42Smrg  proportional    spacing         0
5322c393a42Smrg  dual            spacing         90
5332c393a42Smrg  mono            spacing         100
5342c393a42Smrg  charcell        spacing         110
5352c393a42Smrg  unknown         rgba            0
5362c393a42Smrg  rgb             rgba            1
5372c393a42Smrg  bgr             rgba            2
5382c393a42Smrg  vrgb            rgba            3
5392c393a42Smrg  vbgr            rgba            4
5402c393a42Smrg  none            rgba            5
5412c393a42Smrg  lcdnone         lcdfilter       0
5422c393a42Smrg  lcddefault      lcdfilter       1
5432c393a42Smrg  lcdlight        lcdfilter       2
5442c393a42Smrg  lcdlegacy       lcdfilter       3
5452c393a42Smrg  hintnone        hintstyle       0
5462c393a42Smrg  hintslight      hintstyle       1
5472c393a42Smrg  hintmedium      hintstyle       2
5482c393a42Smrg  hintfull        hintstyle       3
5492c393a42Smrg    </programlisting>
5502c393a42Smrg      </para>
5512c393a42Smrg    </refsect2>
5522c393a42Smrg  <refsect2>
5532c393a42Smrg      <title><literal>&lt;or&gt;</literal>, <literal>&lt;and&gt;</literal>, <literal>&lt;plus&gt;</literal>, <literal>&lt;minus&gt;</literal>, <literal>&lt;times&gt;</literal>, <literal>&lt;divide&gt;</literal></title>
5542c393a42Smrg      <para>
5552c393a42SmrgThese elements perform the specified operation on a list of expression
5562c393a42Smrgelements.  <literal>&lt;or&gt;</literal> and <literal>&lt;and&gt;</literal> are boolean, not bitwise.
5572c393a42Smrg      </para>
5582c393a42Smrg    </refsect2>
5592c393a42Smrg  <refsect2>
560ca08ab68Smrg    <title><literal>&lt;eq&gt;</literal>, <literal>&lt;not_eq&gt;</literal>, <literal>&lt;less&gt;</literal>, <literal>&lt;less_eq&gt;</literal>, <literal>&lt;more&gt;</literal>, <literal>&lt;more_eq&gt;</literal>, <literal>&lt;contains&gt;</literal>, <literal>&lt;not_contains</literal></title>
5612c393a42Smrg    <para>
5622c393a42SmrgThese elements compare two values, producing a boolean result.
5632c393a42Smrg  </para></refsect2>
5642c393a42Smrg  <refsect2><title><literal>&lt;not&gt;</literal></title><para>
5652c393a42SmrgInverts the boolean sense of its one expression element
5662c393a42Smrg  </para></refsect2>
5672c393a42Smrg  <refsect2><title><literal>&lt;if&gt;</literal></title><para>
5682c393a42SmrgThis element takes three expression elements; if the value of the first is
5692c393a42Smrgtrue, it produces the value of the second, otherwise it produces the value
5702c393a42Smrgof the third.
5712c393a42Smrg  </para></refsect2>
5722c393a42Smrg  <refsect2><title><literal>&lt;alias&gt;</literal></title><para>
5732c393a42SmrgAlias elements provide a shorthand notation for the set of common match
5742c393a42Smrgoperations needed to substitute one font family for another.  They contain a
5752c393a42Smrg<literal>&lt;family&gt;</literal> element followed by optional <literal>&lt;prefer&gt;</literal>, <literal>&lt;accept&gt;</literal> and <literal>&lt;default&gt;</literal>
5762c393a42Smrgelements.  Fonts matching the <literal>&lt;family&gt;</literal> element are edited to prepend the
5772c393a42Smrglist of <literal>&lt;prefer&gt;</literal>ed families before the matching <literal>&lt;family&gt;</literal>, append the
5782c393a42Smrg<literal>&lt;accept&gt;</literal>able families after the matching <literal>&lt;family&gt;</literal> and append the <literal>&lt;default&gt;</literal>
5792c393a42Smrgfamilies to the end of the family list.
5802c393a42Smrg  </para></refsect2>
5812c393a42Smrg  <refsect2><title><literal>&lt;family&gt;</literal></title><para>
5822c393a42SmrgHolds a single font family name
5832c393a42Smrg  </para></refsect2>
5842c393a42Smrg  <refsect2><title><literal>&lt;prefer&gt;</literal>, <literal>&lt;accept&gt;</literal>, <literal>&lt;default&gt;</literal></title><para>
5852c393a42SmrgThese hold a list of <literal>&lt;family&gt;</literal> elements to be used by the <literal>&lt;alias&gt;</literal> element.
5862c393a42Smrg  </para></refsect2>
5872c393a42Smrg</refsect1>
5882c393a42Smrg<refsect1><title>EXAMPLE CONFIGURATION FILE</title>
5892c393a42Smrg  <refsect2><title>System configuration file</title>
5902c393a42Smrg    <para>
5912c393a42SmrgThis is an example of a system-wide configuration file
5922c393a42Smrg    </para>
5932c393a42Smrg    <programlisting>
5942c393a42Smrg&lt;?xml version="1.0"?&gt;
595a4e54154Smrg&lt;!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"&gt;
5962c393a42Smrg&lt;!-- &confdir;/fonts.conf file to configure system font access --&gt;
5972c393a42Smrg&lt;fontconfig&gt;
5982c393a42Smrg&lt;!-- 
5992c393a42Smrg	Find fonts in these directories
6002c393a42Smrg--&gt;
6012c393a42Smrg&lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
6022c393a42Smrg&lt;dir&gt;/usr/X11R6/lib/X11/fonts&lt;/dir&gt;
6032c393a42Smrg
6042c393a42Smrg&lt;!--
6052c393a42Smrg	Accept deprecated 'mono' alias, replacing it with 'monospace'
6062c393a42Smrg--&gt;
6072c393a42Smrg&lt;match target="pattern"&gt;
6082c393a42Smrg	&lt;test qual="any" name="family"&gt;&lt;string&gt;mono&lt;/string&gt;&lt;/test&gt;
6092c393a42Smrg	&lt;edit name="family" mode="assign"&gt;&lt;string&gt;monospace&lt;/string&gt;&lt;/edit&gt;
6102c393a42Smrg&lt;/match&gt;
6112c393a42Smrg
6122c393a42Smrg&lt;!--
613ca08ab68Smrg	Names not including any well known alias are given 'sans-serif'
6142c393a42Smrg--&gt;
6152c393a42Smrg&lt;match target="pattern"&gt;
616a32e9e42Smrg	&lt;test qual="all" name="family" compare="not_eq"&gt;&lt;string&gt;sans-serif&lt;/string&gt;&lt;/test&gt;
617a32e9e42Smrg	&lt;test qual="all" name="family" compare="not_eq"&gt;&lt;string&gt;serif&lt;/string&gt;&lt;/test&gt;
618a32e9e42Smrg	&lt;test qual="all" name="family" compare="not_eq"&gt;&lt;string&gt;monospace&lt;/string&gt;&lt;/test&gt;
619ca08ab68Smrg	&lt;edit name="family" mode="append_last"&gt;&lt;string&gt;sans-serif&lt;/string&gt;&lt;/edit&gt;
6202c393a42Smrg&lt;/match&gt;
6212c393a42Smrg
6222c393a42Smrg&lt;!--
6232c393a42Smrg	Load per-user customization file, but don't complain
6242c393a42Smrg	if it doesn't exist
6252c393a42Smrg--&gt;
626ca08ab68Smrg&lt;include ignore_missing="yes" prefix="xdg"&gt;fontconfig/fonts.conf&lt;/include&gt;
6272c393a42Smrg
6282c393a42Smrg&lt;!--
6292c393a42Smrg	Load local customization files, but don't complain
6302c393a42Smrg	if there aren't any
6312c393a42Smrg--&gt;
6322c393a42Smrg&lt;include ignore_missing="yes"&gt;conf.d&lt;/include&gt;
6332c393a42Smrg&lt;include ignore_missing="yes"&gt;local.conf&lt;/include&gt;
6342c393a42Smrg
6352c393a42Smrg&lt;!--
6362c393a42Smrg	Alias well known font names to available TrueType fonts.
6372c393a42Smrg	These substitute TrueType faces for similar Type1
6382c393a42Smrg	faces to improve screen appearance.
6392c393a42Smrg--&gt;
6402c393a42Smrg&lt;alias&gt;
6412c393a42Smrg	&lt;family&gt;Times&lt;/family&gt;
6422c393a42Smrg	&lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
6432c393a42Smrg	&lt;default&gt;&lt;family&gt;serif&lt;/family&gt;&lt;/default&gt;
6442c393a42Smrg&lt;/alias&gt;
6452c393a42Smrg&lt;alias&gt;
6462c393a42Smrg	&lt;family&gt;Helvetica&lt;/family&gt;
6472c393a42Smrg	&lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
6482c393a42Smrg	&lt;default&gt;&lt;family&gt;sans&lt;/family&gt;&lt;/default&gt;
6492c393a42Smrg&lt;/alias&gt;
6502c393a42Smrg&lt;alias&gt;
6512c393a42Smrg	&lt;family&gt;Courier&lt;/family&gt;
6522c393a42Smrg	&lt;prefer&gt;&lt;family&gt;Courier New&lt;/family&gt;&lt;/prefer&gt;
6532c393a42Smrg	&lt;default&gt;&lt;family&gt;monospace&lt;/family&gt;&lt;/default&gt;
6542c393a42Smrg&lt;/alias&gt;
6552c393a42Smrg
6562c393a42Smrg&lt;!--
6572c393a42Smrg	Provide required aliases for standard names
6582c393a42Smrg	Do these after the users configuration file so that
6592c393a42Smrg	any aliases there are used preferentially
6602c393a42Smrg--&gt;
6612c393a42Smrg&lt;alias&gt;
6622c393a42Smrg	&lt;family&gt;serif&lt;/family&gt;
6632c393a42Smrg	&lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
6642c393a42Smrg&lt;/alias&gt;
6652c393a42Smrg&lt;alias&gt;
6662c393a42Smrg	&lt;family&gt;sans&lt;/family&gt;
6672c393a42Smrg	&lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
6682c393a42Smrg&lt;/alias&gt;
6692c393a42Smrg&lt;alias&gt;
6702c393a42Smrg	&lt;family&gt;monospace&lt;/family&gt;
6712c393a42Smrg	&lt;prefer&gt;&lt;family&gt;Andale Mono&lt;/family&gt;&lt;/prefer&gt;
6722c393a42Smrg&lt;/alias&gt;
673ca08ab68Smrg
674ca08ab68Smrg&lt;--
675ca08ab68Smrg	The example of the requirements of OR operator;
676ca08ab68Smrg	If the 'family' contains 'Courier New' OR 'Courier'
677ca08ab68Smrg	add 'monospace' as the alternative
678ca08ab68Smrg--&gt;
679ca08ab68Smrg&lt;match target="pattern"&gt;
680a32e9e42Smrg	&lt;test name="family" compare="eq"&gt;
681ca08ab68Smrg		&lt;string&gt;Courier New&lt;/string&gt;
682ca08ab68Smrg	&lt;/test&gt;
683ca08ab68Smrg	&lt;edit name="family" mode="prepend"&gt;
684ca08ab68Smrg		&lt;string&gt;monospace&lt;/string&gt;
685ca08ab68Smrg	&lt;/edit&gt;
686ca08ab68Smrg&lt;/match&gt;
687ca08ab68Smrg&lt;match target="pattern"&gt;
688a32e9e42Smrg	&lt;test name="family" compare="eq"&gt;
689ca08ab68Smrg		&lt;string&gt;Courier&lt;/string&gt;
690ca08ab68Smrg	&lt;/test&gt;
691ca08ab68Smrg	&lt;edit name="family" mode="prepend"&gt;
692ca08ab68Smrg		&lt;string&gt;monospace&lt;/string&gt;
693ca08ab68Smrg	&lt;/edit&gt;
694ca08ab68Smrg&lt;/match&gt;
695ca08ab68Smrg
6962c393a42Smrg&lt;/fontconfig&gt;
6972c393a42Smrg    </programlisting>
6982c393a42Smrg  </refsect2>
6992c393a42Smrg  <refsect2><title>User configuration file</title>
7002c393a42Smrg    <para>
7012c393a42SmrgThis is an example of a per-user configuration file that lives in
702ca08ab68Smrg$XDG_CONFIG_HOME/fontconfig/fonts.conf
7032c393a42Smrg    </para>
7042c393a42Smrg    <programlisting>
7052c393a42Smrg&lt;?xml version="1.0"?&gt;
706a4e54154Smrg&lt;!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"&gt;
707ca08ab68Smrg&lt;!-- $XDG_CONFIG_HOME/fontconfig/fonts.conf for per-user font configuration --&gt;
7082c393a42Smrg&lt;fontconfig&gt;
7092c393a42Smrg
7102c393a42Smrg&lt;!--
7112c393a42Smrg	Private font directory
7122c393a42Smrg--&gt;
713ca08ab68Smrg&lt;dir prefix="xdg"&gt;fonts&lt;/dir&gt;
7142c393a42Smrg
7152c393a42Smrg&lt;!--
7162c393a42Smrg	use rgb sub-pixel ordering to improve glyph appearance on
7172c393a42Smrg	LCD screens.  Changes affecting rendering, but not matching
7182c393a42Smrg	should always use target="font".
7192c393a42Smrg--&gt;
7202c393a42Smrg&lt;match target="font"&gt;
7212c393a42Smrg	&lt;edit name="rgba" mode="assign"&gt;&lt;const&gt;rgb&lt;/const&gt;&lt;/edit&gt;
7222c393a42Smrg&lt;/match&gt;
723ca08ab68Smrg&lt;!--
724ca08ab68Smrg	use WenQuanYi Zen Hei font when serif is requested for Chinese
725ca08ab68Smrg--&gt;
726ca08ab68Smrg&lt;match&gt;
727ca08ab68Smrg	&lt;!--
728ca08ab68Smrg		If you don't want to use WenQuanYi Zen Hei font for zh-tw etc,
729ca08ab68Smrg		you can use zh-cn instead of zh.
730ca08ab68Smrg		Please note, even if you set zh-cn, it still matches zh.
731ca08ab68Smrg		if you don't like it, you can use compare="eq"
732ca08ab68Smrg		instead of compare="contains".
733ca08ab68Smrg	--&gt;
734ca08ab68Smrg	&lt;test name="lang" compare="contains"&gt;
735ca08ab68Smrg		&lt;string&gt;zh&lt;/string&gt;
736ca08ab68Smrg	&lt;/test&gt;
737ca08ab68Smrg	&lt;test name="family"&gt;
738ca08ab68Smrg		&lt;string&gt;serif&lt;/string&gt;
739ca08ab68Smrg	&lt;/test&gt;
740ca08ab68Smrg	&lt;edit name="family" mode="prepend"&gt;
741ca08ab68Smrg		&lt;string&gt;WenQuanYi Zen Hei&lt;/string&gt;
742ca08ab68Smrg	&lt;/edit&gt;
743ca08ab68Smrg&lt;/match&gt;
744ca08ab68Smrg&lt;!--
745ca08ab68Smrg	use VL Gothic font when sans-serif is requested for Japanese
746ca08ab68Smrg--&gt;
747ca08ab68Smrg&lt;match&gt;
748ca08ab68Smrg	&lt;test name="lang" compare="contains"&gt;
749ca08ab68Smrg		&lt;string&gt;ja&lt;/string&gt;
750ca08ab68Smrg	&lt;/test&gt;
751ca08ab68Smrg	&lt;test name="family"&gt;
752ca08ab68Smrg		&lt;string&gt;sans-serif&lt;/string&gt;
753ca08ab68Smrg	&lt;/test&gt;
754ca08ab68Smrg	&lt;edit name="family" mode="prepend"&gt;
755ca08ab68Smrg		&lt;string&gt;VL Gothic&lt;/string&gt;
756ca08ab68Smrg	&lt;/edit&gt;
757ca08ab68Smrg&lt;/match&gt;
7582c393a42Smrg&lt;/fontconfig&gt;
7592c393a42Smrg    </programlisting>
7602c393a42Smrg  </refsect2>
7612c393a42Smrg</refsect1>
7622c393a42Smrg<refsect1><title>Files</title>
7632c393a42Smrg  <para>
7642c393a42Smrg<emphasis>fonts.conf</emphasis>
7652c393a42Smrgcontains configuration information for the fontconfig library
7662c393a42Smrgconsisting of directories to look at for font information as well as
7672c393a42Smrginstructions on editing program specified font patterns before attempting to
768ca08ab68Smrgmatch the available fonts.  It is in XML format.
7692c393a42Smrg  </para>
7702c393a42Smrg  <para>
7712c393a42Smrg<emphasis>conf.d</emphasis>
7722c393a42Smrgis the conventional name for a directory of additional configuration files
7732c393a42Smrgmanaged by external applications or the local administrator.  The
7742c393a42Smrgfilenames starting with decimal digits are sorted in lexicographic order
775ca08ab68Smrgand used as additional configuration files.  All of these files are in XML
7762c393a42Smrgformat.  The master fonts.conf file references this directory in an 
7772c393a42Smrg&lt;include&gt; directive.
7782c393a42Smrg  </para>
7792c393a42Smrg  <para>
7802c393a42Smrg<emphasis>fonts.dtd</emphasis>
7812c393a42Smrgis a DTD that describes the format of the configuration files.
7822c393a42Smrg  </para>
7832c393a42Smrg  <para>
784ca08ab68Smrg<emphasis>$XDG_CONFIG_HOME/fontconfig/conf.d</emphasis> and <emphasis>~/.fonts.conf.d</emphasis>
785a6844aabSmrgis the conventional name for a per-user directory of (typically
786a6844aabSmrgauto-generated) configuration files, although the
787ca08ab68Smrgactual 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.
788a6844aabSmrg  </para>
789a6844aabSmrg  <para>
790ca08ab68Smrg<emphasis>$XDG_CONFIG_HOME/fontconfig/fonts.conf</emphasis> and <emphasis>~/.fonts.conf</emphasis>
7912c393a42Smrgis the conventional location for per-user font configuration, although the
792ca08ab68Smrgactual 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.
7932c393a42Smrg  </para>
7942c393a42Smrg  <para>
795ca08ab68Smrg<emphasis>$XDG_CACHE_HOME/fontconfig/*.cache-*</emphasis> and <emphasis> ~/.fontconfig/*.cache-*</emphasis>
7962c393a42Smrgis the conventional repository of font information that isn't found in the
797ca08ab68Smrgper-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.
798ca08ab68Smrg  </para>
799ca08ab68Smrg</refsect1>
800ca08ab68Smrg<refsect1><title>Environment variables</title>
801ca08ab68Smrg  <para>
802ca08ab68Smrg<emphasis>FONTCONFIG_FILE</emphasis>
803ca08ab68Smrgis used to override the default configuration file.
804ca08ab68Smrg  </para>
805ca08ab68Smrg  <para>
806ca08ab68Smrg<emphasis>FONTCONFIG_PATH</emphasis>
807ca08ab68Smrgis used to override the default configuration directory.
808ca08ab68Smrg  </para>
809ca08ab68Smrg  <para>
810a32e9e42Smrg<emphasis>FONTCONFIG_SYSROOT</emphasis>
811a32e9e42Smrgis used to set a default sysroot directory.
812a32e9e42Smrg  </para>
813a32e9e42Smrg  <para>
814ca08ab68Smrg<emphasis>FC_DEBUG</emphasis>
815ca08ab68Smrgis used to output the detailed debugging messages. see <link linkend="debug">Debugging Applications</link> section for more details.
816ca08ab68Smrg  </para>
817ca08ab68Smrg  <para>
818953daebaSmrg<emphasis>FC_DBG_MATCH_FILTER</emphasis>
819953daebaSmrgis 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.
820953daebaSmrg  </para>
821953daebaSmrg  <para>
822953daebaSmrg<emphasis>FC_LANG</emphasis>
823953daebaSmrgis 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.
824953daebaSmrg  </para>
825953daebaSmrg  <para>
826ca08ab68Smrg<emphasis>FONTCONFIG_USE_MMAP</emphasis>
827ca08ab68Smrgis 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.
8282c393a42Smrg  </para>
829a32e9e42Smrg  <para>
830a32e9e42Smrg<emphasis>SOURCE_DATE_EPOCH</emphasis>
831a32e9e42Smrgis 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.
832a32e9e42Smrg  </para>
8332c393a42Smrg</refsect1>
8342c393a42Smrg<refsect1><title>See Also</title>
8352c393a42Smrg  <para>
836a32e9e42Smrgfc-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>.
8372c393a42Smrg  </para>
8382c393a42Smrg</refsect1>
8392c393a42Smrg<refsect1><title>Version</title>
8402c393a42Smrg	    <para>
8412c393a42SmrgFontconfig version &version;
8422c393a42Smrg	    </para>
8432c393a42Smrg</refsect1>
8442c393a42Smrg</refentry>
845