]> git.wh0rd.org - fontconfig.git/blame - doc/fontconfig-user.sgml
Change files from ISO-Latin-1 to UTF-8
[fontconfig.git] / doc / fontconfig-user.sgml
CommitLineData
ae2c2943
KP
1<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
2<!ENTITY version SYSTEM "version.sgml">
27de1f43 3<!ENTITY confdir SYSTEM "confdir.sgml">
ae2c2943 4]>
584ac89a
KP
5<!--
6 $Id$
7
46b51147 8 Copyright © 2003 Keith Packard
584ac89a
KP
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-->
22671e25
KP
28<refentry>
29<refmeta>
b219ac6b 30 <refentrytitle>fonts-conf</refentrytitle>
22671e25
KP
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>
27de1f43
NL
39 &confdir;/fonts.conf
40 &confdir;/fonts.dtd
22671e25
KP
41 ~/.fonts.conf
42</synopsis>
43</refsynopsisdiv>
ae2c2943 44<refsect1><title>Description</title>
584ac89a
KP
45 <para>
46Fontconfig is a library designed to provide system-wide font configuration,
47customization and application access.
48 </para>
22671e25 49</refsect1>
ae2c2943 50<refsect1><title>Functional Overview</title>
584ac89a
KP
51 <para>
52Fontconfig contains two essential modules, the configuration module which
53builds an internal configuration from XML files and the matching module
54which accepts font patterns and returns the nearest matching font.
55 </para>
ae2c2943 56 <refsect2><title>Font Configuration</title>
584ac89a
KP
57 <para>
58The configuration module consists of the FcConfig datatype, libexpat and
59FcConfigParse which walks over an XML tree and ammends a configuration with
60data found within. From an external perspective, configuration of the
61library consists of generating a valid XML tree and feeding that to
62FcConfigParse. The only other mechanism provided to applications for
63changing the running configuration is to add fonts and directories to the
64list of application-provided font files.
65 </para><para>
66The intent is to make font configurations relatively static, and shared by
67as many applications as possible. It is hoped that this will lead to more
68stable font selection when passing names from one application to another.
69XML was chosen as a configuration file format because it provides a format
70which is easy for external agents to edit while retaining the correct
71structure and syntax.
72 </para><para>
73Font configuration is separate from font matching; applications needing to
74do their own matching can access the available fonts from the library and
75perform private matching. The intent is to permit applications to pick and
76choose appropriate functionality from the library instead of forcing them to
77choose between this library and a private configuration mechanism. The hope
78is that this will ensure that configuration of fonts for all applications
79can be centralized in one place. Centralizing font configuration will
80simplify and regularize font installation and customization.
81 </para>
22671e25
KP
82 </refsect2>
83 <refsect2>
ae2c2943 84 <title>Font Properties</title>
584ac89a
KP
85 <para>
86While font patterns may contain essentially any properties, there are some
87well known properties with associated types. Fontconfig uses some of these
88properties for font matching and font completion. Others are provided as a
89convenience for the applications rendering mechanism.
90 </para>
22671e25
KP
91 <programlisting>
92 Property Type Description
93 --------------------------------------------------------------
4f27c1c0
KP
94 family String Font family names
95 familylang String Languages cooresponding to each family
22671e25 96 style String Font style. Overrides weight and slant
4f27c1c0
KP
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
22671e25
KP
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
a05d257f 105 spacing Int Proportional, dual-width, monospace or charcell
22671e25
KP
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>
ae2c2943 129 <title>Font Matching</title>
584ac89a
KP
130 <para>
131Fontconfig performs matching by measuring the distance from a provided
132pattern to all of the available fonts in the system. The closest matching
133font is selected. This ensures that a font will always be returned, but
134doesn't ensure that it is anything like the requested pattern.
135 </para><para>
136Font matching starts with an application constructed pattern. The desired
137attributes of the resulting font are collected together in a pattern. Each
138property of the pattern can contain one or more values; these are listed in
139priority order; matches earlier in the list are considered "closer" than
140matches later in the list.
141 </para><para>
142The initial pattern is modified by applying the list of editing instructions
143specific to patterns found in the configuration; each consists of a match
144predicate and a set of editing operations. They are executed in the order
145they appeared in the configuration. Each match causes the associated
146sequence of editing operations to be applied.
147 </para><para>
148After the pattern has been edited, a sequence of default substitutions are
149performed to canonicalize the set of available properties; this avoids the
150need for the lower layers to constantly provide default values for various
151font properties during rendering.
152 </para><para>
153The canonical font pattern is finally matched against all available fonts.
154The distance from the pattern to the font is measured for each of several
155properties: foundry, charset, family, lang, spacing, pixelsize, style,
156slant, weight, antialias, rasterizer and outline. This list is in priority
157order -- results of comparing earlier elements of this list weigh more
158heavily than later elements.
159 </para><para>
160There is one special case to this rule; family names are split into two
161bindings; strong and weak. Strong family names are given greater precedence
162in the match than lang elements while weak family names are given lower
163precedence than lang elements. This permits the document language to drive
164font selection when any document specified font is unavailable.
165 </para><para>
166The pattern representing that font is augmented to include any properties
167found in the pattern but not found in the font itself; this permits the
168application to pass rendering instructions or any other data through the
169matching system. Finally, the list of editing instructions specific to
170fonts found in the configuration are applied to the pattern. This modified
171pattern is returned to the application.
172 </para><para>
173The return value contains sufficient information to locate and rasterize the
174font, including the file name, pixel size and other rendering data. As
175none of the information involved pertains to the FreeType library,
176applications are free to use any rasterization engine or even to take
177the identified font file and access it directly.
178 </para><para>
179The match/edit sequences in the configuration are performed in two passes
180because there are essentially two different operations necessary -- the
181first is to modify how fonts are selected; aliasing families and adding
182suitable defaults. The second is to modify how the selected fonts are
183rasterized. Those must apply to the selected font, not the original pattern
184as false matches will often occur.
185 </para>
22671e25 186 </refsect2>
ae2c2943 187 <refsect2><title>Font Names</title>
584ac89a
KP
188 <para>
189Fontconfig provides a textual representation for patterns that the library
190can both accept and generate. The representation is in three parts, first a
191list of family names, second a list of point sizes and finally a list of
192additional 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>
198Values in a list are separated with commas. The name needn't include either
199families or point sizes; they can be elided. In addition, there are
200symbolic constants that simultaneously indicate both a name and a value.
201Here are some examples:
202 </para>
22671e25
KP
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>
ae2c2943 214<refsect1><title>Lang Tags</title>
584ac89a
KP
215 <para>
216Each font in the database contains a list of languages it supports. This is
217computed by comparing the Unicode coverage of the font with the orthography
218of each language. Languages are tagged using an RFC-3066 compatible naming
219and occur in two parts -- the ISO639 language tag followed a hyphen and then
220by the ISO 3166 country code. The hyphen and country code may be elided.
221 </para><para>
222Fontconfig has orthographies for several languages built into the library.
223No provision has been made for adding new ones aside from rebuilding the
224library. It currently supports 122 of the 139 languages named in ISO 639-1,
225141 of the languages with two-letter codes from ISO 639-2 and another 30
226languages with only three-letter codes.
227 </para>
22671e25 228</refsect1>
ae2c2943 229<refsect1><title>Configuration File Format</title>
584ac89a
KP
230 <para>
231Configuration files for fontconfig are stored in XML format; this
232format makes external configuration tools easier to write and ensures that
233they will generate syntactically correct configuration files. As XML
234files are plain text, they can also be manipulated by the expert user using
235a text editor.
236 </para><para>
237The fontconfig document type definition resides in the external entity
238"fonts.dtd"; this is normally stored in the default font configuration
27de1f43 239directory (&confdir;). Each configuration file should contain the
584ac89a
KP
240following 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>
22dc6fc6 248 </para>
22671e25 249<refsect2><title><literal>&lt;fontconfig&gt;</literal></title><para>
584ac89a 250This is the top level element for a font configuration and can contain
22671e25
KP
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>
584ac89a
KP
254This element contains a directory name which will be scanned for font files
255to include in the set of available fonts.
22671e25
KP
256 </para></refsect2>
257 <refsect2><title><sgmltag>cache</></title><para>
584ac89a
KP
258This element contains a file name for the per-user cache of font
259information. If it starts with '~', it refers to a file in the users
260home directory. This file is used to hold information about fonts that
261isn't present in the per-directory cache files. It is automatically
262maintained by the fontconfig library. The default for this file
22671e25 263is ``~/.fonts.cache-<sgmltag>version</>'', where <sgmltag>version</> is the font configuration
584ac89a 264file version number (currently 1).
22671e25
KP
265 </para></refsect2>
266 <refsect2><title><sgmltag>include ignore_missing="no"</></title><para>
2d9c79c0
KP
267This element contains the name of an additional configuration file or
268directory. If a directory, every file within that directory starting with a
269number will be processed in sorted order. When
270the XML datatype is traversed by FcConfigParse, the contents of the file(s)
271will also be incorporated into the configuration by passing the filename(s) to
584ac89a 272FcConfigLoadAndParse. If 'ignore_missing' is set to "yes" instead of the
2d9c79c0
KP
273default "no", a missing file or directory will elicit no warning message from
274the library.
22671e25
KP
275 </para></refsect2>
276 <refsect2><title><sgmltag>config</></title><para>
584ac89a 277This element provides a place to consolodate additional configuration
22671e25 278information. <sgmltag>config</> can contain <sgmltag>blank</> and <sgmltag>rescan</> elements in any
584ac89a 279order.
22671e25
KP
280 </para></refsect2>
281 <refsect2><title><sgmltag>blank</></title><para>
584ac89a 282Fonts often include "broken" glyphs which appear in the encoding but are
22671e25
KP
283drawn as blanks on the screen. Within the <sgmltag>blank</> element, place each
284Unicode characters which is supposed to be blank in an <sgmltag>int</> element.
584ac89a
KP
285Characters outside of this set which are drawn as blank will be elided from
286the set of characters supported by the font.
22671e25
KP
287 </para></refsect2>
288 <refsect2><title><sgmltag>rescan</></title><para>
289The <sgmltag>rescan</> element holds an <sgmltag>int</> element which indicates the default
584ac89a
KP
290interval between automatic checks for font configuration changes.
291Fontconfig will validate all of the configuration files and directories and
292automatically rebuild the internal datastructures when this interval passes.
4f27c1c0
KP
293 </para></refsect2>
294 <refsect2><title><sgmltag>selectfont</></title><para>
295This element is used to black/white list fonts from being listed or matched
296against. It holds acceptfont and rejectfont elements.
297 </para></refsect2>
298 <refsect2><title><sgmltag>acceptfont</></title><para>
299Fonts matched by an acceptfont element are "whitelisted"; such fonts are
300explicitly included in the set of fonts used to resolve list and match
301requests; including them in this list protects them from being "blacklisted"
302by a rejectfont element. Acceptfont elements include glob and pattern
303elements which are used to match fonts.
304 </para></refsect2>
305 <refsect2><title><sgmltag>rejectfont</></title><para>
306Fonts matched by an rejectfont element are "blacklisted"; such fonts are
307excluded from the set of fonts used to resolve list and match requests as if
308they didn't exist in the system. Rejectfont elements include glob and
309pattern elements which are used to match fonts.
310 </para></refsect2>
311 <refsect2><title><sgmltag>glob</></title><para>
312Glob elements hold shell-style filename matching patterns (including ? and
313*) which match fonts based on their complete pathnames. This can be used to
314exclude a set of directories (/usr/share/fonts/uglyfont*), or particular
315font file types (*.pcf.gz), but the latter mechanism relies rather heavily
316on filenaming conventions which can't be relied upon.
317 </para></refsect2>
318 <refsect2><title><sgmltag>pattern</></title><para>
319Pattern elements perform list-style matching on incoming fonts; that is,
320they hold a list of elements and associated values. If all of those
321elements have a matching value, then the pattern matches the font. This can
322be used to select fonts based on attributes of the font (scalable, bold,
323etc), which is a more reliable mechanism than using file extensions.
324Pattern elements include patelt elements.
dbf68dd5 325 </para></refsect2>
4f27c1c0
KP
326 <refsect2><title><sgmltag>patelt name="property"</></title><para>
327Patelt elements hold a single pattern element and list of values. They must
328have a 'name' attribute which indicates the pattern element name. Patelt
329elements include int, double, string, matrix, bool, charset and const
330elements.
22671e25
KP
331 </para></refsect2>
332 <refsect2><title><sgmltag>match target="pattern"</></title><para>
333This element holds first a (possibly empty) list of <sgmltag>test</> elements and then
334a (possibly empty) list of <sgmltag>edit</> elements. Patterns which match all of the
584ac89a
KP
335tests are subjected to all the edits. If 'target' is set to "font" instead
336of the default "pattern", then this element applies to the font name
337resulting from a match rather than a font pattern to be matched.
22671e25
KP
338 </para></refsect2>
339 <refsect2><title><sgmltag>test qual="any" name="property" compare="eq"</></title><para>
584ac89a
KP
340This element contains a single value which is compared with the pattern
341property "property" (substitute any of the property names seen
342above). '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
344succeeds 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
346match the test value.
22671e25
KP
347 </para></refsect2>
348 <refsect2><title><sgmltag>edit name="property" mode="assign" binding="weak"</></title><para>
584ac89a
KP
349This element contains a list of expression elements (any of the value or
350operator elements). The expression elements are evaluated at run-time and
351modify the property "property". The modification depends on whether
22671e25 352"property" was matched by one of the associated <sgmltag>test</> elements, if so, the
584ac89a
KP
353modification may affect the first matched value. Any values inserted into
354the property are given the indicated binding. 'mode' is one of:
22671e25
KP
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>
ddde1797
KP
367These elements hold a single value of the indicated type. <sgmltag>bool</>
368elements hold either true or false. An important limitation exists in
369the parsing of floating point numbers -- fontconfig requires that
370the mantissa start with a digit, not a decimal point, so insert a leading
371zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
372instead of -.5).
22671e25
KP
373 </para></refsect2>
374 <refsect2><title><sgmltag>matrix</></title><para>
375This element holds the four <sgmltag>double</> elements of an affine
584ac89a 376transformation.
22671e25
KP
377 </para></refsect2>
378 <refsect2><title><sgmltag>name</></title><para>
584ac89a
KP
379Holds a property name. Evaluates to the first value from the property of
380the font, not the pattern.
22671e25
KP
381 </para></refsect2>
382 <refsect2><title><sgmltag>const</></title><para>
584ac89a
KP
383Holds the name of a constant; these are always integers and serve as
384symbolic names for common font values:
22671e25
KP
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
a05d257f 397 dual spacing 90
22671e25
KP
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>
22dc6fc6 407 </para>
22671e25
KP
408 </refsect2>
409 <refsect2>
410 <title><sgmltag>or</>, <sgmltag>and</>, <sgmltag>plus</>, <sgmltag>minus</>, <sgmltag>times</>, <sgmltag>divide</></title>
411 <para>
584ac89a 412These elements perform the specified operation on a list of expression
22671e25 413elements. <sgmltag>or</> and <sgmltag>and</> are boolean, not bitwise.
22dc6fc6 414 </para>
22671e25
KP
415 </refsect2>
416 <refsect2>
417 <title><sgmltag>eq</>, <sgmltag>not_eq</>, <sgmltag>less</>, <sgmltag>less_eq</>, <sgmltag>more</>, <sgmltag>more_eq</></title>
418 <para>
584ac89a 419These elements compare two values, producing a boolean result.
22671e25
KP
420 </para></refsect2>
421 <refsect2><title><sgmltag>not</></title><para>
584ac89a 422Inverts the boolean sense of its one expression element
22671e25
KP
423 </para></refsect2>
424 <refsect2><title><sgmltag>if</></title><para>
584ac89a
KP
425This element takes three expression elements; if the value of the first is
426true, it produces the value of the second, otherwise it produces the value
427of the third.
22671e25
KP
428 </para></refsect2>
429 <refsect2><title><sgmltag>alias</></title><para>
584ac89a
KP
430Alias elements provide a shorthand notation for the set of common match
431operations needed to substitute one font family for another. They contain a
22671e25
KP
432<sgmltag>family</> element followed by optional <sgmltag>prefer</>, <sgmltag>accept</> and <sgmltag>default</>
433elements. Fonts matching the <sgmltag>family</> element are edited to prepend the
434list 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</>
584ac89a 436families to the end of the family list.
22671e25
KP
437 </para></refsect2>
438 <refsect2><title><sgmltag>family</></title><para>
584ac89a 439Holds a single font family name
22671e25
KP
440 </para></refsect2>
441 <refsect2><title><sgmltag>prefer</>, <sgmltag>accept</>, <sgmltag>default</></title><para>
442These 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>
584ac89a
KP
448 <para>
449This 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;
27de1f43 454&lt;!-- &confdir;/fonts.conf file to configure system font access --&gt;
584ac89a
KP
455&lt;fontconfig&gt;
456&lt;!--
457 Find fonts in these directories
458--&gt;
2d9c79c0
KP
459&lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
460&lt;dir&gt;/usr/X11R6/lib/X11/fonts&lt;/dir&gt;
584ac89a
KP
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>
22671e25
KP
526 </refsect2>
527 <refsect2><title>User configuration file</title>
584ac89a
KP
528 <para>
529This 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;
2d9c79c0 541&lt;dir&gt;~/.fonts&lt;/dir&gt;
584ac89a
KP
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>
22671e25
KP
553 </refsect2>
554</refsect1>
ae2c2943 555<refsect1><title>Files</title>
584ac89a
KP
556 <para>
557<emphasis>fonts.conf</emphasis>
558contains configuration information for the fontconfig library
559consisting of directories to look at for font information as well as
560instructions on editing program specified font patterns before attempting to
561match the available fonts. It is in xml format.
562 </para>
563 <para>
564<emphasis>fonts.dtd</emphasis>
565is a DTD that describes the format of the configuration files.
566 </para>
567 <para>
568<emphasis>~/.fonts.conf</emphasis>
569is the conventional location for per-user font configuration, although the
570actual location is specified in the global fonts.conf file.
571 </para>
572 <para>
573<emphasis> ~/.fonts.cache-*</emphasis>
574is the conventional repository of font information that isn't found in the
575per-directory caches. This file is automatically maintained by fontconfig.
576 </para>
22671e25 577</refsect1>
ae2c2943
KP
578<refsect1><title>Version</title>
579 <para>
580Fontconfig version &version;
581 </para>
582</refsect1>
22671e25 583</refentry>