]> git.wh0rd.org - fontconfig.git/blob - doc/fontconfig-user.sgml
edb3d14475433c83e70d41dd68b269537639efd9
[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 or
268 directory. If a directory, every file within that directory starting with a
269 number will be processed in sorted order. When
270 the XML datatype is traversed by FcConfigParse, the contents of the file(s)
271 will also be incorporated into the configuration by passing the filename(s) to
272 FcConfigLoadAndParse. If 'ignore_missing' is set to "yes" instead of the
273 default "no", a missing file or directory will elicit no warning message from
274 the library.
275 </para></refsect2>
276 <refsect2><title><sgmltag>config</></title><para>
277 This element provides a place to consolodate additional configuration
278 information. <sgmltag>config</> can contain <sgmltag>blank</> and <sgmltag>rescan</> elements in any
279 order.
280 </para></refsect2>
281 <refsect2><title><sgmltag>blank</></title><para>
282 Fonts often include "broken" glyphs which appear in the encoding but are
283 drawn as blanks on the screen. Within the <sgmltag>blank</> element, place each
284 Unicode characters which is supposed to be blank in an <sgmltag>int</> element.
285 Characters outside of this set which are drawn as blank will be elided from
286 the set of characters supported by the font.
287 </para></refsect2>
288 <refsect2><title><sgmltag>rescan</></title><para>
289 The <sgmltag>rescan</> element holds an <sgmltag>int</> element which indicates the default
290 interval between automatic checks for font configuration changes.
291 Fontconfig will validate all of the configuration files and directories and
292 automatically rebuild the internal datastructures when this interval passes.
293 </para></refsect2>
294 <refsect2><title><sgmltag>selectfont</></title><para>
295 This element is used to black/white list fonts from being listed or matched
296 against. It holds acceptfont and rejectfont elements.
297 </para></refsect2>
298 <refsect2><title><sgmltag>acceptfont</></title><para>
299 Fonts matched by an acceptfont element are "whitelisted"; such fonts are
300 explicitly included in the set of fonts used to resolve list and match
301 requests; including them in this list protects them from being "blacklisted"
302 by a rejectfont element. Acceptfont elements include glob and pattern
303 elements which are used to match fonts.
304 </para></refsect2>
305 <refsect2><title><sgmltag>rejectfont</></title><para>
306 Fonts matched by an rejectfont element are "blacklisted"; such fonts are
307 excluded from the set of fonts used to resolve list and match requests as if
308 they didn't exist in the system. Rejectfont elements include glob and
309 pattern elements which are used to match fonts.
310 </para></refsect2>
311 <refsect2><title><sgmltag>glob</></title><para>
312 Glob elements hold shell-style filename matching patterns (including ? and
313 *) which match fonts based on their complete pathnames. This can be used to
314 exclude a set of directories (/usr/share/fonts/uglyfont*), or particular
315 font file types (*.pcf.gz), but the latter mechanism relies rather heavily
316 on filenaming conventions which can't be relied upon.
317 </para></refsect2>
318 <refsect2><title><sgmltag>pattern</></title><para>
319 Pattern elements perform list-style matching on incoming fonts; that is,
320 they hold a list of elements and associated values. If all of those
321 elements have a matching value, then the pattern matches the font. This can
322 be used to select fonts based on attributes of the font (scalable, bold,
323 etc), which is a more reliable mechanism than using file extensions.
324 Pattern elements include patelt elements.
325 </para></refsect2>
326 <refsect2><title><sgmltag>patelt name="property"</></title><para>
327 Patelt elements hold a single pattern element and list of values. They must
328 have a 'name' attribute which indicates the pattern element name. Patelt
329 elements include int, double, string, matrix, bool, charset and const
330 elements.
331 </para></refsect2>
332 <refsect2><title><sgmltag>match target="pattern"</></title><para>
333 This element holds first a (possibly empty) list of <sgmltag>test</> elements and then
334 a (possibly empty) list of <sgmltag>edit</> elements. Patterns which match all of the
335 tests are subjected to all the edits. If 'target' is set to "font" instead
336 of the default "pattern", then this element applies to the font name
337 resulting from a match rather than a font pattern to be matched.
338 </para></refsect2>
339 <refsect2><title><sgmltag>test qual="any" name="property" compare="eq"</></title><para>
340 This element contains a single value which is compared with the pattern
341 property "property" (substitute any of the property names seen
342 above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", or
343 "more_eq". 'qual' may either be the default, "any", in which case the match
344 succeeds if any value associated with the property matches the test value, or
345 "all", in which case all of the values associated with the property must
346 match the test value.
347 </para></refsect2>
348 <refsect2><title><sgmltag>edit name="property" mode="assign" binding="weak"</></title><para>
349 This element contains a list of expression elements (any of the value or
350 operator elements). The expression elements are evaluated at run-time and
351 modify the property "property". The modification depends on whether
352 "property" was matched by one of the associated <sgmltag>test</> elements, if so, the
353 modification may affect the first matched value. Any values inserted into
354 the property are given the indicated binding. 'mode' is one of:
355 <programlisting>
356 Mode With Match Without Match
357 ---------------------------------------------------------------------
358 "assign" Replace matching value Replace all values
359 "assign_replace" Replace all values Replace all values
360 "prepend" Insert before matching Insert at head of list
361 "prepend_first" Insert at head of list Insert at head of list
362 "append" Append after matching Append at end of list
363 "append_last" Append at end of list Append at end of list
364 </programlisting>
365 </para></refsect2>
366 <refsect2><title><sgmltag>int</>, <sgmltag>double</>, <sgmltag>string</>, <sgmltag>bool</></title><para>
367 These elements hold a single value of the indicated type. <sgmltag>bool</>
368 elements hold either true or false. An important limitation exists in
369 the parsing of floating point numbers -- fontconfig requires that
370 the mantissa start with a digit, not a decimal point, so insert a leading
371 zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
372 instead of -.5).
373 </para></refsect2>
374 <refsect2><title><sgmltag>matrix</></title><para>
375 This element holds the four <sgmltag>double</> elements of an affine
376 transformation.
377 </para></refsect2>
378 <refsect2><title><sgmltag>name</></title><para>
379 Holds a property name. Evaluates to the first value from the property of
380 the font, not the pattern.
381 </para></refsect2>
382 <refsect2><title><sgmltag>const</></title><para>
383 Holds the name of a constant; these are always integers and serve as
384 symbolic names for common font values:
385 <programlisting>
386 Constant Property Value
387 -------------------------------------
388 light weight 0
389 medium weight 100
390 demibold weight 180
391 bold weight 200
392 black weight 210
393 roman slant 0
394 italic slant 100
395 oblique slant 110
396 proportional spacing 0
397 dual spacing 90
398 mono spacing 100
399 charcell spacing 110
400 unknown rgba 0
401 rgb rgba 1
402 bgr rgba 2
403 vrgb rgba 3
404 vbgr rgba 4
405 none rgba 5
406 </programlisting>
407 </para>
408 </refsect2>
409 <refsect2>
410 <title><sgmltag>or</>, <sgmltag>and</>, <sgmltag>plus</>, <sgmltag>minus</>, <sgmltag>times</>, <sgmltag>divide</></title>
411 <para>
412 These elements perform the specified operation on a list of expression
413 elements. <sgmltag>or</> and <sgmltag>and</> are boolean, not bitwise.
414 </para>
415 </refsect2>
416 <refsect2>
417 <title><sgmltag>eq</>, <sgmltag>not_eq</>, <sgmltag>less</>, <sgmltag>less_eq</>, <sgmltag>more</>, <sgmltag>more_eq</></title>
418 <para>
419 These elements compare two values, producing a boolean result.
420 </para></refsect2>
421 <refsect2><title><sgmltag>not</></title><para>
422 Inverts the boolean sense of its one expression element
423 </para></refsect2>
424 <refsect2><title><sgmltag>if</></title><para>
425 This element takes three expression elements; if the value of the first is
426 true, it produces the value of the second, otherwise it produces the value
427 of the third.
428 </para></refsect2>
429 <refsect2><title><sgmltag>alias</></title><para>
430 Alias elements provide a shorthand notation for the set of common match
431 operations needed to substitute one font family for another. They contain a
432 <sgmltag>family</> element followed by optional <sgmltag>prefer</>, <sgmltag>accept</> and <sgmltag>default</>
433 elements. Fonts matching the <sgmltag>family</> element are edited to prepend the
434 list of <sgmltag>prefer</>ed families before the matching <sgmltag>family</>, append the
435 <sgmltag>accept</>able familys after the matching <sgmltag>family</> and append the <sgmltag>default</>
436 families to the end of the family list.
437 </para></refsect2>
438 <refsect2><title><sgmltag>family</></title><para>
439 Holds a single font family name
440 </para></refsect2>
441 <refsect2><title><sgmltag>prefer</>, <sgmltag>accept</>, <sgmltag>default</></title><para>
442 These hold a list of <sgmltag>family</> elements to be used by the <sgmltag>alias</> element.
443 <sgmltag>/article</>
444 </para></refsect2>
445 </refsect1>
446 <refsect1><title>EXAMPLE CONFIGURATION FILE</title>
447 <refsect2><title>System configuration file</title>
448 <para>
449 This is an example of a system-wide configuration file
450 </para>
451 <programlisting>
452 &lt;?xml version="1.0"?&gt;
453 &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
454 &lt;!-- &confdir;/fonts.conf file to configure system font access --&gt;
455 &lt;fontconfig&gt;
456 &lt;!--
457 Find fonts in these directories
458 --&gt;
459 &lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
460 &lt;dir&gt;/usr/X11R6/lib/X11/fonts&lt;/dir&gt;
461
462 &lt;!--
463 Accept deprecated 'mono' alias, replacing it with 'monospace'
464 --&gt;
465 &lt;match target="pattern"&gt;
466 &lt;test qual="any" name="family"&gt;&lt;string&gt;mono&lt;/string&gt;&lt;/test&gt;
467 &lt;edit name="family" mode="assign"&gt;&lt;string&gt;monospace&lt;/string&gt;&lt;/edit&gt;
468 &lt;/match&gt;
469
470 &lt;!--
471 Names not including any well known alias are given 'sans'
472 --&gt;
473 &lt;match target="pattern"&gt;
474 &lt;test qual="all" name="family" mode="not_eq"&gt;sans&lt;/test&gt;
475 &lt;test qual="all" name="family" mode="not_eq"&gt;serif&lt;/test&gt;
476 &lt;test qual="all" name="family" mode="not_eq"&gt;monospace&lt;/test&gt;
477 &lt;edit name="family" mode="append_last"&gt;&lt;string&gt;sans&lt;/string&gt;&lt;/edit&gt;
478 &lt;/match&gt;
479
480 &lt;!--
481 Load per-user customization file, but don't complain
482 if it doesn't exist
483 --&gt;
484 &lt;include ignore_missing="yes"&gt;~/.fonts.conf&lt;/include&gt;
485
486 &lt;!--
487 Alias well known font names to available TrueType fonts.
488 These substitute TrueType faces for similar Type1
489 faces to improve screen appearance.
490 --&gt;
491 &lt;alias&gt;
492 &lt;family&gt;Times&lt;/family&gt;
493 &lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
494 &lt;default&gt;&lt;family&gt;serif&lt;/family&gt;&lt;/default&gt;
495 &lt;/alias&gt;
496 &lt;alias&gt;
497 &lt;family&gt;Helvetica&lt;/family&gt;
498 &lt;prefer&gt;&lt;family&gt;Verdana&lt;/family&gt;&lt;/prefer&gt;
499 &lt;default&gt;&lt;family&gt;sans&lt;/family&gt;&lt;/default&gt;
500 &lt;/alias&gt;
501 &lt;alias&gt;
502 &lt;family&gt;Courier&lt;/family&gt;
503 &lt;prefer&gt;&lt;family&gt;Courier New&lt;/family&gt;&lt;/prefer&gt;
504 &lt;default&gt;&lt;family&gt;monospace&lt;/family&gt;&lt;/default&gt;
505 &lt;/alias&gt;
506
507 &lt;!--
508 Provide required aliases for standard names
509 Do these after the users configuration file so that
510 any aliases there are used preferentially
511 --&gt;
512 &lt;alias&gt;
513 &lt;family&gt;serif&lt;/family&gt;
514 &lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
515 &lt;/alias&gt;
516 &lt;alias&gt;
517 &lt;family&gt;sans&lt;/family&gt;
518 &lt;prefer&gt;&lt;family&gt;Verdana&lt;/family&gt;&lt;/prefer&gt;
519 &lt;/alias&gt;
520 &lt;alias&gt;
521 &lt;family&gt;monospace&lt;/family&gt;
522 &lt;prefer&gt;&lt;family&gt;Andale Mono&lt;/family&gt;&lt;/prefer&gt;
523 &lt;/alias&gt;
524 &lt;/fontconfig&gt;
525 </programlisting>
526 </refsect2>
527 <refsect2><title>User configuration file</title>
528 <para>
529 This is an example of a per-user configuration file that lives in
530 ~/.fonts.conf
531 </para>
532 <programlisting>
533 &lt;?xml version="1.0"?&gt;
534 &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
535 &lt;!-- ~/.fonts.conf for per-user font configuration --&gt;
536 &lt;fontconfig&gt;
537
538 &lt;!--
539 Private font directory
540 --&gt;
541 &lt;dir&gt;~/.fonts&lt;/dir&gt;
542
543 &lt;!--
544 use rgb sub-pixel ordering to improve glyph appearance on
545 LCD screens. Changes affecting rendering, but not matching
546 should always use target="font".
547 --&gt;
548 &lt;match target="font"&gt;
549 &lt;edit name="rgba" mode="assign"&gt;&lt;const&gt;rgb&lt;/const&gt;&lt;/edit&gt;
550 &lt;/match&gt;
551 &lt;/fontconfig&gt;
552 </programlisting>
553 </refsect2>
554 </refsect1>
555 <refsect1><title>Files</title>
556 <para>
557 <emphasis>fonts.conf</emphasis>
558 contains configuration information for the fontconfig library
559 consisting of directories to look at for font information as well as
560 instructions on editing program specified font patterns before attempting to
561 match the available fonts. It is in xml format.
562 </para>
563 <para>
564 <emphasis>fonts.dtd</emphasis>
565 is a DTD that describes the format of the configuration files.
566 </para>
567 <para>
568 <emphasis>~/.fonts.conf</emphasis>
569 is the conventional location for per-user font configuration, although the
570 actual location is specified in the global fonts.conf file.
571 </para>
572 <para>
573 <emphasis> ~/.fonts.cache-*</emphasis>
574 is the conventional repository of font information that isn't found in the
575 per-directory caches. This file is automatically maintained by fontconfig.
576 </para>
577 </refsect1>
578 <refsect1><title>Version</title>
579 <para>
580 Fontconfig version &version;
581 </para>
582 </refsect1>
583 </refentry>