Imported Upstream version 2.13.0
[platform/upstream/fontconfig.git] / doc / fonts-conf.5
1 .\" auto-generated by docbook2man-spec from docbook-utils package
2 .TH "FONTS-CONF" "5" "06 3月 2018" "" ""
3 .SH NAME
4 fonts.conf \- Font configuration files
5 .SH SYNOPSIS
6 .sp
7 .nf
8    /etc/fonts/fonts.conf
9    /etc/fonts/fonts.dtd
10    /etc/fonts/conf.d
11    $XDG_CONFIG_HOME/fontconfig/conf.d
12    $XDG_CONFIG_HOME/fontconfig/fonts.conf
13    ~/.fonts.conf.d
14    ~/.fonts.conf
15 .sp
16 .fi
17 .SH "DESCRIPTION"
18 .PP
19 Fontconfig is a library designed to provide system-wide font configuration,
20 customization and application access.
21 .SH "FUNCTIONAL OVERVIEW"
22 .PP
23 Fontconfig contains two essential modules, the configuration module which
24 builds an internal configuration from XML files and the matching module
25 which accepts font patterns and returns the nearest matching font.
26 .SS "FONT CONFIGURATION"
27 .PP
28 The configuration module consists of the FcConfig datatype, libexpat and
29 FcConfigParse which walks over an XML tree and amends a configuration with
30 data found within. From an external perspective, configuration of the
31 library consists of generating a valid XML tree and feeding that to
32 FcConfigParse. The only other mechanism provided to applications for
33 changing the running configuration is to add fonts and directories to the
34 list of application-provided font files. 
35 .PP
36 The intent is to make font configurations relatively static, and shared by
37 as many applications as possible. It is hoped that this will lead to more
38 stable font selection when passing names from one application to another.
39 XML was chosen as a configuration file format because it provides a format
40 which is easy for external agents to edit while retaining the correct
41 structure and syntax.
42 .PP
43 Font configuration is separate from font matching; applications needing to
44 do their own matching can access the available fonts from the library and
45 perform private matching. The intent is to permit applications to pick and
46 choose appropriate functionality from the library instead of forcing them to
47 choose between this library and a private configuration mechanism. The hope
48 is that this will ensure that configuration of fonts for all applications
49 can be centralized in one place. Centralizing font configuration will
50 simplify and regularize font installation and customization.
51 .SS "FONT PROPERTIES"
52 .PP
53 While font patterns may contain essentially any properties, there are some
54 well known properties with associated types. Fontconfig uses some of these
55 properties for font matching and font completion. Others are provided as a
56 convenience for the applications' rendering mechanism.
57 .sp
58 .nf
59   Property        Type    Description
60   --------------------------------------------------------------
61   family          String  Font family names
62   familylang      String  Languages corresponding to each family
63   style           String  Font style. Overrides weight and slant
64   stylelang       String  Languages corresponding to each style
65   fullname        String  Font full names (often includes style)
66   fullnamelang    String  Languages corresponding to each fullname
67   slant           Int     Italic, oblique or roman
68   weight          Int     Light, medium, demibold, bold or black
69   size            Double  Point size
70   width           Int     Condensed, normal or expanded
71   aspect          Double  Stretches glyphs horizontally before hinting
72   pixelsize       Double  Pixel size
73   spacing         Int     Proportional, dual-width, monospace or charcell
74   foundry         String  Font foundry name
75   antialias       Bool    Whether glyphs can be antialiased
76   hinting         Bool    Whether the rasterizer should use hinting
77   hintstyle       Int     Automatic hinting style
78   verticallayout  Bool    Use vertical layout
79   autohint        Bool    Use autohinter instead of normal hinter
80   globaladvance   Bool    Use font global advance data (deprecated)
81   file            String  The filename holding the font
82   index           Int     The index of the font within the file
83   ftface          FT_Face Use the specified FreeType face object
84   rasterizer      String  Which rasterizer is in use (deprecated)
85   outline         Bool    Whether the glyphs are outlines
86   scalable        Bool    Whether glyphs can be scaled
87   color           Bool    Whether any glyphs have color
88   scale           Double  Scale factor for point->pixel conversions (deprecated)
89   dpi             Double  Target dots per inch
90   rgba            Int     unknown, rgb, bgr, vrgb, vbgr,
91                           none - subpixel geometry
92   lcdfilter       Int     Type of LCD filter
93   minspace        Bool    Eliminate leading from line spacing
94   charset         CharSet Unicode chars encoded by the font
95   lang            String  List of RFC-3066-style languages this
96                           font supports
97   fontversion     Int     Version number of the font
98   capability      String  List of layout capabilities in the font
99   fontformat      String  String name of the font format
100   embolden        Bool    Rasterizer should synthetically embolden the font
101   embeddedbitmap  Bool    Use the embedded bitmap instead of the outline
102   decorative      Bool    Whether the style is a decorative variant
103   fontfeatures    String  List of the feature tags in OpenType to be enabled
104   namelang        String  Language name to be used for the default value of
105                           familylang, stylelang, and fullnamelang
106   prgname         String  String  Name of the running program
107   postscriptname  String  Font family name in PostScript
108     
109 .sp
110 .fi
111 .SS "FONT MATCHING"
112 .PP
113 Fontconfig performs matching by measuring the distance from a provided
114 pattern to all of the available fonts in the system. The closest matching
115 font is selected. This ensures that a font will always be returned, but
116 doesn't ensure that it is anything like the requested pattern.
117 .PP
118 Font matching starts with an application constructed pattern. The desired
119 attributes of the resulting font are collected together in a pattern. Each
120 property of the pattern can contain one or more values; these are listed in
121 priority order; matches earlier in the list are considered "closer" than
122 matches later in the list.
123 .PP
124 The initial pattern is modified by applying the list of editing instructions
125 specific to patterns found in the configuration; each consists of a match
126 predicate and a set of editing operations. They are executed in the order
127 they appeared in the configuration. Each match causes the associated
128 sequence of editing operations to be applied.
129 .PP
130 After the pattern has been edited, a sequence of default substitutions are
131 performed to canonicalize the set of available properties; this avoids the
132 need for the lower layers to constantly provide default values for various
133 font properties during rendering.
134 .PP
135 The canonical font pattern is finally matched against all available fonts.
136 The distance from the pattern to the font is measured for each of several
137 properties: foundry, charset, family, lang, spacing, pixelsize, style,
138 slant, weight, antialias, rasterizer and outline. This list is in priority
139 order -- results of comparing earlier elements of this list weigh more
140 heavily than later elements.
141 .PP
142 There is one special case to this rule; family names are split into two
143 bindings; strong and weak. Strong family names are given greater precedence
144 in the match than lang elements while weak family names are given lower
145 precedence than lang elements. This permits the document language to drive
146 font selection when any document specified font is unavailable.
147 .PP
148 The pattern representing that font is augmented to include any properties
149 found in the pattern but not found in the font itself; this permits the
150 application to pass rendering instructions or any other data through the
151 matching system. Finally, the list of editing instructions specific to
152 fonts found in the configuration are applied to the pattern. This modified
153 pattern is returned to the application.
154 .PP
155 The return value contains sufficient information to locate and rasterize the
156 font, including the file name, pixel size and other rendering data. As
157 none of the information involved pertains to the FreeType library,
158 applications are free to use any rasterization engine or even to take
159 the identified font file and access it directly.
160 .PP
161 The match/edit sequences in the configuration are performed in two passes
162 because there are essentially two different operations necessary -- the
163 first is to modify how fonts are selected; aliasing families and adding
164 suitable defaults. The second is to modify how the selected fonts are
165 rasterized. Those must apply to the selected font, not the original pattern
166 as false matches will often occur.
167 .SS "FONT NAMES"
168 .PP
169 Fontconfig provides a textual representation for patterns that the library
170 can both accept and generate. The representation is in three parts, first a
171 list of family names, second a list of point sizes and finally a list of
172 additional properties:
173 .sp
174 .nf
175         <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>\&...
176     
177 .sp
178 .fi
179 .PP
180 Values in a list are separated with commas. The name needn't include either
181 families or point sizes; they can be elided. In addition, there are
182 symbolic constants that simultaneously indicate both a name and a value.
183 Here are some examples:
184 .sp
185 .nf
186   Name                            Meaning
187   ----------------------------------------------------------
188   Times-12                        12 point Times Roman
189   Times-12:bold                   12 point Times Bold
190   Courier:italic                  Courier Italic in the default size
191   Monospace:matrix=1 .1 0 1       The users preferred monospace font
192                                   with artificial obliquing
193     
194 .sp
195 .fi
196 .PP
197 The '\\', '-', ':' and ',' characters in family names must be preceded by a
198 \&'\\' character to avoid having them misinterpreted. Similarly, values
199 containing '\\', '=', '_', ':' and ',' must also have them preceded by a
200 \&'\\' character. The '\\' characters are stripped out of the family name and
201 values as the font name is read.
202 .SH "DEBUGGING APPLICATIONS"
203 .PP
204 To help diagnose font and applications problems, fontconfig is built with a
205 large amount of internal debugging left enabled. It is controlled by means
206 of the FC_DEBUG environment variable. The value of this variable is
207 interpreted as a number, and each bit within that value controls different
208 debugging messages.
209 .sp
210 .nf
211   Name         Value    Meaning
212   ---------------------------------------------------------
213   MATCH            1    Brief information about font matching
214   MATCHV           2    Extensive font matching information
215   EDIT             4    Monitor match/test/edit execution
216   FONTSET          8    Track loading of font information at startup
217   CACHE           16    Watch cache files being written
218   CACHEV          32    Extensive cache file writing information
219   PARSE           64    (no longer in use)
220   SCAN           128    Watch font files being scanned to build caches
221   SCANV          256    Verbose font file scanning information
222   MEMORY         512    Monitor fontconfig memory usage
223   CONFIG        1024    Monitor which config files are loaded
224   LANGSET       2048    Dump char sets used to construct lang values
225   MATCH2        4096    Display font-matching transformation in patterns
226   
227 .sp
228 .fi
229 .PP
230 Add the value of the desired debug levels together and assign that (in
231 base 10) to the FC_DEBUG environment variable before running the
232 application. Output from these statements is sent to stdout.
233 .SH "LANG TAGS"
234 .PP
235 Each font in the database contains a list of languages it supports. This is
236 computed by comparing the Unicode coverage of the font with the orthography
237 of each language. Languages are tagged using an RFC-3066 compatible naming
238 and occur in two parts -- the ISO 639 language tag followed a hyphen and then
239 by the ISO 3166 country code. The hyphen and country code may be elided.
240 .PP
241 Fontconfig has orthographies for several languages built into the library.
242 No provision has been made for adding new ones aside from rebuilding the
243 library. It currently supports 122 of the 139 languages named in ISO 639-1,
244 141 of the languages with two-letter codes from ISO 639-2 and another 30
245 languages with only three-letter codes. Languages with both two and three
246 letter codes are provided with only the two letter code.
247 .PP
248 For languages used in multiple territories with radically different
249 character sets, fontconfig includes per-territory orthographies. This
250 includes Azerbaijani, Kurdish, Pashto, Tigrinya and Chinese.
251 .SH "CONFIGURATION FILE FORMAT"
252 .PP
253 Configuration files for fontconfig are stored in XML format; this
254 format makes external configuration tools easier to write and ensures that
255 they will generate syntactically correct configuration files. As XML
256 files are plain text, they can also be manipulated by the expert user using
257 a text editor.
258 .PP
259 The fontconfig document type definition resides in the external entity
260 "fonts.dtd"; this is normally stored in the default font configuration
261 directory (/etc/fonts). Each configuration file should contain the
262 following structure:
263 .sp
264 .nf
265         <?xml version="1.0"?>
266         <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
267         <fontconfig>
268 \&...
269         </fontconfig>
270     
271 .sp
272 .fi
273 .SS "<FONTCONFIG>"
274 .PP
275 This is the top level element for a font configuration and can contain
276 <dir>, <cachedir>, <include>, <match> and <alias> elements in any order.
277 .SS "<DIR PREFIX=""DEFAULT"">"
278 .PP
279 This element contains a directory name which will be scanned for font files
280 to include in the set of available fonts. If 'prefix' is set to "xdg", the value in the XDG_DATA_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
281 .SS "<CACHEDIR PREFIX=""DEFAULT"">"
282 .PP
283 This element contains a directory name that is supposed to be stored or read
284 the cache of font information. If multiple elements are specified in
285 the configuration file, the directory that can be accessed first in the list
286 will be used to store the cache files. If it starts with '~', it refers to
287 a directory in the users home directory. If 'prefix' is set to "xdg", the value in the XDG_CACHE_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
288 The default directory is ``$XDG_CACHE_HOME/fontconfig'' and it contains the cache files
289 named ``<hash value>-<architecture>\&.cache-<version>\&'',
290 where <version> is the fontconfig cache file
291 version number (currently 7).
292 .SS "<INCLUDE IGNORE_MISSING=""NO"" PREFIX=""DEFAULT"">"
293 .PP
294 This element contains the name of an additional configuration file or
295 directory. If a directory, every file within that directory starting with an
296 ASCII digit (U+0030 - U+0039) and ending with the string ``.conf'' will be processed in sorted order. When
297 the XML datatype is traversed by FcConfigParse, the contents of the file(s)
298 will also be incorporated into the configuration by passing the filename(s) to
299 FcConfigLoadAndParse. If 'ignore_missing' is set to "yes" instead of the
300 default "no", a missing file or directory will elicit no warning message from
301 the library. If 'prefix' is set to "xdg", the value in the XDG_CONFIG_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
302 .SS "<CONFIG>"
303 .PP
304 This element provides a place to consolidate additional configuration
305 information. <config> can contain <blank> and <rescan> elements in any
306 order.
307 .SS "<BLANK>"
308 .PP
309 Fonts often include "broken" glyphs which appear in the encoding but are
310 drawn as blanks on the screen. Within the <blank> element, place each
311 Unicode characters which is supposed to be blank in an <int> element.
312 Characters outside of this set which are drawn as blank will be elided from
313 the set of characters supported by the font.
314 .SS "<RESCAN>"
315 .PP
316 The <rescan> element holds an <int> element which indicates the default
317 interval between automatic checks for font configuration changes.
318 Fontconfig will validate all of the configuration files and directories and
319 automatically rebuild the internal datastructures when this interval passes.
320 .SS "<SELECTFONT>"
321 .PP
322 This element is used to black/white list fonts from being listed or matched
323 against. It holds acceptfont and rejectfont elements.
324 .SS "<ACCEPTFONT>"
325 .PP
326 Fonts matched by an acceptfont element are "whitelisted"; such fonts are
327 explicitly included in the set of fonts used to resolve list and match
328 requests; including them in this list protects them from being "blacklisted"
329 by a rejectfont element. Acceptfont elements include glob and pattern
330 elements which are used to match fonts.
331 .SS "<REJECTFONT>"
332 .PP
333 Fonts matched by an rejectfont element are "blacklisted"; such fonts are
334 excluded from the set of fonts used to resolve list and match requests as if
335 they didn't exist in the system. Rejectfont elements include glob and
336 pattern elements which are used to match fonts.
337 .SS "<GLOB>"
338 .PP
339 Glob elements hold shell-style filename matching patterns (including ? and
340 *) which match fonts based on their complete pathnames. This can be used to
341 exclude a set of directories (/usr/share/fonts/uglyfont*), or particular
342 font file types (*.pcf.gz), but the latter mechanism relies rather heavily
343 on filenaming conventions which can't be relied upon. Note that globs
344 only apply to directories, not to individual fonts.
345 .SS "<PATTERN>"
346 .PP
347 Pattern elements perform list-style matching on incoming fonts; that is,
348 they hold a list of elements and associated values. If all of those
349 elements have a matching value, then the pattern matches the font. This can
350 be used to select fonts based on attributes of the font (scalable, bold,
351 etc), which is a more reliable mechanism than using file extensions.
352 Pattern elements include patelt elements.
353 .SS "<PATELT NAME=""PROPERTY"">"
354 .PP
355 Patelt elements hold a single pattern element and list of values. They must
356 have a 'name' attribute which indicates the pattern element name. Patelt
357 elements include int, double, string, matrix, bool, charset and const
358 elements.
359 .SS "<MATCH TARGET=""PATTERN"">"
360 .PP
361 This element holds first a (possibly empty) list of <test> elements and then
362 a (possibly empty) list of <edit> elements. Patterns which match all of the
363 tests are subjected to all the edits. If 'target' is set to "font" instead
364 of the default "pattern", then this element applies to the font name
365 resulting from a match rather than a font pattern to be matched. If 'target'
366 is set to "scan", then this element applies when the font is scanned to
367 build the fontconfig database.
368 .SS "<TEST QUAL=""ANY"" NAME=""PROPERTY"" TARGET=""DEFAULT"" COMPARE=""EQ"">"
369 .PP
370 This element contains a single value which is compared with the target
371 ('pattern', 'font', 'scan' or 'default') property "property" (substitute any of the property names seen 
372 above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", "more_eq", "contains" or
373 "not_contains". 'qual' may either be the default, "any", in which case the match
374 succeeds if any value associated with the property matches the test value, or
375 "all", in which case all of the values associated with the property must
376 match the test value. 'ignore-blanks' takes a boolean value. if 'ignore-blanks' is set "true", any blanks in the string will be ignored on its comparison. this takes effects only when compare="eq" or compare="not_eq".
377 When used in a <match target="font"> element,
378 the target= attribute in the <test> element selects between matching
379 the original pattern or the font. "default" selects whichever target the
380 outer <match> element has selected.
381 .SS "<EDIT NAME=""PROPERTY"" MODE=""ASSIGN"" BINDING=""WEAK"">"
382 .PP
383 This element contains a list of expression elements (any of the value or
384 operator elements). The expression elements are evaluated at run-time and
385 modify the property "property". The modification depends on whether
386 "property" was matched by one of the associated <test> elements, if so, the
387 modification may affect the first matched value. Any values inserted into
388 the property are given the indicated binding ("strong", "weak" or "same")
389 with "same" binding using the value from the matched pattern element.
390 \&'mode' is one of:
391 .sp
392 .nf
393   Mode                    With Match              Without Match
394   ---------------------------------------------------------------------
395   "assign"                Replace matching value  Replace all values
396   "assign_replace"        Replace all values      Replace all values
397   "prepend"               Insert before matching  Insert at head of list
398   "prepend_first"         Insert at head of list  Insert at head of list
399   "append"                Append after matching   Append at end of list
400   "append_last"           Append at end of list   Append at end of list
401   "delete"                Delete matching value   Delete all values
402   "delete_all"            Delete all values       Delete all values
403     
404 .sp
405 .fi
406 .SS "<INT>, <DOUBLE>, <STRING>, <BOOL>"
407 .PP
408 These elements hold a single value of the indicated type. <bool>
409 elements hold either true or false. An important limitation exists in
410 the parsing of floating point numbers -- fontconfig requires that
411 the mantissa start with a digit, not a decimal point, so insert a leading
412 zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
413 instead of -.5).
414 .SS "<MATRIX>"
415 .PP
416 This element holds four numerical expressions of an affine transformation.
417 At their simplest these will be four <double> elements
418 but they can also be more involved expressions.
419 .SS "<RANGE>"
420 .PP
421 This element holds the two <int> elements of a range
422 representation.
423 .SS "<CHARSET>"
424 .PP
425 This element holds at least one <int> element of
426 an Unicode code point or more.
427 .SS "<LANGSET>"
428 .PP
429 This element holds at least one <string> element of
430 a RFC-3066-style languages or more.
431 .SS "<NAME>"
432 .PP
433 Holds a property name. Evaluates to the first value from the property of
434 the pattern. If the 'target' attribute is not present, it will default to
435 \&'default', in which case the property is returned from the font pattern
436 during a target="font" match, and to the pattern during a target="pattern"
437 match. The attribute can also take the values 'font' or 'pattern' to
438 explicitly choose which pattern to use. It is an error to use a target
439 of 'font' in a match that has target="pattern".
440 .SS "<CONST>"
441 .PP
442 Holds the name of a constant; these are always integers and serve as
443 symbolic names for common font values:
444 .sp
445 .nf
446   Constant        Property        Value
447   -------------------------------------
448   thin            weight          0
449   extralight      weight          40
450   ultralight      weight          40
451   light           weight          50
452   demilight       weight          55
453   semilight       weight          55
454   book            weight          75
455   regular         weight          80
456   normal          weight          80
457   medium          weight          100
458   demibold        weight          180
459   semibold        weight          180
460   bold            weight          200
461   extrabold       weight          205
462   black           weight          210
463   heavy           weight          210
464   roman           slant           0
465   italic          slant           100
466   oblique         slant           110
467   ultracondensed  width           50
468   extracondensed  width           63
469   condensed       width           75
470   semicondensed   width           87
471   normal          width           100
472   semiexpanded    width           113
473   expanded        width           125
474   extraexpanded   width           150
475   ultraexpanded   width           200
476   proportional    spacing         0
477   dual            spacing         90
478   mono            spacing         100
479   charcell        spacing         110
480   unknown         rgba            0
481   rgb             rgba            1
482   bgr             rgba            2
483   vrgb            rgba            3
484   vbgr            rgba            4
485   none            rgba            5
486   lcdnone         lcdfilter       0
487   lcddefault      lcdfilter       1
488   lcdlight        lcdfilter       2
489   lcdlegacy       lcdfilter       3
490   hintnone        hintstyle       0
491   hintslight      hintstyle       1
492   hintmedium      hintstyle       2
493   hintfull        hintstyle       3
494     
495 .sp
496 .fi
497 .SS "<OR>, <AND>, <PLUS>, <MINUS>, <TIMES>, <DIVIDE>"
498 .PP
499 These elements perform the specified operation on a list of expression
500 elements. <or> and <and> are boolean, not bitwise.
501 .SS "<EQ>, <NOT_EQ>, <LESS>, <LESS_EQ>, <MORE>, <MORE_EQ>, <CONTAINS>, <NOT_CONTAINS"
502 .PP
503 These elements compare two values, producing a boolean result.
504 .SS "<NOT>"
505 .PP
506 Inverts the boolean sense of its one expression element
507 .SS "<IF>"
508 .PP
509 This element takes three expression elements; if the value of the first is
510 true, it produces the value of the second, otherwise it produces the value
511 of the third.
512 .SS "<ALIAS>"
513 .PP
514 Alias elements provide a shorthand notation for the set of common match
515 operations needed to substitute one font family for another. They contain a
516 <family> element followed by optional <prefer>, <accept> and <default>
517 elements. Fonts matching the <family> element are edited to prepend the
518 list of <prefer>ed families before the matching <family>, append the
519 <accept>able families after the matching <family> and append the <default>
520 families to the end of the family list.
521 .SS "<FAMILY>"
522 .PP
523 Holds a single font family name
524 .SS "<PREFER>, <ACCEPT>, <DEFAULT>"
525 .PP
526 These hold a list of <family> elements to be used by the <alias> element.
527 .SH "EXAMPLE CONFIGURATION FILE"
528 .SS "SYSTEM CONFIGURATION FILE"
529 .PP
530 This is an example of a system-wide configuration file
531 .sp
532 .nf
533 <?xml version="1.0"?>
534 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
535 <!-- /etc/fonts/fonts.conf file to configure system font access -->
536 <fontconfig>
537 <!-- 
538         Find fonts in these directories
539 -->
540 <dir>/usr/share/fonts</dir>
541 <dir>/usr/X11R6/lib/X11/fonts</dir>
542
543 <!--
544         Accept deprecated 'mono' alias, replacing it with 'monospace'
545 -->
546 <match target="pattern">
547         <test qual="any" name="family"><string>mono</string></test>
548         <edit name="family" mode="assign"><string>monospace</string></edit>
549 </match>
550
551 <!--
552         Names not including any well known alias are given 'sans-serif'
553 -->
554 <match target="pattern">
555         <test qual="all" name="family" mode="not_eq"><string>sans-serif</string></test>
556         <test qual="all" name="family" mode="not_eq"><string>serif</string></test>
557         <test qual="all" name="family" mode="not_eq"><string>monospace</string></test>
558         <edit name="family" mode="append_last"><string>sans-serif</string></edit>
559 </match>
560
561 <!--
562         Load per-user customization file, but don't complain
563         if it doesn't exist
564 -->
565 <include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>
566
567 <!--
568         Load local customization files, but don't complain
569         if there aren't any
570 -->
571 <include ignore_missing="yes">conf.d</include>
572 <include ignore_missing="yes">local.conf</include>
573
574 <!--
575         Alias well known font names to available TrueType fonts.
576         These substitute TrueType faces for similar Type1
577         faces to improve screen appearance.
578 -->
579 <alias>
580         <family>Times</family>
581         <prefer><family>Times New Roman</family></prefer>
582         <default><family>serif</family></default>
583 </alias>
584 <alias>
585         <family>Helvetica</family>
586         <prefer><family>Arial</family></prefer>
587         <default><family>sans</family></default>
588 </alias>
589 <alias>
590         <family>Courier</family>
591         <prefer><family>Courier New</family></prefer>
592         <default><family>monospace</family></default>
593 </alias>
594
595 <!--
596         Provide required aliases for standard names
597         Do these after the users configuration file so that
598         any aliases there are used preferentially
599 -->
600 <alias>
601         <family>serif</family>
602         <prefer><family>Times New Roman</family></prefer>
603 </alias>
604 <alias>
605         <family>sans</family>
606         <prefer><family>Arial</family></prefer>
607 </alias>
608 <alias>
609         <family>monospace</family>
610         <prefer><family>Andale Mono</family></prefer>
611 </alias>
612
613 <--
614         The example of the requirements of OR operator;
615         If the 'family' contains 'Courier New' OR 'Courier'
616         add 'monospace' as the alternative
617 -->
618 <match target="pattern">
619         <test name="family" mode="eq">
620                 <string>Courier New</string>
621         </test>
622         <edit name="family" mode="prepend">
623                 <string>monospace</string>
624         </edit>
625 </match>
626 <match target="pattern">
627         <test name="family" mode="eq">
628                 <string>Courier</string>
629         </test>
630         <edit name="family" mode="prepend">
631                 <string>monospace</string>
632         </edit>
633 </match>
634
635 </fontconfig>
636     
637 .sp
638 .fi
639 .SS "USER CONFIGURATION FILE"
640 .PP
641 This is an example of a per-user configuration file that lives in
642 $XDG_CONFIG_HOME/fontconfig/fonts.conf
643 .sp
644 .nf
645 <?xml version="1.0"?>
646 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
647 <!-- $XDG_CONFIG_HOME/fontconfig/fonts.conf for per-user font configuration -->
648 <fontconfig>
649
650 <!--
651         Private font directory
652 -->
653 <dir prefix="xdg">fonts</dir>
654
655 <!--
656         use rgb sub-pixel ordering to improve glyph appearance on
657         LCD screens.  Changes affecting rendering, but not matching
658         should always use target="font".
659 -->
660 <match target="font">
661         <edit name="rgba" mode="assign"><const>rgb</const></edit>
662 </match>
663 <!--
664         use WenQuanYi Zen Hei font when serif is requested for Chinese
665 -->
666 <match>
667         <!--
668                 If you don't want to use WenQuanYi Zen Hei font for zh-tw etc,
669                 you can use zh-cn instead of zh.
670                 Please note, even if you set zh-cn, it still matches zh.
671                 if you don't like it, you can use compare="eq"
672                 instead of compare="contains".
673         -->
674         <test name="lang" compare="contains">
675                 <string>zh</string>
676         </test>
677         <test name="family">
678                 <string>serif</string>
679         </test>
680         <edit name="family" mode="prepend">
681                 <string>WenQuanYi Zen Hei</string>
682         </edit>
683 </match>
684 <!--
685         use VL Gothic font when sans-serif is requested for Japanese
686 -->
687 <match>
688         <test name="lang" compare="contains">
689                 <string>ja</string>
690         </test>
691         <test name="family">
692                 <string>sans-serif</string>
693         </test>
694         <edit name="family" mode="prepend">
695                 <string>VL Gothic</string>
696         </edit>
697 </match>
698 </fontconfig>
699     
700 .sp
701 .fi
702 .SH "FILES"
703 .PP
704 \fBfonts.conf\fR
705 contains configuration information for the fontconfig library
706 consisting of directories to look at for font information as well as
707 instructions on editing program specified font patterns before attempting to
708 match the available fonts. It is in XML format.
709 .PP
710 \fBconf.d\fR
711 is the conventional name for a directory of additional configuration files
712 managed by external applications or the local administrator. The
713 filenames starting with decimal digits are sorted in lexicographic order
714 and used as additional configuration files. All of these files are in XML
715 format. The master fonts.conf file references this directory in an 
716 <include> directive.
717 .PP
718 \fBfonts.dtd\fR
719 is a DTD that describes the format of the configuration files.
720 .PP
721 \fB$XDG_CONFIG_HOME/fontconfig/conf.d\fR and \fB~/.fonts.conf.d\fR
722 is the conventional name for a per-user directory of (typically
723 auto-generated) configuration files, although the
724 actual location is specified in the global fonts.conf file. please note that ~/.fonts.conf.d is deprecated now. it will not be read by default in the future version.
725 .PP
726 \fB$XDG_CONFIG_HOME/fontconfig/fonts.conf\fR and \fB~/.fonts.conf\fR
727 is the conventional location for per-user font configuration, although the
728 actual location is specified in the global fonts.conf file. please note that ~/.fonts.conf is deprecated now. it will not be read by default in the future version.
729 .PP
730 \fB$XDG_CACHE_HOME/fontconfig/*.cache-*\fR and \fB ~/.fontconfig/*.cache-*\fR
731 is the conventional repository of font information that isn't found in the
732 per-directory caches. This file is automatically maintained by fontconfig. please note that ~/.fontconfig/*.cache-* is deprecated now. it will not be read by default in the future version.
733 .SH "ENVIRONMENT VARIABLES"
734 .PP
735 \fBFONTCONFIG_FILE\fR
736 is used to override the default configuration file.
737 .PP
738 \fBFONTCONFIG_PATH\fR
739 is used to override the default configuration directory.
740 .PP
741 \fBFC_DEBUG\fR
742 is used to output the detailed debugging messages. see Debugging Applications section for more details.
743 .PP
744 \fBFC_DBG_MATCH_FILTER\fR
745 is used to filter out the patterns. this takes a comma-separated list of object names and effects only when FC_DEBUG has MATCH2. see Debugging Applications section for more details.
746 .PP
747 \fBFC_LANG\fR
748 is used to specify the default language as the weak binding in the query. if this isn't set, the default language will be determined from current locale.
749 .PP
750 \fBFONTCONFIG_USE_MMAP\fR
751 is used to control the use of mmap(2) for the cache files if available. this take a boolean value. fontconfig will checks if the cache files are stored on the filesystem that is safe to use mmap(2). explicitly setting this environment variable will causes skipping this check and enforce to use or not use mmap(2) anyway.
752 .SH "SEE ALSO"
753 .PP
754 fc-cat(1), fc-cache(1), fc-list(1), fc-match(1), fc-query(1)
755 .SH "VERSION"
756 .PP
757 Fontconfig version 2.13.0