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