Fix typo.
[platform/upstream/fontconfig.git] / doc / fontconfig-user.sgml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
2 <!ENTITY version SYSTEM "version.sgml">
3 <!ENTITY confdir SYSTEM "confdir.sgml">
4 ]>
5 <!--
6     $Id$
7    
8     Copyright © 2003 Keith Packard
9    
10     Permission to use, copy, modify, distribute, and sell this software and its
11     documentation for any purpose is hereby granted without fee, provided that
12     the above copyright notice appear in all copies and that both that
13     copyright notice and this permission notice appear in supporting
14     documentation, and that the name of Keith Packard not be used in
15     advertising or publicity pertaining to distribution of the software without
16     specific, written prior permission.  Keith Packard makes no
17     representations about the suitability of this software for any purpose.  It
18     is provided "as is" without express or implied warranty.
19    
20     KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
21     INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
22     EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
23     CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
24     DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
25     TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26     PERFORMANCE OF THIS SOFTWARE.
27 -->
28 <refentry>
29 <refmeta>
30   <refentrytitle>fonts-conf</refentrytitle>
31   <manvolnum>5</manvolnum>
32 </refmeta>
33 <refnamediv>
34         <refname>fonts.conf</refname>
35         <refpurpose>Font configuration files</refpurpose>
36 </refnamediv>
37 <refsynopsisdiv>
38 <synopsis>
39    &confdir;/fonts.conf
40    &confdir;/fonts.dtd
41    ~/.fonts.conf
42 </synopsis>
43 </refsynopsisdiv>
44 <refsect1><title>Description</title>
45   <para>
46 Fontconfig is a library designed to provide system-wide font configuration,
47 customization and application access.
48   </para>
49 </refsect1>
50 <refsect1><title>Functional Overview</title>
51   <para>
52 Fontconfig contains two essential modules, the configuration module which
53 builds an internal configuration from XML files and the matching module
54 which accepts font patterns and returns the nearest matching font.
55   </para>
56   <refsect2><title>Font Configuration</title>
57     <para>
58 The configuration module consists of the FcConfig datatype, libexpat and
59 FcConfigParse which walks over an XML tree and ammends a configuration with
60 data found within.  From an external perspective, configuration of the
61 library consists of generating a valid XML tree and feeding that to
62 FcConfigParse.  The only other mechanism provided to applications for
63 changing the running configuration is to add fonts and directories to the
64 list of application-provided font files.  
65     </para><para>
66 The intent is to make font configurations relatively static, and shared by
67 as many applications as possible.  It is hoped that this will lead to more
68 stable font selection when passing names from one application to another.
69 XML was chosen as a configuration file format because it provides a format
70 which is easy for external agents to edit while retaining the correct
71 structure and syntax.
72     </para><para>
73 Font configuration is separate from font matching; applications needing to
74 do their own matching can access the available fonts from the library and
75 perform private matching.  The intent is to permit applications to pick and
76 choose appropriate functionality from the library instead of forcing them to
77 choose between this library and a private configuration mechanism.  The hope
78 is that this will ensure that configuration of fonts for all applications
79 can be centralized in one place.  Centralizing font configuration will
80 simplify and regularize font installation and customization.
81     </para>
82   </refsect2>
83   <refsect2>
84     <title>Font Properties</title>
85     <para>
86 While font patterns may contain essentially any properties, there are some
87 well known properties with associated types.  Fontconfig uses some of these
88 properties for font matching and font completion.  Others are provided as a
89 convenience for the applications rendering mechanism.
90     </para>
91     <programlisting>
92   Property        Type    Description
93   --------------------------------------------------------------
94   family          String  Font family names
95   familylang      String  Languages cooresponding to each family
96   style           String  Font style. Overrides weight and slant
97   stylelang       String  Languages cooresponding to each style
98   fullname        String  Font full names (often includes style)
99   fullnamelang    String  Languages cooresponding to each fullname
100   slant           Int     Italic, oblique or roman
101   weight          Int     Light, medium, demibold, bold or black
102   size            Double  Point size
103   aspect          Double  Stretches glyphs horizontally before hinting
104   pixelsize       Double  Pixel size
105   spacing         Int     Proportional, dual-width, monospace or charcell
106   foundry         String  Font foundry name
107   antialias       Bool    Whether glyphs can be antialiased
108   hinting         Bool    Whether the rasterizer should use hinting
109   verticallayout  Bool    Use vertical layout
110   autohint        Bool    Use autohinter instead of normal hinter
111   globaladvance   Bool    Use font global advance data
112   file            String  The filename holding the font
113   index           Int     The index of the font within the file
114   ftface          FT_Face Use the specified FreeType face object
115   rasterizer      String  Which rasterizer is in use
116   outline         Bool    Whether the glyphs are outlines
117   scalable        Bool    Whether glyphs can be scaled
118   scale           Double  Scale factor for point->pixel conversions
119   dpi             Double  Target dots per inch
120   rgba            Int     unknown, rgb, bgr, vrgb, vbgr,
121                           none - subpixel geometry
122   minspace        Bool    Eliminate leading from line spacing
123   charset         CharSet Unicode chars encoded by the font
124   lang            String  List of RFC-3066-style languages this
125                           font supports
126     </programlisting>
127   </refsect2>
128   <refsect2>
129   <title>Font Matching</title>
130     <para>
131 Fontconfig performs matching by measuring the distance from a provided
132 pattern to all of the available fonts in the system.  The closest matching
133 font is selected.  This ensures that a font will always be returned, but
134 doesn't ensure that it is anything like the requested pattern.
135     </para><para> 
136 Font matching starts with an application constructed pattern.  The desired
137 attributes of the resulting font are collected together in a pattern.  Each
138 property of the pattern can contain one or more values; these are listed in
139 priority order; matches earlier in the list are considered "closer" than
140 matches later in the list.
141     </para><para>
142 The initial pattern is modified by applying the list of editing instructions
143 specific to patterns found in the configuration; each consists of a match
144 predicate and a set of editing operations.  They are executed in the order
145 they appeared in the configuration.  Each match causes the associated
146 sequence of editing operations to be applied.
147     </para><para>
148 After the pattern has been edited, a sequence of default substitutions are
149 performed to canonicalize the set of available properties; this avoids the
150 need for the lower layers to constantly provide default values for various
151 font properties during rendering.
152     </para><para>
153 The canonical font pattern is finally matched against all available fonts.
154 The distance from the pattern to the font is measured for each of several
155 properties: foundry, charset, family, lang, spacing, pixelsize, style,
156 slant, weight, antialias, rasterizer and outline.  This list is in priority
157 order -- results of comparing earlier elements of this list weigh more
158 heavily than later elements.
159     </para><para>
160 There is one special case to this rule; family names are split into two
161 bindings; strong and weak.  Strong family names are given greater precedence
162 in the match than lang elements while weak family names are given lower
163 precedence than lang elements.  This permits the document language to drive
164 font selection when any document specified font is unavailable.
165     </para><para>
166 The pattern representing that font is augmented to include any properties
167 found in the pattern but not found in the font itself; this permits the
168 application to pass rendering instructions or any other data through the
169 matching system.  Finally, the list of editing instructions specific to
170 fonts found in the configuration are applied to the pattern.  This modified
171 pattern is returned to the application.
172     </para><para>
173 The return value contains sufficient information to locate and rasterize the
174 font, including the file name, pixel size and other rendering data.  As
175 none of the information involved pertains to the FreeType library,
176 applications are free to use any rasterization engine or even to take
177 the identified font file and access it directly.
178     </para><para>
179 The match/edit sequences in the configuration are performed in two passes
180 because there are essentially two different operations necessary -- the
181 first is to modify how fonts are selected; aliasing families and adding
182 suitable defaults.  The second is to modify how the selected fonts are
183 rasterized.  Those must apply to the selected font, not the original pattern
184 as false matches will often occur.
185     </para>
186   </refsect2>
187   <refsect2><title>Font Names</title>
188     <para>
189 Fontconfig provides a textual representation for patterns that the library
190 can both accept and generate.  The representation is in three parts, first a
191 list of family names, second a list of point sizes and finally a list of
192 additional properties:
193     </para>
194     <programlisting>
195         &lt;families&gt;-&lt;point sizes&gt;:&lt;name1&gt;=&lt;values1&gt;:&lt;name2&gt;=&lt;values2&gt;...
196     </programlisting>
197     <para>
198 Values in a list are separated with commas.  The name needn't include either
199 families or point sizes; they can be elided.  In addition, there are
200 symbolic constants that simultaneously indicate both a name and a value.
201 Here are some examples:
202     </para>
203     <programlisting>
204   Name                            Meaning
205   ----------------------------------------------------------
206   Times-12                        12 point Times Roman
207   Times-12:bold                   12 point Times Bold
208   Courier:italic                  Courier Italic in the default size
209   Monospace:matrix=1 .1 0 1       The users preferred monospace font
210                                   with artificial obliquing
211     </programlisting>
212   </refsect2>
213 </refsect1>
214 <refsect1><title>Lang Tags</title>
215   <para>
216 Each font in the database contains a list of languages it supports.  This is
217 computed by comparing the Unicode coverage of the font with the orthography
218 of each language.  Languages are tagged using an RFC-3066 compatible naming
219 and occur in two parts -- the ISO639 language tag followed a hyphen and then
220 by the ISO 3166 country code.  The hyphen and country code may be elided.
221   </para><para>
222 Fontconfig has orthographies for several languages built into the library.
223 No provision has been made for adding new ones aside from rebuilding the
224 library.  It currently supports 122 of the 139 languages named in ISO 639-1,
225 141 of the languages with two-letter codes from ISO 639-2 and another 30
226 languages with only three-letter codes.
227   </para>
228 </refsect1>
229 <refsect1><title>Configuration File Format</title>
230   <para>
231 Configuration files for fontconfig are stored in XML format; this
232 format makes external configuration tools easier to write and ensures that
233 they will generate syntactically correct configuration files.  As XML
234 files are plain text, they can also be manipulated by the expert user using
235 a text editor.
236   </para><para>
237 The fontconfig document type definition resides in the external entity
238 "fonts.dtd"; this is normally stored in the default font configuration
239 directory (&confdir;).  Each configuration file should contain the
240 following structure:
241     <programlisting>
242         &lt;?xml version="1.0"?&gt;
243         &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
244         &lt;fontconfig&gt;
245         ...
246         &lt;/fontconfig&gt;
247     </programlisting>
248   </para>
249 <refsect2><title><literal>&lt;fontconfig&gt;</literal></title><para>
250 This is the top level element for a font configuration and can contain
251 <sgmltag>dir</>, <sgmltag>cache</>, <sgmltag>include</>, <sgmltag>match</> and <sgmltag>alias</> elements in any order.
252   </para></refsect2>
253   <refsect2><title><sgmltag>dir</></title><para>
254 This element contains a directory name which will be scanned for font files
255 to include in the set of available fonts.
256   </para></refsect2>
257   <refsect2><title><sgmltag>cache</></title><para>
258 This element contains a file name for the per-user cache of font
259 information.  If it starts with '~', it refers to a file in the users
260 home directory.  This file is used to hold information about fonts that
261 isn't present in the per-directory cache files.  It is automatically
262 maintained by the fontconfig library.  The default for this file 
263 is ``~/.fonts.cache-<sgmltag>version</>'', where <sgmltag>version</> is the font configuration
264 file version number (currently 1).
265   </para></refsect2>
266   <refsect2><title><sgmltag>include ignore_missing="no"</></title><para>
267 This element contains the name of an additional configuration file.  When
268 the XML datatype is traversed by FcConfigParse, the contents of the file
269 will also be incorporated into the configuration by passing the filename to
270 FcConfigLoadAndParse.  If 'ignore_missing' is set to "yes" instead of the
271 default "no", a missing file will elicit no warning message from the library.
272   </para></refsect2>
273   <refsect2><title><sgmltag>config</></title><para>
274 This element provides a place to consolodate additional configuration
275 information.  <sgmltag>config</> can contain <sgmltag>blank</> and <sgmltag>rescan</> elements in any
276 order.
277   </para></refsect2>
278   <refsect2><title><sgmltag>blank</></title><para>
279 Fonts often include "broken" glyphs which appear in the encoding but are
280 drawn as blanks on the screen.  Within the <sgmltag>blank</> element, place each
281 Unicode characters which is supposed to be blank in an <sgmltag>int</> element.
282 Characters outside of this set which are drawn as blank will be elided from
283 the set of characters supported by the font.
284   </para></refsect2>
285   <refsect2><title><sgmltag>rescan</></title><para>
286 The <sgmltag>rescan</> element holds an <sgmltag>int</> element which indicates the default
287 interval between automatic checks for font configuration changes.
288 Fontconfig will validate all of the configuration files and directories and
289 automatically rebuild the internal datastructures when this interval passes.
290   </para></refsect2>
291   <refsect2><title><sgmltag>selectfont</></title><para>
292 This element is used to black/white list fonts from being listed or matched
293 against.  It holds acceptfont and rejectfont elements.
294   </para></refsect2>
295   <refsect2><title><sgmltag>acceptfont</></title><para>
296 Fonts matched by an acceptfont element are "whitelisted"; such fonts are
297 explicitly included in the set of fonts used to resolve list and match
298 requests; including them in this list protects them from being "blacklisted"
299 by a rejectfont element.  Acceptfont elements include glob and pattern
300 elements which are used to match fonts.
301   </para></refsect2>
302   <refsect2><title><sgmltag>rejectfont</></title><para>
303 Fonts matched by an rejectfont element are "blacklisted"; such fonts are
304 excluded from the set of fonts used to resolve list and match requests as if
305 they didn't exist in the system.  Rejectfont elements include glob and
306 pattern elements which are used to match fonts.
307   </para></refsect2>
308   <refsect2><title><sgmltag>glob</></title><para>
309 Glob elements hold shell-style filename matching patterns (including ? and
310 *) which match fonts based on their complete pathnames.  This can be used to
311 exclude a set of directories (/usr/share/fonts/uglyfont*), or particular
312 font file types (*.pcf.gz), but the latter mechanism relies rather heavily
313 on filenaming conventions which can't be relied upon.
314   </para></refsect2>
315   <refsect2><title><sgmltag>pattern</></title><para>
316 Pattern elements perform list-style matching on incoming fonts; that is,
317 they hold a list of elements and associated values.  If all of those
318 elements have a matching value, then the pattern matches the font.  This can
319 be used to select fonts based on attributes of the font (scalable, bold,
320 etc), which is a more reliable mechanism than using file extensions.
321 Pattern elements include patelt elements.
322   </para></refsect2>
323   <refsect2><title><sgmltag>patelt name="property"</></title><para>
324 Patelt elements hold a single pattern element and list of values.  They must
325 have a 'name' attribute which indicates the pattern element name.  Patelt
326 elements include int, double, string, matrix, bool, charset and const
327 elements.
328   </para></refsect2>
329   <refsect2><title><sgmltag>match target="pattern"</></title><para>
330 This element holds first a (possibly empty) list of <sgmltag>test</> elements and then
331 a (possibly empty) list of <sgmltag>edit</> elements.  Patterns which match all of the
332 tests are subjected to all the edits.  If 'target' is set to "font" instead
333 of the default "pattern", then this element applies to the font name
334 resulting from a match rather than a font pattern to be matched.
335   </para></refsect2>
336   <refsect2><title><sgmltag>test qual="any" name="property" compare="eq"</></title><para>
337 This element contains a single value which is compared with the pattern
338 property "property" (substitute any of the property names seen 
339 above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", or
340 "more_eq".  'qual' may either be the default, "any", in which case the match
341 succeeds if any value associated with the property matches the test value, or
342 "all", in which case all of the values associated with the property must
343 match the test value.
344   </para></refsect2>
345   <refsect2><title><sgmltag>edit name="property" mode="assign" binding="weak"</></title><para>
346 This element contains a list of expression elements (any of the value or
347 operator elements).  The expression elements are evaluated at run-time and
348 modify the property "property".  The modification depends on whether
349 "property" was matched by one of the associated <sgmltag>test</> elements, if so, the
350 modification may affect the first matched value.  Any values inserted into
351 the property are given the indicated binding. 'mode' is one of:
352     <programlisting>
353   Mode                    With Match              Without Match
354   ---------------------------------------------------------------------
355   "assign"                Replace matching value  Replace all values
356   "assign_replace"        Replace all values      Replace all values
357   "prepend"               Insert before matching  Insert at head of list
358   "prepend_first"         Insert at head of list  Insert at head of list
359   "append"                Append after matching   Append at end of list
360   "append_last"           Append at end of list   Append at end of list
361     </programlisting>
362   </para></refsect2>
363   <refsect2><title><sgmltag>int</>, <sgmltag>double</>, <sgmltag>string</>, <sgmltag>bool</></title><para>
364 These elements hold a single value of the indicated type.  <sgmltag>bool</>
365 elements hold either true or false.  An important limitation exists in
366 the parsing of floating point numbers -- fontconfig requires that
367 the mantissa start with a digit, not a decimal point, so insert a leading
368 zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
369 instead of -.5).
370   </para></refsect2>
371   <refsect2><title><sgmltag>matrix</></title><para>
372 This element holds the four <sgmltag>double</> elements of an affine
373 transformation.
374   </para></refsect2>
375   <refsect2><title><sgmltag>name</></title><para>
376 Holds a property name.  Evaluates to the first value from the property of
377 the font, not the pattern.
378   </para></refsect2>
379   <refsect2><title><sgmltag>const</></title><para>
380 Holds the name of a constant; these are always integers and serve as
381 symbolic names for common font values:
382     <programlisting>
383   Constant        Property        Value
384   -------------------------------------
385   light           weight          0
386   medium          weight          100
387   demibold        weight          180
388   bold            weight          200
389   black           weight          210
390   roman           slant           0
391   italic          slant           100
392   oblique         slant           110
393   proportional    spacing         0
394   dual            spacing         90
395   mono            spacing         100
396   charcell        spacing         110
397   unknown         rgba            0
398   rgb             rgba            1
399   bgr             rgba            2
400   vrgb            rgba            3
401   vbgr            rgba            4
402   none            rgba            5
403     </programlisting>
404       </para>
405     </refsect2>
406   <refsect2>
407       <title><sgmltag>or</>, <sgmltag>and</>, <sgmltag>plus</>, <sgmltag>minus</>, <sgmltag>times</>, <sgmltag>divide</></title>
408       <para>
409 These elements perform the specified operation on a list of expression
410 elements.  <sgmltag>or</> and <sgmltag>and</> are boolean, not bitwise.
411       </para>
412     </refsect2>
413   <refsect2>
414     <title><sgmltag>eq</>, <sgmltag>not_eq</>, <sgmltag>less</>, <sgmltag>less_eq</>, <sgmltag>more</>, <sgmltag>more_eq</></title>
415     <para>
416 These elements compare two values, producing a boolean result.
417   </para></refsect2>
418   <refsect2><title><sgmltag>not</></title><para>
419 Inverts the boolean sense of its one expression element
420   </para></refsect2>
421   <refsect2><title><sgmltag>if</></title><para>
422 This element takes three expression elements; if the value of the first is
423 true, it produces the value of the second, otherwise it produces the value
424 of the third.
425   </para></refsect2>
426   <refsect2><title><sgmltag>alias</></title><para>
427 Alias elements provide a shorthand notation for the set of common match
428 operations needed to substitute one font family for another.  They contain a
429 <sgmltag>family</> element followed by optional <sgmltag>prefer</>, <sgmltag>accept</> and <sgmltag>default</>
430 elements.  Fonts matching the <sgmltag>family</> element are edited to prepend the
431 list of <sgmltag>prefer</>ed families before the matching <sgmltag>family</>, append the
432 <sgmltag>accept</>able familys after the matching <sgmltag>family</> and append the <sgmltag>default</>
433 families to the end of the family list.
434   </para></refsect2>
435   <refsect2><title><sgmltag>family</></title><para>
436 Holds a single font family name
437   </para></refsect2>
438   <refsect2><title><sgmltag>prefer</>, <sgmltag>accept</>, <sgmltag>default</></title><para>
439 These hold a list of <sgmltag>family</> elements to be used by the <sgmltag>alias</> element.
440 <sgmltag>/article</>
441   </para></refsect2>
442 </refsect1>
443 <refsect1><title>EXAMPLE CONFIGURATION FILE</title>
444   <refsect2><title>System configuration file</title>
445     <para>
446 This is an example of a system-wide configuration file
447     </para>
448     <programlisting>
449 &lt;?xml version="1.0"?&gt;
450 &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
451 &lt;!-- &confdir;/fonts.conf file to configure system font access --&gt;
452 &lt;fontconfig&gt;
453 &lt;!-- 
454         Find fonts in these directories
455 --&gt;
456 &lt;dir&gt;/usr/X11R6/lib/X11/fonts/truetype&lt;/dir&gt;
457 &lt;dir&gt;/usr/X11R6/lib/X11/fonts/Type1&lt;/dir&gt;
458
459 &lt;!--
460         Accept deprecated 'mono' alias, replacing it with 'monospace'
461 --&gt;
462 &lt;match target="pattern"&gt;
463         &lt;test qual="any" name="family"&gt;&lt;string&gt;mono&lt;/string&gt;&lt;/test&gt;
464         &lt;edit name="family" mode="assign"&gt;&lt;string&gt;monospace&lt;/string&gt;&lt;/edit&gt;
465 &lt;/match&gt;
466
467 &lt;!--
468         Names not including any well known alias are given 'sans'
469 --&gt;
470 &lt;match target="pattern"&gt;
471         &lt;test qual="all" name="family" mode="not_eq"&gt;sans&lt;/test&gt;
472         &lt;test qual="all" name="family" mode="not_eq"&gt;serif&lt;/test&gt;
473         &lt;test qual="all" name="family" mode="not_eq"&gt;monospace&lt;/test&gt;
474         &lt;edit name="family" mode="append_last"&gt;&lt;string&gt;sans&lt;/string&gt;&lt;/edit&gt;
475 &lt;/match&gt;
476
477 &lt;!--
478         Load per-user customization file, but don't complain
479         if it doesn't exist
480 --&gt;
481 &lt;include ignore_missing="yes"&gt;~/.fonts.conf&lt;/include&gt;
482
483 &lt;!--
484         Alias well known font names to available TrueType fonts.
485         These substitute TrueType faces for similar Type1
486         faces to improve screen appearance.
487 --&gt;
488 &lt;alias&gt;
489         &lt;family&gt;Times&lt;/family&gt;
490         &lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
491         &lt;default&gt;&lt;family&gt;serif&lt;/family&gt;&lt;/default&gt;
492 &lt;/alias&gt;
493 &lt;alias&gt;
494         &lt;family&gt;Helvetica&lt;/family&gt;
495         &lt;prefer&gt;&lt;family&gt;Verdana&lt;/family&gt;&lt;/prefer&gt;
496         &lt;default&gt;&lt;family&gt;sans&lt;/family&gt;&lt;/default&gt;
497 &lt;/alias&gt;
498 &lt;alias&gt;
499         &lt;family&gt;Courier&lt;/family&gt;
500         &lt;prefer&gt;&lt;family&gt;Courier New&lt;/family&gt;&lt;/prefer&gt;
501         &lt;default&gt;&lt;family&gt;monospace&lt;/family&gt;&lt;/default&gt;
502 &lt;/alias&gt;
503
504 &lt;!--
505         Provide required aliases for standard names
506         Do these after the users configuration file so that
507         any aliases there are used preferentially
508 --&gt;
509 &lt;alias&gt;
510         &lt;family&gt;serif&lt;/family&gt;
511         &lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
512 &lt;/alias&gt;
513 &lt;alias&gt;
514         &lt;family&gt;sans&lt;/family&gt;
515         &lt;prefer&gt;&lt;family&gt;Verdana&lt;/family&gt;&lt;/prefer&gt;
516 &lt;/alias&gt;
517 &lt;alias&gt;
518         &lt;family&gt;monospace&lt;/family&gt;
519         &lt;prefer&gt;&lt;family&gt;Andale Mono&lt;/family&gt;&lt;/prefer&gt;
520 &lt;/alias&gt;
521 &lt;/fontconfig&gt;
522     </programlisting>
523   </refsect2>
524   <refsect2><title>User configuration file</title>
525     <para>
526 This is an example of a per-user configuration file that lives in
527 ~/.fonts.conf
528     </para>
529     <programlisting>
530 &lt;?xml version="1.0"?&gt;
531 &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
532 &lt;!-- ~/.fonts.conf for per-user font configuration --&gt;
533 &lt;fontconfig&gt;
534
535 &lt;!--
536         Private font directory
537 --&gt;
538 &lt;dir&gt;~/misc/fonts&lt;/dir&gt;
539
540 &lt;!--
541         use rgb sub-pixel ordering to improve glyph appearance on
542         LCD screens.  Changes affecting rendering, but not matching
543         should always use target="font".
544 --&gt;
545 &lt;match target="font"&gt;
546         &lt;edit name="rgba" mode="assign"&gt;&lt;const&gt;rgb&lt;/const&gt;&lt;/edit&gt;
547 &lt;/match&gt;
548 &lt;/fontconfig&gt;
549     </programlisting>
550   </refsect2>
551 </refsect1>
552 <refsect1><title>Files</title>
553   <para>
554 <emphasis>fonts.conf</emphasis>
555 contains configuration information for the fontconfig library
556 consisting of directories to look at for font information as well as
557 instructions on editing program specified font patterns before attempting to
558 match the available fonts.  It is in xml format.
559   </para>
560   <para>
561 <emphasis>fonts.dtd</emphasis>
562 is a DTD that describes the format of the configuration files.
563   </para>
564   <para>
565 <emphasis>~/.fonts.conf</emphasis>
566 is the conventional location for per-user font configuration, although the
567 actual location is specified in the global fonts.conf file.
568   </para>
569   <para>
570 <emphasis> ~/.fonts.cache-*</emphasis>
571 is the conventional repository of font information that isn't found in the
572 per-directory caches.  This file is automatically maintained by fontconfig.
573   </para>
574 </refsect1>
575 <refsect1><title>Version</title>
576             <para>
577 Fontconfig version &version;
578             </para>
579 </refsect1>
580 </refentry>