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