]> git.wh0rd.org - fontconfig.git/blame - doc/fontconfig-user.sgml
Fix problem dating back at least to 2.3.2 where globs weren't being applied
[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
ced3f0a0 60FcConfigParse which walks over an XML tree and amends a configuration with
584ac89a
KP
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
ced3f0a0 90convenience for the applications' rendering mechanism.
584ac89a 91 </para>
22671e25
KP
92 <programlisting>
93 Property Type Description
94 --------------------------------------------------------------
4f27c1c0 95 family String Font family names
ced3f0a0 96 familylang String Languages corresponding to each family
22671e25 97 style String Font style. Overrides weight and slant
ced3f0a0 98 stylelang String Languages corresponding to each style
4f27c1c0 99 fullname String Font full names (often includes style)
ced3f0a0 100 fullnamelang String Languages corresponding 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>
ced3f0a0 288This element provides a place to consolidate 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
ced3f0a0
PL
327on filenaming conventions which can't be relied upon. Note that globs
328only apply to directories, not to individual fonts.
4f27c1c0
KP
329 </para></refsect2>
330 <refsect2><title><sgmltag>pattern</></title><para>
331Pattern elements perform list-style matching on incoming fonts; that is,
332they hold a list of elements and associated values. If all of those
333elements have a matching value, then the pattern matches the font. This can
334be used to select fonts based on attributes of the font (scalable, bold,
335etc), which is a more reliable mechanism than using file extensions.
336Pattern elements include patelt elements.
dbf68dd5 337 </para></refsect2>
4f27c1c0
KP
338 <refsect2><title><sgmltag>patelt name="property"</></title><para>
339Patelt elements hold a single pattern element and list of values. They must
340have a 'name' attribute which indicates the pattern element name. Patelt
341elements include int, double, string, matrix, bool, charset and const
342elements.
22671e25
KP
343 </para></refsect2>
344 <refsect2><title><sgmltag>match target="pattern"</></title><para>
345This element holds first a (possibly empty) list of <sgmltag>test</> elements and then
346a (possibly empty) list of <sgmltag>edit</> elements. Patterns which match all of the
584ac89a
KP
347tests are subjected to all the edits. If 'target' is set to "font" instead
348of the default "pattern", then this element applies to the font name
349resulting from a match rather than a font pattern to be matched.
22671e25 350 </para></refsect2>
0c009d2b
KP
351 <refsect2><title><sgmltag>test qual="any" name="property" target="default" compare="eq"</></title><para>
352This element contains a single value which is compared with the target
353('pattern', 'font' or 'default') property "property" (substitute any of the property names seen
584ac89a
KP
354above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", or
355"more_eq". 'qual' may either be the default, "any", in which case the match
356succeeds if any value associated with the property matches the test value, or
357"all", in which case all of the values associated with the property must
0c009d2b
KP
358match the test value. When used in a &lt;match target="font"&gt; element,
359the target= attribute in the &lt;test&gt; element selects between matching
360the original pattern or the font. "default" selects whichever target the
361outer &lt;match&gt; element has selected.
22671e25
KP
362 </para></refsect2>
363 <refsect2><title><sgmltag>edit name="property" mode="assign" binding="weak"</></title><para>
584ac89a
KP
364This element contains a list of expression elements (any of the value or
365operator elements). The expression elements are evaluated at run-time and
366modify the property "property". The modification depends on whether
22671e25 367"property" was matched by one of the associated <sgmltag>test</> elements, if so, the
584ac89a 368modification may affect the first matched value. Any values inserted into
0c009d2b
KP
369the property are given the indicated binding ("strong", "weak" or "same")
370with "same" binding using the value from the matched pattern element.
371'mode' is one of:
22671e25
KP
372 <programlisting>
373 Mode With Match Without Match
374 ---------------------------------------------------------------------
375 "assign" Replace matching value Replace all values
376 "assign_replace" Replace all values Replace all values
377 "prepend" Insert before matching Insert at head of list
378 "prepend_first" Insert at head of list Insert at head of list
379 "append" Append after matching Append at end of list
380 "append_last" Append at end of list Append at end of list
381 </programlisting>
382 </para></refsect2>
383 <refsect2><title><sgmltag>int</>, <sgmltag>double</>, <sgmltag>string</>, <sgmltag>bool</></title><para>
ddde1797
KP
384These elements hold a single value of the indicated type. <sgmltag>bool</>
385elements hold either true or false. An important limitation exists in
386the parsing of floating point numbers -- fontconfig requires that
387the mantissa start with a digit, not a decimal point, so insert a leading
388zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
389instead of -.5).
22671e25
KP
390 </para></refsect2>
391 <refsect2><title><sgmltag>matrix</></title><para>
392This element holds the four <sgmltag>double</> elements of an affine
584ac89a 393transformation.
22671e25
KP
394 </para></refsect2>
395 <refsect2><title><sgmltag>name</></title><para>
584ac89a
KP
396Holds a property name. Evaluates to the first value from the property of
397the font, not the pattern.
22671e25
KP
398 </para></refsect2>
399 <refsect2><title><sgmltag>const</></title><para>
584ac89a
KP
400Holds the name of a constant; these are always integers and serve as
401symbolic names for common font values:
22671e25
KP
402 <programlisting>
403 Constant Property Value
404 -------------------------------------
0c009d2b
KP
405 thin weight 0
406 extralight weight 40
407 ultralight weight 40
408 light weight 50
409 book weight 75
410 regular weight 80
411 normal weight 80
22671e25
KP
412 medium weight 100
413 demibold weight 180
0c009d2b 414 semibold weight 180
22671e25 415 bold weight 200
0c009d2b 416 extrabold weight 205
22671e25 417 black weight 210
0c009d2b 418 heavy weight 210
22671e25
KP
419 roman slant 0
420 italic slant 100
421 oblique slant 110
0c009d2b
KP
422 ultracondensed width 50
423 extracondensed width 63
424 condensed width 75
425 semicondensed width 87
426 normal width 100
427 semiexpanded width 113
428 expanded width 125
429 extraexpanded width 150
430 ultraexpanded width 200
22671e25 431 proportional spacing 0
a05d257f 432 dual spacing 90
22671e25
KP
433 mono spacing 100
434 charcell spacing 110
435 unknown rgba 0
436 rgb rgba 1
437 bgr rgba 2
438 vrgb rgba 3
439 vbgr rgba 4
440 none rgba 5
0c009d2b
KP
441 hintnone hintstyle 0
442 hintslight hintstyle 1
443 hintmedium hintstyle 2
444 hintfull hintstyle 3
22671e25 445 </programlisting>
22dc6fc6 446 </para>
22671e25
KP
447 </refsect2>
448 <refsect2>
449 <title><sgmltag>or</>, <sgmltag>and</>, <sgmltag>plus</>, <sgmltag>minus</>, <sgmltag>times</>, <sgmltag>divide</></title>
450 <para>
584ac89a 451These elements perform the specified operation on a list of expression
22671e25 452elements. <sgmltag>or</> and <sgmltag>and</> are boolean, not bitwise.
22dc6fc6 453 </para>
22671e25
KP
454 </refsect2>
455 <refsect2>
456 <title><sgmltag>eq</>, <sgmltag>not_eq</>, <sgmltag>less</>, <sgmltag>less_eq</>, <sgmltag>more</>, <sgmltag>more_eq</></title>
457 <para>
584ac89a 458These elements compare two values, producing a boolean result.
22671e25
KP
459 </para></refsect2>
460 <refsect2><title><sgmltag>not</></title><para>
584ac89a 461Inverts the boolean sense of its one expression element
22671e25
KP
462 </para></refsect2>
463 <refsect2><title><sgmltag>if</></title><para>
584ac89a
KP
464This element takes three expression elements; if the value of the first is
465true, it produces the value of the second, otherwise it produces the value
466of the third.
22671e25
KP
467 </para></refsect2>
468 <refsect2><title><sgmltag>alias</></title><para>
584ac89a
KP
469Alias elements provide a shorthand notation for the set of common match
470operations needed to substitute one font family for another. They contain a
22671e25
KP
471<sgmltag>family</> element followed by optional <sgmltag>prefer</>, <sgmltag>accept</> and <sgmltag>default</>
472elements. Fonts matching the <sgmltag>family</> element are edited to prepend the
473list of <sgmltag>prefer</>ed families before the matching <sgmltag>family</>, append the
ced3f0a0 474<sgmltag>accept</>able families after the matching <sgmltag>family</> and append the <sgmltag>default</>
584ac89a 475families to the end of the family list.
22671e25
KP
476 </para></refsect2>
477 <refsect2><title><sgmltag>family</></title><para>
584ac89a 478Holds a single font family name
22671e25
KP
479 </para></refsect2>
480 <refsect2><title><sgmltag>prefer</>, <sgmltag>accept</>, <sgmltag>default</></title><para>
481These hold a list of <sgmltag>family</> elements to be used by the <sgmltag>alias</> element.
482<sgmltag>/article</>
483 </para></refsect2>
484</refsect1>
485<refsect1><title>EXAMPLE CONFIGURATION FILE</title>
486 <refsect2><title>System configuration file</title>
584ac89a
KP
487 <para>
488This is an example of a system-wide configuration file
489 </para>
490 <programlisting>
491&lt;?xml version="1.0"?&gt;
492&lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
27de1f43 493&lt;!-- &confdir;/fonts.conf file to configure system font access --&gt;
584ac89a
KP
494&lt;fontconfig&gt;
495&lt;!--
496 Find fonts in these directories
497--&gt;
2d9c79c0
KP
498&lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
499&lt;dir&gt;/usr/X11R6/lib/X11/fonts&lt;/dir&gt;
584ac89a
KP
500
501&lt;!--
502 Accept deprecated 'mono' alias, replacing it with 'monospace'
503--&gt;
504&lt;match target="pattern"&gt;
505 &lt;test qual="any" name="family"&gt;&lt;string&gt;mono&lt;/string&gt;&lt;/test&gt;
506 &lt;edit name="family" mode="assign"&gt;&lt;string&gt;monospace&lt;/string&gt;&lt;/edit&gt;
507&lt;/match&gt;
508
509&lt;!--
510 Names not including any well known alias are given 'sans'
511--&gt;
512&lt;match target="pattern"&gt;
513 &lt;test qual="all" name="family" mode="not_eq"&gt;sans&lt;/test&gt;
514 &lt;test qual="all" name="family" mode="not_eq"&gt;serif&lt;/test&gt;
515 &lt;test qual="all" name="family" mode="not_eq"&gt;monospace&lt;/test&gt;
516 &lt;edit name="family" mode="append_last"&gt;&lt;string&gt;sans&lt;/string&gt;&lt;/edit&gt;
517&lt;/match&gt;
518
519&lt;!--
520 Load per-user customization file, but don't complain
521 if it doesn't exist
522--&gt;
523&lt;include ignore_missing="yes"&gt;~/.fonts.conf&lt;/include&gt;
524
0c009d2b
KP
525&lt;!--
526 Load local customization files, but don't complain
527 if there aren't any
528--&gt;
529&lt;include ignore_missing="yes"&gt;conf.d&lt;/include&gt;
530&lt;include ignore_missing="yes"&gt;local.conf&lt;/include&gt;
531
584ac89a
KP
532&lt;!--
533 Alias well known font names to available TrueType fonts.
534 These substitute TrueType faces for similar Type1
535 faces to improve screen appearance.
536--&gt;
537&lt;alias&gt;
538 &lt;family&gt;Times&lt;/family&gt;
539 &lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
540 &lt;default&gt;&lt;family&gt;serif&lt;/family&gt;&lt;/default&gt;
541&lt;/alias&gt;
542&lt;alias&gt;
543 &lt;family&gt;Helvetica&lt;/family&gt;
0c009d2b 544 &lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
584ac89a
KP
545 &lt;default&gt;&lt;family&gt;sans&lt;/family&gt;&lt;/default&gt;
546&lt;/alias&gt;
547&lt;alias&gt;
548 &lt;family&gt;Courier&lt;/family&gt;
549 &lt;prefer&gt;&lt;family&gt;Courier New&lt;/family&gt;&lt;/prefer&gt;
550 &lt;default&gt;&lt;family&gt;monospace&lt;/family&gt;&lt;/default&gt;
551&lt;/alias&gt;
552
553&lt;!--
554 Provide required aliases for standard names
555 Do these after the users configuration file so that
556 any aliases there are used preferentially
557--&gt;
558&lt;alias&gt;
559 &lt;family&gt;serif&lt;/family&gt;
560 &lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
561&lt;/alias&gt;
562&lt;alias&gt;
563 &lt;family&gt;sans&lt;/family&gt;
0c009d2b 564 &lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
584ac89a
KP
565&lt;/alias&gt;
566&lt;alias&gt;
567 &lt;family&gt;monospace&lt;/family&gt;
568 &lt;prefer&gt;&lt;family&gt;Andale Mono&lt;/family&gt;&lt;/prefer&gt;
569&lt;/alias&gt;
570&lt;/fontconfig&gt;
571 </programlisting>
22671e25
KP
572 </refsect2>
573 <refsect2><title>User configuration file</title>
584ac89a
KP
574 <para>
575This is an example of a per-user configuration file that lives in
576~/.fonts.conf
577 </para>
578 <programlisting>
579&lt;?xml version="1.0"?&gt;
580&lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
581&lt;!-- ~/.fonts.conf for per-user font configuration --&gt;
582&lt;fontconfig&gt;
583
584&lt;!--
585 Private font directory
586--&gt;
2d9c79c0 587&lt;dir&gt;~/.fonts&lt;/dir&gt;
584ac89a
KP
588
589&lt;!--
590 use rgb sub-pixel ordering to improve glyph appearance on
591 LCD screens. Changes affecting rendering, but not matching
592 should always use target="font".
593--&gt;
594&lt;match target="font"&gt;
595 &lt;edit name="rgba" mode="assign"&gt;&lt;const&gt;rgb&lt;/const&gt;&lt;/edit&gt;
596&lt;/match&gt;
597&lt;/fontconfig&gt;
598 </programlisting>
22671e25
KP
599 </refsect2>
600</refsect1>
ae2c2943 601<refsect1><title>Files</title>
584ac89a
KP
602 <para>
603<emphasis>fonts.conf</emphasis>
604contains configuration information for the fontconfig library
605consisting of directories to look at for font information as well as
606instructions on editing program specified font patterns before attempting to
607match the available fonts. It is in xml format.
608 </para>
609 <para>
0c009d2b
KP
610<emphasis>conf.d</emphasis>
611is the conventional name for a directory of additional configuration files
612managed by external applications or the local administrator. The
613filenames starting with decimal digits are sorted in lexicographic order
614and used as additional configuration files. All of these files are in xml
615format. The master fonts.conf file references this directory in an
616&lt;include&gt; directive.
617 </para>
618 <para>
584ac89a
KP
619<emphasis>fonts.dtd</emphasis>
620is a DTD that describes the format of the configuration files.
621 </para>
622 <para>
623<emphasis>~/.fonts.conf</emphasis>
624is the conventional location for per-user font configuration, although the
625actual location is specified in the global fonts.conf file.
626 </para>
627 <para>
628<emphasis> ~/.fonts.cache-*</emphasis>
629is the conventional repository of font information that isn't found in the
630per-directory caches. This file is automatically maintained by fontconfig.
631 </para>
22671e25 632</refsect1>
d8ae9c92
KP
633<refsect1><title>See Also</title>
634 <para>
635fc-cache(1), fc-match(1), fc-list(1)
636 </para>
637</refsect1>
ae2c2943
KP
638<refsect1><title>Version</title>
639 <para>
640Fontconfig version &version;
641 </para>
642</refsect1>
22671e25 643</refentry>