]> git.wh0rd.org - fontconfig.git/blame - doc/fontconfig-user.sgml
Merge with HEAD and finish the GCC 4 cleanups (no more warnings!)
[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
0c009d2b 41 &confdir;/conf.d
22671e25
KP
42 ~/.fonts.conf
43</synopsis>
44</refsynopsisdiv>
ae2c2943 45<refsect1><title>Description</title>
584ac89a
KP
46 <para>
47Fontconfig is a library designed to provide system-wide font configuration,
48customization and application access.
49 </para>
22671e25 50</refsect1>
ae2c2943 51<refsect1><title>Functional Overview</title>
584ac89a
KP
52 <para>
53Fontconfig contains two essential modules, the configuration module which
54builds an internal configuration from XML files and the matching module
55which accepts font patterns and returns the nearest matching font.
56 </para>
ae2c2943 57 <refsect2><title>Font Configuration</title>
584ac89a
KP
58 <para>
59The configuration module consists of the FcConfig datatype, libexpat and
60FcConfigParse which walks over an XML tree and ammends a configuration with
61data found within. From an external perspective, configuration of the
62library consists of generating a valid XML tree and feeding that to
63FcConfigParse. The only other mechanism provided to applications for
64changing the running configuration is to add fonts and directories to the
65list of application-provided font files.
66 </para><para>
67The intent is to make font configurations relatively static, and shared by
68as many applications as possible. It is hoped that this will lead to more
69stable font selection when passing names from one application to another.
70XML was chosen as a configuration file format because it provides a format
71which is easy for external agents to edit while retaining the correct
72structure and syntax.
73 </para><para>
74Font configuration is separate from font matching; applications needing to
75do their own matching can access the available fonts from the library and
76perform private matching. The intent is to permit applications to pick and
77choose appropriate functionality from the library instead of forcing them to
78choose between this library and a private configuration mechanism. The hope
79is that this will ensure that configuration of fonts for all applications
80can be centralized in one place. Centralizing font configuration will
81simplify and regularize font installation and customization.
82 </para>
22671e25
KP
83 </refsect2>
84 <refsect2>
ae2c2943 85 <title>Font Properties</title>
584ac89a
KP
86 <para>
87While font patterns may contain essentially any properties, there are some
88well known properties with associated types. Fontconfig uses some of these
89properties for font matching and font completion. Others are provided as a
90convenience for the applications rendering mechanism.
91 </para>
22671e25
KP
92 <programlisting>
93 Property Type Description
94 --------------------------------------------------------------
4f27c1c0
KP
95 family String Font family names
96 familylang String Languages cooresponding to each family
22671e25 97 style String Font style. Overrides weight and slant
4f27c1c0
KP
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
22671e25
KP
101 slant Int Italic, oblique or roman
102 weight Int Light, medium, demibold, bold or black
103 size Double Point size
0c009d2b 104 width Int Condensed, normal or expanded
22671e25
KP
105 aspect Double Stretches glyphs horizontally before hinting
106 pixelsize Double Pixel size
a05d257f 107 spacing Int Proportional, dual-width, monospace or charcell
22671e25
KP
108 foundry String Font foundry name
109 antialias Bool Whether glyphs can be antialiased
110 hinting Bool Whether the rasterizer should use hinting
0c009d2b 111 hintstyle Int Automatic hinting style
22671e25
KP
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
0c009d2b
KP
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
22671e25
KP
132 </programlisting>
133 </refsect2>
134 <refsect2>
ae2c2943 135 <title>Font Matching</title>
584ac89a
KP
136 <para>
137Fontconfig performs matching by measuring the distance from a provided
138pattern to all of the available fonts in the system. The closest matching
139font is selected. This ensures that a font will always be returned, but
140doesn't ensure that it is anything like the requested pattern.
141 </para><para>
142Font matching starts with an application constructed pattern. The desired
143attributes of the resulting font are collected together in a pattern. Each
144property of the pattern can contain one or more values; these are listed in
145priority order; matches earlier in the list are considered "closer" than
146matches later in the list.
147 </para><para>
148The initial pattern is modified by applying the list of editing instructions
149specific to patterns found in the configuration; each consists of a match
150predicate and a set of editing operations. They are executed in the order
151they appeared in the configuration. Each match causes the associated
152sequence of editing operations to be applied.
153 </para><para>
154After the pattern has been edited, a sequence of default substitutions are
155performed to canonicalize the set of available properties; this avoids the
156need for the lower layers to constantly provide default values for various
157font properties during rendering.
158 </para><para>
159The canonical font pattern is finally matched against all available fonts.
160The distance from the pattern to the font is measured for each of several
161properties: foundry, charset, family, lang, spacing, pixelsize, style,
162slant, weight, antialias, rasterizer and outline. This list is in priority
163order -- results of comparing earlier elements of this list weigh more
164heavily than later elements.
165 </para><para>
166There is one special case to this rule; family names are split into two
167bindings; strong and weak. Strong family names are given greater precedence
168in the match than lang elements while weak family names are given lower
169precedence than lang elements. This permits the document language to drive
170font selection when any document specified font is unavailable.
171 </para><para>
172The pattern representing that font is augmented to include any properties
173found in the pattern but not found in the font itself; this permits the
174application to pass rendering instructions or any other data through the
175matching system. Finally, the list of editing instructions specific to
176fonts found in the configuration are applied to the pattern. This modified
177pattern is returned to the application.
178 </para><para>
179The return value contains sufficient information to locate and rasterize the
180font, including the file name, pixel size and other rendering data. As
181none of the information involved pertains to the FreeType library,
182applications are free to use any rasterization engine or even to take
183the identified font file and access it directly.
184 </para><para>
185The match/edit sequences in the configuration are performed in two passes
186because there are essentially two different operations necessary -- the
187first is to modify how fonts are selected; aliasing families and adding
188suitable defaults. The second is to modify how the selected fonts are
189rasterized. Those must apply to the selected font, not the original pattern
190as false matches will often occur.
191 </para>
22671e25 192 </refsect2>
ae2c2943 193 <refsect2><title>Font Names</title>
584ac89a
KP
194 <para>
195Fontconfig provides a textual representation for patterns that the library
196can both accept and generate. The representation is in three parts, first a
197list of family names, second a list of point sizes and finally a list of
198additional 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>
204Values in a list are separated with commas. The name needn't include either
205families or point sizes; they can be elided. In addition, there are
206symbolic constants that simultaneously indicate both a name and a value.
207Here are some examples:
208 </para>
22671e25
KP
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>
ae2c2943 220<refsect1><title>Lang Tags</title>
584ac89a
KP
221 <para>
222Each font in the database contains a list of languages it supports. This is
223computed by comparing the Unicode coverage of the font with the orthography
224of each language. Languages are tagged using an RFC-3066 compatible naming
0c009d2b 225and occur in two parts -- the ISO 639 language tag followed a hyphen and then
584ac89a
KP
226by the ISO 3166 country code. The hyphen and country code may be elided.
227 </para><para>
228Fontconfig has orthographies for several languages built into the library.
229No provision has been made for adding new ones aside from rebuilding the
230library. It currently supports 122 of the 139 languages named in ISO 639-1,
231141 of the languages with two-letter codes from ISO 639-2 and another 30
0c009d2b
KP
232languages with only three-letter codes. Languages with both two and three
233letter codes are provided with only the two letter code.
234 </para><para>
235For languages used in multiple territories with radically different
236character sets, fontconfig includes per-territory orthographies. This
237includes Azerbaijani, Kurdish, Pashto, Tigrinya and Chinese.
584ac89a 238 </para>
22671e25 239</refsect1>
ae2c2943 240<refsect1><title>Configuration File Format</title>
584ac89a
KP
241 <para>
242Configuration files for fontconfig are stored in XML format; this
243format makes external configuration tools easier to write and ensures that
244they will generate syntactically correct configuration files. As XML
245files are plain text, they can also be manipulated by the expert user using
246a text editor.
247 </para><para>
248The fontconfig document type definition resides in the external entity
249"fonts.dtd"; this is normally stored in the default font configuration
27de1f43 250directory (&confdir;). Each configuration file should contain the
584ac89a
KP
251following 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>
22dc6fc6 259 </para>
22671e25 260<refsect2><title><literal>&lt;fontconfig&gt;</literal></title><para>
584ac89a 261This is the top level element for a font configuration and can contain
22671e25
KP
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>
584ac89a
KP
265This element contains a directory name which will be scanned for font files
266to include in the set of available fonts.
22671e25
KP
267 </para></refsect2>
268 <refsect2><title><sgmltag>cache</></title><para>
584ac89a
KP
269This element contains a file name for the per-user cache of font
270information. If it starts with '~', it refers to a file in the users
271home directory. This file is used to hold information about fonts that
272isn't present in the per-directory cache files. It is automatically
273maintained by the fontconfig library. The default for this file
22671e25 274is ``~/.fonts.cache-<sgmltag>version</>'', where <sgmltag>version</> is the font configuration
584ac89a 275file version number (currently 1).
22671e25
KP
276 </para></refsect2>
277 <refsect2><title><sgmltag>include ignore_missing="no"</></title><para>
2d9c79c0 278This element contains the name of an additional configuration file or
8245771d
PL
279directory. If a directory, every file within that directory starting with an
280ASCII digit (U+0030 - U+0039) and ending with the string ``.conf'' will be processed in sorted order. When
2d9c79c0
KP
281the XML datatype is traversed by FcConfigParse, the contents of the file(s)
282will also be incorporated into the configuration by passing the filename(s) to
584ac89a 283FcConfigLoadAndParse. If 'ignore_missing' is set to "yes" instead of the
2d9c79c0
KP
284default "no", a missing file or directory will elicit no warning message from
285the library.
22671e25
KP
286 </para></refsect2>
287 <refsect2><title><sgmltag>config</></title><para>
584ac89a 288This element provides a place to consolodate additional configuration
22671e25 289information. <sgmltag>config</> can contain <sgmltag>blank</> and <sgmltag>rescan</> elements in any
584ac89a 290order.
22671e25
KP
291 </para></refsect2>
292 <refsect2><title><sgmltag>blank</></title><para>
584ac89a 293Fonts often include "broken" glyphs which appear in the encoding but are
22671e25
KP
294drawn as blanks on the screen. Within the <sgmltag>blank</> element, place each
295Unicode characters which is supposed to be blank in an <sgmltag>int</> element.
584ac89a
KP
296Characters outside of this set which are drawn as blank will be elided from
297the set of characters supported by the font.
22671e25
KP
298 </para></refsect2>
299 <refsect2><title><sgmltag>rescan</></title><para>
300The <sgmltag>rescan</> element holds an <sgmltag>int</> element which indicates the default
584ac89a
KP
301interval between automatic checks for font configuration changes.
302Fontconfig will validate all of the configuration files and directories and
303automatically rebuild the internal datastructures when this interval passes.
4f27c1c0
KP
304 </para></refsect2>
305 <refsect2><title><sgmltag>selectfont</></title><para>
306This element is used to black/white list fonts from being listed or matched
307against. It holds acceptfont and rejectfont elements.
308 </para></refsect2>
309 <refsect2><title><sgmltag>acceptfont</></title><para>
310Fonts matched by an acceptfont element are "whitelisted"; such fonts are
311explicitly included in the set of fonts used to resolve list and match
312requests; including them in this list protects them from being "blacklisted"
313by a rejectfont element. Acceptfont elements include glob and pattern
314elements which are used to match fonts.
315 </para></refsect2>
316 <refsect2><title><sgmltag>rejectfont</></title><para>
317Fonts matched by an rejectfont element are "blacklisted"; such fonts are
318excluded from the set of fonts used to resolve list and match requests as if
319they didn't exist in the system. Rejectfont elements include glob and
320pattern elements which are used to match fonts.
321 </para></refsect2>
322 <refsect2><title><sgmltag>glob</></title><para>
323Glob elements hold shell-style filename matching patterns (including ? and
324*) which match fonts based on their complete pathnames. This can be used to
325exclude a set of directories (/usr/share/fonts/uglyfont*), or particular
326font file types (*.pcf.gz), but the latter mechanism relies rather heavily
327on filenaming conventions which can't be relied upon.
328 </para></refsect2>
329 <refsect2><title><sgmltag>pattern</></title><para>
330Pattern elements perform list-style matching on incoming fonts; that is,
331they hold a list of elements and associated values. If all of those
332elements have a matching value, then the pattern matches the font. This can
333be used to select fonts based on attributes of the font (scalable, bold,
334etc), which is a more reliable mechanism than using file extensions.
335Pattern elements include patelt elements.
dbf68dd5 336 </para></refsect2>
4f27c1c0
KP
337 <refsect2><title><sgmltag>patelt name="property"</></title><para>
338Patelt elements hold a single pattern element and list of values. They must
339have a 'name' attribute which indicates the pattern element name. Patelt
340elements include int, double, string, matrix, bool, charset and const
341elements.
22671e25
KP
342 </para></refsect2>
343 <refsect2><title><sgmltag>match target="pattern"</></title><para>
344This element holds first a (possibly empty) list of <sgmltag>test</> elements and then
345a (possibly empty) list of <sgmltag>edit</> elements. Patterns which match all of the
584ac89a
KP
346tests are subjected to all the edits. If 'target' is set to "font" instead
347of the default "pattern", then this element applies to the font name
348resulting from a match rather than a font pattern to be matched.
22671e25 349 </para></refsect2>
0c009d2b
KP
350 <refsect2><title><sgmltag>test qual="any" name="property" target="default" compare="eq"</></title><para>
351This 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
584ac89a
KP
353above). '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
355succeeds 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
0c009d2b
KP
357match the test value. When used in a &lt;match target="font"&gt; element,
358the target= attribute in the &lt;test&gt; element selects between matching
359the original pattern or the font. "default" selects whichever target the
360outer &lt;match&gt; element has selected.
22671e25
KP
361 </para></refsect2>
362 <refsect2><title><sgmltag>edit name="property" mode="assign" binding="weak"</></title><para>
584ac89a
KP
363This element contains a list of expression elements (any of the value or
364operator elements). The expression elements are evaluated at run-time and
365modify the property "property". The modification depends on whether
22671e25 366"property" was matched by one of the associated <sgmltag>test</> elements, if so, the
584ac89a 367modification may affect the first matched value. Any values inserted into
0c009d2b
KP
368the property are given the indicated binding ("strong", "weak" or "same")
369with "same" binding using the value from the matched pattern element.
370'mode' is one of:
22671e25
KP
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>
ddde1797
KP
383These elements hold a single value of the indicated type. <sgmltag>bool</>
384elements hold either true or false. An important limitation exists in
385the parsing of floating point numbers -- fontconfig requires that
386the mantissa start with a digit, not a decimal point, so insert a leading
387zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
388instead of -.5).
22671e25
KP
389 </para></refsect2>
390 <refsect2><title><sgmltag>matrix</></title><para>
391This element holds the four <sgmltag>double</> elements of an affine
584ac89a 392transformation.
22671e25
KP
393 </para></refsect2>
394 <refsect2><title><sgmltag>name</></title><para>
584ac89a
KP
395Holds a property name. Evaluates to the first value from the property of
396the font, not the pattern.
22671e25
KP
397 </para></refsect2>
398 <refsect2><title><sgmltag>const</></title><para>
584ac89a
KP
399Holds the name of a constant; these are always integers and serve as
400symbolic names for common font values:
22671e25
KP
401 <programlisting>
402 Constant Property Value
403 -------------------------------------
0c009d2b
KP
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
22671e25
KP
411 medium weight 100
412 demibold weight 180
0c009d2b 413 semibold weight 180
22671e25 414 bold weight 200
0c009d2b 415 extrabold weight 205
22671e25 416 black weight 210
0c009d2b 417 heavy weight 210
22671e25
KP
418 roman slant 0
419 italic slant 100
420 oblique slant 110
0c009d2b
KP
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
22671e25 430 proportional spacing 0
a05d257f 431 dual spacing 90
22671e25
KP
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
0c009d2b
KP
440 hintnone hintstyle 0
441 hintslight hintstyle 1
442 hintmedium hintstyle 2
443 hintfull hintstyle 3
22671e25 444 </programlisting>
22dc6fc6 445 </para>
22671e25
KP
446 </refsect2>
447 <refsect2>
448 <title><sgmltag>or</>, <sgmltag>and</>, <sgmltag>plus</>, <sgmltag>minus</>, <sgmltag>times</>, <sgmltag>divide</></title>
449 <para>
584ac89a 450These elements perform the specified operation on a list of expression
22671e25 451elements. <sgmltag>or</> and <sgmltag>and</> are boolean, not bitwise.
22dc6fc6 452 </para>
22671e25
KP
453 </refsect2>
454 <refsect2>
455 <title><sgmltag>eq</>, <sgmltag>not_eq</>, <sgmltag>less</>, <sgmltag>less_eq</>, <sgmltag>more</>, <sgmltag>more_eq</></title>
456 <para>
584ac89a 457These elements compare two values, producing a boolean result.
22671e25
KP
458 </para></refsect2>
459 <refsect2><title><sgmltag>not</></title><para>
584ac89a 460Inverts the boolean sense of its one expression element
22671e25
KP
461 </para></refsect2>
462 <refsect2><title><sgmltag>if</></title><para>
584ac89a
KP
463This element takes three expression elements; if the value of the first is
464true, it produces the value of the second, otherwise it produces the value
465of the third.
22671e25
KP
466 </para></refsect2>
467 <refsect2><title><sgmltag>alias</></title><para>
584ac89a
KP
468Alias elements provide a shorthand notation for the set of common match
469operations needed to substitute one font family for another. They contain a
22671e25
KP
470<sgmltag>family</> element followed by optional <sgmltag>prefer</>, <sgmltag>accept</> and <sgmltag>default</>
471elements. Fonts matching the <sgmltag>family</> element are edited to prepend the
472list 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</>
584ac89a 474families to the end of the family list.
22671e25
KP
475 </para></refsect2>
476 <refsect2><title><sgmltag>family</></title><para>
584ac89a 477Holds a single font family name
22671e25
KP
478 </para></refsect2>
479 <refsect2><title><sgmltag>prefer</>, <sgmltag>accept</>, <sgmltag>default</></title><para>
480These 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>
584ac89a
KP
486 <para>
487This 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;
27de1f43 492&lt;!-- &confdir;/fonts.conf file to configure system font access --&gt;
584ac89a
KP
493&lt;fontconfig&gt;
494&lt;!--
495 Find fonts in these directories
496--&gt;
2d9c79c0
KP
497&lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
498&lt;dir&gt;/usr/X11R6/lib/X11/fonts&lt;/dir&gt;
584ac89a
KP
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
0c009d2b
KP
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
584ac89a
KP
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;
0c009d2b 543 &lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
584ac89a
KP
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;
0c009d2b 563 &lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
584ac89a
KP
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>
22671e25
KP
571 </refsect2>
572 <refsect2><title>User configuration file</title>
584ac89a
KP
573 <para>
574This 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;
2d9c79c0 586&lt;dir&gt;~/.fonts&lt;/dir&gt;
584ac89a
KP
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>
22671e25
KP
598 </refsect2>
599</refsect1>
ae2c2943 600<refsect1><title>Files</title>
584ac89a
KP
601 <para>
602<emphasis>fonts.conf</emphasis>
603contains configuration information for the fontconfig library
604consisting of directories to look at for font information as well as
605instructions on editing program specified font patterns before attempting to
606match the available fonts. It is in xml format.
607 </para>
608 <para>
0c009d2b
KP
609<emphasis>conf.d</emphasis>
610is the conventional name for a directory of additional configuration files
611managed by external applications or the local administrator. The
612filenames starting with decimal digits are sorted in lexicographic order
613and used as additional configuration files. All of these files are in xml
614format. The master fonts.conf file references this directory in an
615&lt;include&gt; directive.
616 </para>
617 <para>
584ac89a
KP
618<emphasis>fonts.dtd</emphasis>
619is a DTD that describes the format of the configuration files.
620 </para>
621 <para>
622<emphasis>~/.fonts.conf</emphasis>
623is the conventional location for per-user font configuration, although the
624actual location is specified in the global fonts.conf file.
625 </para>
626 <para>
627<emphasis> ~/.fonts.cache-*</emphasis>
628is the conventional repository of font information that isn't found in the
629per-directory caches. This file is automatically maintained by fontconfig.
630 </para>
22671e25 631</refsect1>
d8ae9c92
KP
632<refsect1><title>See Also</title>
633 <para>
634fc-cache(1), fc-match(1), fc-list(1)
635 </para>
636</refsect1>
ae2c2943
KP
637<refsect1><title>Version</title>
638 <para>
639Fontconfig version &version;
640 </para>
641</refsect1>
22671e25 642</refentry>