1FONTS-CONF(5)                                                    FONTS-CONF(5)
2
3
4

NAME

6       fonts.conf - Font configuration files
7

SYNOPSIS

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

DESCRIPTION

19       Fontconfig is a library designed to provide system-wide font configura‐
20       tion, customization and application access.
21

FUNCTIONAL OVERVIEW

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 li‐
46       brary and perform private matching. The intent is  to  permit  applica‐
47       tions to pick and choose appropriate functionality from the library in‐
48       stead of forcing them to choose between this library and a private con‐
49       figuration mechanism. The hope is that this will ensure that configura‐
50       tion of fonts for all applications can be  centralized  in  one  place.
51       Centralizing  font  configuration will simplify and regularize font in‐
52       stallation 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
90                               (deprecated)
91       dpi             Double  Target dots per inch
92       rgba            Int     unknown, rgb, bgr, vrgb, vbgr,
93                               none - subpixel geometry
94       lcdfilter       Int     Type of LCD filter
95       minspace        Bool    Eliminate leading from line spacing
96       charset         CharSet Unicode chars encoded by the font
97       lang            String  List of RFC-3066-style languages this
98                               font supports
99       fontversion     Int     Version number of the font
100       capability      String  List of layout capabilities in the font
101       fontformat      String  String name of the font format
102       embolden        Bool    Rasterizer should synthetically embolden the font
103       embeddedbitmap  Bool    Use the embedded bitmap instead of the outline
104       decorative      Bool    Whether the style is a decorative variant
105       fontfeatures    String  List of the feature tags in OpenType to be enabled
106       namelang        String  Language name to be used for the default value of
107                               familylang, stylelang, and fullnamelang
108       prgname         String  String  Name of the running program
109       postscriptname  String  Font family name in PostScript
110       fonthashint     Bool    Whether the font has hinting
111       order           Int     Order number of the font
112
113
114
115   FONT MATCHING
116       Fontconfig  performs matching by measuring the distance from a provided
117       pattern to all of the available fonts in the system. The closest match‐
118       ing font is selected. This ensures that a font will always be returned,
119       but doesn't ensure that it is anything like the requested pattern.
120
121       Font matching starts with an application constructed pattern.  The  de‐
122       sired attributes of the resulting font are collected together in a pat‐
123       tern. Each property of the pattern can  contain  one  or  more  values;
124       these  are  listed  in  priority order; matches earlier in the list are
125       considered "closer" than matches later in the list.
126
127       The initial pattern is modified by applying the  list  of  editing  in‐
128       structions  specific  to patterns found in the configuration; each con‐
129       sists of a match predicate and a set of editing  operations.  They  are
130       executed  in  the  order they appeared in the configuration. Each match
131       causes the associated sequence of editing operations to be applied.
132
133       After the pattern has been edited, a sequence of default  substitutions
134       are  performed  to  canonicalize  the set of available properties; this
135       avoids the need for the lower layers to constantly provide default val‐
136       ues for various font properties during rendering.
137
138       The  canonical  font  pattern  is finally matched against all available
139       fonts.  The distance from the pattern to the font is measured for  each
140       of  several properties: foundry, charset, family, lang, spacing, pixel‐
141       size, style, slant, weight, antialias,  rasterizer  and  outline.  This
142       list  is  in priority order -- results of comparing earlier elements of
143       this list weigh more heavily than later elements.
144
145       There is one special case to this rule; family names are split into two
146       bindings; strong and weak. Strong family names are given greater prece‐
147       dence in the match than lang elements while weak family names are given
148       lower precedence than lang elements. This permits the document language
149       to drive font selection when any document specified  font  is  unavail‐
150       able.
151
152       The  pattern representing that font is augmented to include any proper‐
153       ties found in the pattern but not found in the font itself;  this  per‐
154       mits  the  application to pass rendering instructions or any other data
155       through the matching system. Finally, the list of editing  instructions
156       specific  to  fonts  found in the configuration are applied to the pat‐
157       tern. This modified pattern is returned to the application.
158
159       The return value contains sufficient information to locate and  raster‐
160       ize  the  font, including the file name, pixel size and other rendering
161       data. As none of the information involved pertains to the FreeType  li‐
162       brary, applications are free to use any rasterization engine or even to
163       take the identified font file and access it directly.
164
165       The match/edit sequences in the  configuration  are  performed  in  two
166       passes because there are essentially two different operations necessary
167       -- the first is to modify how fonts are selected; aliasing families and
168       adding  suitable  defaults.  The  second  is to modify how the selected
169       fonts are rasterized. Those must apply to the selected  font,  not  the
170       original pattern as false matches will often occur.
171
172   FONT NAMES
173       Fontconfig  provides a textual representation for patterns that the li‐
174       brary can both accept and generate.  The  representation  is  in  three
175       parts,  first  a list of family names, second a list of point sizes and
176       finally a list of additional properties:
177
178       <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>...
179
180
181
182       Values in a list are separated with commas. The  name  needn't  include
183       either  families or point sizes; they can be elided. In addition, there
184       are symbolic constants that simultaneously indicate both a name  and  a
185       value.  Here are some examples:
186
187       Name                            Meaning
188       ----------------------------------------------------------
189       Times-12                        12 point Times Roman
190       Times-12:bold                   12 point Times Bold
191       Courier:italic                  Courier Italic in the default size
192       Monospace:matrix=1 .1 0 1       The users preferred monospace font
193                                       with artificial obliquing
194
195
196
197       The  '\',  '-', ':' and ',' characters in family names must be preceded
198       by a '\' character to avoid having them misinterpreted. Similarly, val‐
199       ues  containing '\', '=', '_', ':' and ',' must also have them preceded
200       by a '\' character. The '\' characters are stripped out of  the  family
201       name and values as the font name is read.
202

DEBUGGING APPLICATIONS

204       To  help  diagnose  font and applications problems, fontconfig is built
205       with a large amount of internal debugging  left  enabled.  It  is  con‐
206       trolled  by  means  of  the FC_DEBUG environment variable. The value of
207       this variable is interpreted as a number,  and  each  bit  within  that
208       value controls different debugging messages.
209
210       Name         Value    Meaning
211       ---------------------------------------------------------
212       MATCH            1    Brief information about font matching
213       MATCHV           2    Extensive font matching information
214       EDIT             4    Monitor match/test/edit execution
215       FONTSET          8    Track loading of font information at startup
216       CACHE           16    Watch cache files being written
217       CACHEV          32    Extensive cache file writing information
218       PARSE           64    (no longer in use)
219       SCAN           128    Watch font files being scanned to build caches
220       SCANV          256    Verbose font file scanning information
221       MEMORY         512    Monitor fontconfig memory usage
222       CONFIG        1024    Monitor which config files are loaded
223       LANGSET       2048    Dump char sets used to construct lang values
224       MATCH2        4096    Display font-matching transformation in patterns
225
226
227
228       Add  the value of the desired debug levels together and assign that (in
229       base 10) to the FC_DEBUG environment variable before running the appli‐
230       cation. Output from these statements is sent to stdout.
231

LANG TAGS

233       Each  font  in  the  database contains a list of languages it supports.
234       This is computed by comparing the Unicode coverage of the font with the
235       orthography  of  each  language. Languages are tagged using an RFC-3066
236       compatible naming and occur in two parts -- the ISO  639  language  tag
237       followed a hyphen and then by the ISO 3166 country code. The hyphen and
238       country code may be elided.
239
240       Fontconfig has orthographies for several languages built into  the  li‐
241       brary.   No  provision has been made for adding new ones aside from re‐
242       building the library. It currently supports 122 of  the  139  languages
243       named in ISO 639-1, 141 of the languages with two-letter codes from ISO
244       639-2 and another 30 languages with only three-letter codes.  Languages
245       with  both  two  and  three letter codes are provided with only the two
246       letter code.
247
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

CONFIGURATION FILE FORMAT

253       Configuration files for fontconfig are stored in XML format; this  for‐
254       mat 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
257       using a text editor.
258
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 fol‐
262       lowing structure:
263
264       <?xml version="1.0"?>
265       <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
266       <fontconfig>
267       ...
268       </fontconfig>
269
270
271
272   <FONTCONFIG>
273       This  is the top level element for a font configuration and can contain
274       <dir>, <cachedir>, <include>, <match> and <alias> elements in  any  or‐
275       der.
276
277   <DIR PREFIX="DEFAULT" SALT="">
278       This  element  contains a directory name which will be scanned for font
279       files to include in the set of available fonts.
280
281       If 'prefix' is set to "default" or "cwd", the current working directory
282       will be added as the path prefix prior to the value. If 'prefix' is set
283       to "xdg", the value in the XDG_DATA_HOME environment variable  will  be
284       added  as  the path prefix. please see XDG Base Directory Specification
285       for more details. If 'prefix' is set to "relative", the path of current
286       file will be added prior to the value.
287
288       'salt' property affects to determine cache filename. this is useful for
289       example when having different fonts sets on same path at container  and
290       share fonts from host on different font path.
291
292   <CACHEDIR PREFIX="DEFAULT">
293       This element contains a directory name that is supposed to be stored or
294       read the cache of font information. If multiple elements are  specified
295       in  the configuration file, the directory that can be accessed first in
296       the list will be used to store the cache files. If it starts with  '~',
297       it  refers  to  a directory in the users home directory. If 'prefix' is
298       set to "xdg", the value in the XDG_CACHE_HOME environment variable will
299       be  added  as the path prefix. please see XDG Base Directory Specifica‐
300       tion    for    more    details.     The    default     directory     is
301       ``$XDG_CACHE_HOME/fontconfig''  and  it  contains the cache files named
302       ``<hash value>-<architecture>.cache-<version>'', where <version> is the
303       fontconfig cache file version number (currently 8).
304
305   <INCLUDE IGNORE_MISSING="NO" PREFIX="DEFAULT">
306       This  element  contains the name of an additional configuration file or
307       directory. If a directory, every file within  that  directory  starting
308       with  an  ASCII  digit  (U+0030  -  U+0039)  and ending with the string
309       ``.conf'' will be processed in sorted order. When the XML  datatype  is
310       traversed  by  FcConfigParse,  the contents of the file(s) will also be
311       incorporated into the configuration by passing the filename(s)  to  Fc‐
312       ConfigLoadAndParse.  If 'ignore_missing' is set to "yes" instead of the
313       default "no", a missing file or directory will elicit no  warning  mes‐
314       sage  from  the  library. If 'prefix' is set to "xdg", the value in the
315       XDG_CONFIG_HOME environment variable will be added as the path  prefix.
316       please see XDG Base Directory Specification for more details.
317
318   <CONFIG>
319       This  element  provides a place to consolidate additional configuration
320       information. <config> can contain <blank> and <rescan> elements in  any
321       order.
322
323   <DESCRIPTION DOMAIN="FONTCONFIG-CONF">
324       This  element  is supposed to hold strings which describe what a config
325       is used for.  This string can be translated through  gettext.  'domain'
326       needs  to  be set the proper name to apply then.  fontconfig will tries
327       to retrieve translations with 'domain' from gettext.
328
329   <BLANK>
330       Fonts often include "broken" glyphs which appear in  the  encoding  but
331       are  drawn  as  blanks on the screen. Within the <blank> element, place
332       each Unicode characters which is supposed to be blank in an <int>  ele‐
333       ment.   Characters outside of this set which are drawn as blank will be
334       elided from the set of characters supported by the font.
335
336   <REMAP-DIR PREFIX="DEFAULT" AS-PATH="" SALT="">
337       This element contains a directory name where will be mapped as the path
338       'as-path'  in cached information.  This is useful if the directory name
339       is an alias (via a bind mount or symlink) to another directory  in  the
340       system for which cached font information is likely to exist.
341
342       'salt'  property  affects  to determine cache filename as same as <dir>
343       element.
344
345   <RESET-DIRS />
346       This element removes all of fonts directories where added by <dir> ele‐
347       ments.  This is useful to override fonts directories from system to own
348       fonts directories only.
349
350   <RESCAN>
351       The <rescan> element holds an <int> element which indicates the default
352       interval  between  automatic  checks  for  font  configuration changes.
353       Fontconfig will validate all of the configuration files and directories
354       and  automatically rebuild the internal datastructures when this inter‐
355       val passes.
356
357   <SELECTFONT>
358       This element is used to black/white list fonts  from  being  listed  or
359       matched against. It holds acceptfont and rejectfont elements.
360
361   <ACCEPTFONT>
362       Fonts  matched  by  an acceptfont element are "whitelisted"; such fonts
363       are explicitly included in the set of fonts used to  resolve  list  and
364       match  requests;  including  them in this list protects them from being
365       "blacklisted" by a rejectfont element. Acceptfont elements include glob
366       and pattern elements which are used to match fonts.
367
368   <REJECTFONT>
369       Fonts  matched  by  an rejectfont element are "blacklisted"; such fonts
370       are excluded from the set of fonts used to resolve list and  match  re‐
371       quests  as  if they didn't exist in the system. Rejectfont elements in‐
372       clude glob and pattern elements which are used to match fonts.
373
374   <GLOB>
375       Glob elements hold shell-style filename matching patterns (including  ?
376       and  *)  which  match  fonts  based  on their complete pathnames. If it
377       starts with '~', it refers to a directory in the users home  directory.
378       This  can be used to exclude a set of directories (/usr/share/fonts/ug‐
379       lyfont*), or particular font file  types  (*.pcf.gz),  but  the  latter
380       mechanism  relies  rather heavily on filenaming conventions which can't
381       be relied upon. Note that globs only apply to directories, not to indi‐
382       vidual fonts.
383
384   <PATTERN>
385       Pattern  elements  perform  list-style matching on incoming fonts; that
386       is, they hold a list of elements and associated values. If all of those
387       elements have a matching value, then the pattern matches the font. This
388       can be used to select fonts based on attributes of the font  (scalable,
389       bold,  etc),  which is a more reliable mechanism than using file exten‐
390       sions.  Pattern elements include patelt elements.
391
392   <PATELT NAME="PROPERTY">
393       Patelt elements hold a single pattern element and list of values.  They
394       must  have a 'name' attribute which indicates the pattern element name.
395       Patelt elements include int, double, string, matrix, bool, charset  and
396       const elements.
397
398   <MATCH TARGET="PATTERN">
399       This element holds first a (possibly empty) list of <test> elements and
400       then a (possibly empty) list of <edit> elements. Patterns  which  match
401       all  of the tests are subjected to all the edits. If 'target' is set to
402       "font" instead of the default "pattern", then this element  applies  to
403       the  font  name resulting from a match rather than a font pattern to be
404       matched. If 'target' is set to "scan", then this element  applies  when
405       the font is scanned to build the fontconfig database.
406
407   <TEST QUAL="ANY" NAME="PROPERTY" TARGET="DEFAULT" COMPARE="EQ">
408       This  element contains a single value which is compared with the target
409       ('pattern', 'font', 'scan' or 'default') property  "property"  (substi‐
410       tute  any  of  the  property names seen above). 'compare' can be one of
411       "eq", "not_eq", "less", "less_eq",  "more",  "more_eq",  "contains"  or
412       "not_contains".  'qual' may either be the default, "any", in which case
413       the match succeeds if any value associated with  the  property  matches
414       the  test  value,  or "all", in which case all of the values associated
415       with the property must match the test value.  'ignore-blanks'  takes  a
416       boolean  value.  if  'ignore-blanks'  is  set "true", any blanks in the
417       string will be ignored on its comparison. this takes effects only  when
418       compare="eq" or compare="not_eq".  When used in a <match target="font">
419       element, the target= attribute in the <test>  element  selects  between
420       matching  the original pattern or the font. "default" selects whichever
421       target the outer <match> element has selected.
422
423   <EDIT NAME="PROPERTY" MODE="ASSIGN" BINDING="WEAK">
424       This element contains a list of expression elements (any of  the  value
425       or  operator  elements).  The expression elements are evaluated at run-
426       time and modify the property "property". The  modification  depends  on
427       whether  "property"  was  matched  by one of the associated <test> ele‐
428       ments, if so, the modification may affect the first matched value.  Any
429       values  inserted  into  the  property  are  given the indicated binding
430       ("strong", "weak" or "same") with "same" binding using the  value  from
431       the matched pattern element.  'mode' is one of:
432
433       Mode                    With Match              Without Match
434       ---------------------------------------------------------------------
435       "assign"                Replace matching value  Replace all values
436       "assign_replace"        Replace all values      Replace all values
437       "prepend"               Insert before matching  Insert at head of list
438       "prepend_first"         Insert at head of list  Insert at head of list
439       "append"                Append after matching   Append at end of list
440       "append_last"           Append at end of list   Append at end of list
441       "delete"                Delete matching value   Delete all values
442       "delete_all"            Delete all values       Delete all values
443
444
445
446   <INT>, <DOUBLE>, <STRING>, <BOOL>
447       These  elements  hold a single value of the indicated type. <bool> ele‐
448       ments hold either true or false. An important limitation exists in  the
449       parsing  of floating point numbers -- fontconfig requires that the man‐
450       tissa start with a digit, not a decimal point, so insert a leading zero
451       for  purely  fractional values (e.g. use 0.5 instead of .5 and -0.5 in‐
452       stead of -.5).
453
454   <MATRIX>
455       This element holds four numerical expressions of an affine  transforma‐
456       tion.   At their simplest these will be four <double> elements but they
457       can also be more involved expressions.
458
459   <RANGE>
460       This element holds the two <int> elements of a range representation.
461
462   <CHARSET>
463       This element holds at least one <int> element of an Unicode code  point
464       or more.
465
466   <LANGSET>
467       This  element  holds  at least one <string> element of a RFC-3066-style
468       languages or more.
469
470   <NAME>
471       Holds a property name. Evaluates to the first value from  the  property
472       of  the  pattern. If the 'target' attribute is not present, it will de‐
473       fault to 'default', in which case the property  is  returned  from  the
474       font  pattern during a target="font" match, and to the pattern during a
475       target="pattern" match. The attribute can also take the  values  'font'
476       or  'pattern' to explicitly choose which pattern to use. It is an error
477       to use a target of 'font' in a match that has target="pattern".
478
479   <CONST>
480       Holds the name of a constant; these are always integers  and  serve  as
481       symbolic names for common font values:
482
483       Constant        Property        Value
484       -------------------------------------
485       thin            weight          0
486       extralight      weight          40
487       ultralight      weight          40
488       light           weight          50
489       demilight       weight          55
490       semilight       weight          55
491       book            weight          75
492       regular         weight          80
493       normal          weight          80
494       medium          weight          100
495       demibold        weight          180
496       semibold        weight          180
497       bold            weight          200
498       extrabold       weight          205
499       ultrabold       weight          205
500       black           weight          210
501       heavy           weight          210
502       extrablack      weight          215
503       ultrablack      weight          215
504       roman           slant           0
505       italic          slant           100
506       oblique         slant           110
507       ultracondensed  width           50
508       extracondensed  width           63
509       condensed       width           75
510       semicondensed   width           87
511       normal          width           100
512       semiexpanded    width           113
513       expanded        width           125
514       extraexpanded   width           150
515       ultraexpanded   width           200
516       proportional    spacing         0
517       dual            spacing         90
518       mono            spacing         100
519       charcell        spacing         110
520       unknown         rgba            0
521       rgb             rgba            1
522       bgr             rgba            2
523       vrgb            rgba            3
524       vbgr            rgba            4
525       none            rgba            5
526       lcdnone         lcdfilter       0
527       lcddefault      lcdfilter       1
528       lcdlight        lcdfilter       2
529       lcdlegacy       lcdfilter       3
530       hintnone        hintstyle       0
531       hintslight      hintstyle       1
532       hintmedium      hintstyle       2
533       hintfull        hintstyle       3
534
535
536
537   <OR>, <AND>, <PLUS>, <MINUS>, <TIMES>, <DIVIDE>
538       These  elements perform the specified operation on a list of expression
539       elements. <or> and <and> are boolean, not bitwise.
540
541   <EQ>, <NOT_EQ>, <LESS>, <LESS_EQ>, <MORE>, <MORE_EQ>, <CONTAINS>, <NOT_CON‐
542       TAINS
543       These elements compare two values, producing a boolean result.
544
545   <NOT>
546       Inverts the boolean sense of its one expression element
547
548   <IF>
549       This element takes three expression elements; if the value of the first
550       is true, it produces the value of the second, otherwise it produces the
551       value of the third.
552
553   <ALIAS>
554       Alias elements provide a shorthand notation for the set of common match
555       operations needed to substitute one font family for another. They  con‐
556       tain  a  <family>  element  followed by optional <prefer>, <accept> and
557       <default> elements. Fonts matching the <family> element are  edited  to
558       prepend  the  list of <prefer>ed families before the matching <family>,
559       append the <accept>able families after the matching <family> and append
560       the <default> families to the end of the family list.
561
562   <FAMILY>
563       Holds a single font family name
564
565   <PREFER>, <ACCEPT>, <DEFAULT>
566       These  hold  a list of <family> elements to be used by the <alias> ele‐
567       ment.
568

EXAMPLE CONFIGURATION FILE

570   SYSTEM CONFIGURATION FILE
571       This is an example of a system-wide configuration file
572
573       <?xml version="1.0"?>
574       <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
575       <!-- /etc/fonts/fonts.conf file to configure system font access -->
576       <fontconfig>
577         <!--
578           Find fonts in these directories
579         -->
580         <dir>/usr/share/fonts</dir>
581         <dir>/usr/X11R6/lib/X11/fonts</dir>
582
583         <!--
584           Accept deprecated 'mono' alias, replacing it with 'monospace'
585         -->
586         <match target="pattern">
587           <test qual="any" name="family">
588             <string>mono</string>
589           </test>
590           <edit name="family" mode="assign">
591             <string>monospace</string>
592           </edit>
593         </match>
594
595         <!--
596           Names not including any well known alias are given 'sans-serif'
597         -->
598         <match target="pattern">
599           <test qual="all" name="family" compare="not_eq">
600             <string>sans-serif</string>
601           </test>
602           <test qual="all" name="family" compare="not_eq">
603             <string>serif</string>
604           </test>
605           <test qual="all" name="family" compare="not_eq">
606             <string>monospace</string>
607           </test>
608           <edit name="family" mode="append_last">
609             <string>sans-serif</string>
610           </edit>
611         </match>
612
613         <!--
614           Load per-user customization file, but don't complain
615           if it doesn't exist
616         -->
617         <include ignore_missing="yes" prefix="xdg">
618           fontconfig/fonts.conf
619         </include>
620
621         <!--
622           Load local customization files, but don't complain
623           if there aren't any
624         -->
625         <include ignore_missing="yes">conf.d</include>
626         <include ignore_missing="yes">local.conf</include>
627
628         <!--
629           Alias well known font names to available TrueType fonts.
630           These substitute TrueType faces for similar Type1
631           faces to improve screen appearance.
632         -->
633         <alias>
634           <family>Times</family>
635           <prefer>
636             <family>Times New Roman</family>
637           </prefer>
638           <default>
639             <family>serif</family>
640           </default>
641         </alias>
642         <alias>
643           <family>Helvetica</family>
644           <prefer>
645             <family>Arial</family>
646           </prefer>
647           <default>
648             <family>sans</family>
649           </default>
650         </alias>
651         <alias>
652           <family>Courier</family>
653           <prefer>
654             <family>Courier New</family>
655           </prefer>
656           <default>
657             <family>monospace</family>
658           </default>
659         </alias>
660
661         <!--
662           Provide required aliases for standard names
663           Do these after the users configuration file so that
664           any aliases there are used preferentially
665         -->
666         <alias>
667           <family>serif</family>
668           <prefer>
669             <family>Times New Roman</family>
670           </prefer>
671         </alias>
672         <alias>
673           <family>sans</family>
674           <prefer>
675             <family>Arial</family>
676           </prefer>
677         </alias>
678         <alias>
679           <family>monospace</family>
680           <prefer>
681             <family>Andale Mono</family>
682           </prefer>
683         </alias>
684
685         <--
686           The example of the requirements of OR operator;
687           If the 'family' contains 'Courier New' OR 'Courier'
688           add 'monospace' as the alternative
689         -->
690         <match target="pattern">
691           <test name="family" compare="eq">
692             <string>Courier New</string>
693           </test>
694           <edit name="family" mode="prepend">
695             <string>monospace</string>
696           </edit>
697         </match>
698         <match target="pattern">
699           <test name="family" compare="eq">
700             <string>Courier</string>
701           </test>
702           <edit name="family" mode="prepend">
703             <string>monospace</string>
704           </edit>
705         </match>
706
707       </fontconfig>
708
709
710
711   USER CONFIGURATION FILE
712       This is an example of a  per-user  configuration  file  that  lives  in
713       $XDG_CONFIG_HOME/fontconfig/fonts.conf
714
715       <?xml version="1.0"?>
716       <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
717       <!--
718         $XDG_CONFIG_HOME/fontconfig/fonts.conf for per-user font configuration
719       -->
720       <fontconfig>
721
722         <!--
723           Private font directory
724         -->
725         <dir prefix="xdg">fonts</dir>
726
727         <!--
728           use rgb sub-pixel ordering to improve glyph appearance on
729           LCD screens.  Changes affecting rendering, but not matching
730           should always use target="font".
731         -->
732         <match target="font">
733           <edit name="rgba" mode="assign">
734             <const>rgb</const>
735           </edit>
736         </match>
737         <!--
738           use WenQuanYi Zen Hei font when serif is requested for Chinese
739         -->
740         <match>
741           <!--
742             If you don't want to use WenQuanYi Zen Hei font for zh-tw etc,
743             you can use zh-cn instead of zh.
744             Please note, even if you set zh-cn, it still matches zh.
745             if you don't like it, you can use compare="eq"
746             instead of compare="contains".
747           -->
748           <test name="lang" compare="contains">
749             <string>zh</string>
750           </test>
751           <test name="family">
752             <string>serif</string>
753           </test>
754           <edit name="family" mode="prepend">
755             <string>WenQuanYi Zen Hei</string>
756           </edit>
757         </match>
758         <!--
759           use VL Gothic font when sans-serif is requested for Japanese
760         -->
761         <match>
762           <test name="lang" compare="contains">
763             <string>ja</string>
764           </test>
765           <test name="family">
766             <string>sans-serif</string>
767           </test>
768           <edit name="family" mode="prepend">
769             <string>VL Gothic</string>
770           </edit>
771         </match>
772       </fontconfig>
773
774
775

FILES

777       fonts.conf  contains  configuration  information for the fontconfig li‐
778       brary consisting of directories to look at for font information as well
779       as  instructions  on editing program specified font patterns before at‐
780       tempting to match the available fonts. It is in XML format.
781
782       conf.d is the conventional name for a directory of additional  configu‐
783       ration  files managed by external applications or the local administra‐
784       tor. The filenames starting with decimal digits are sorted  in  lexico‐
785       graphic  order and used as additional configuration files. All of these
786       files are in XML format. The master fonts.conf file references this di‐
787       rectory in an <include> directive.
788
789       fonts.dtd  is  a  DTD  that  describes  the format of the configuration
790       files.
791
792       $XDG_CONFIG_HOME/fontconfig/conf.d and ~/.fonts.conf.d is  the  conven‐
793       tional name for a per-user directory of (typically auto-generated) con‐
794       figuration files, although the actual  location  is  specified  in  the
795       global  fonts.conf file. please note that ~/.fonts.conf.d is deprecated
796       now. it will not be read by default in the future version.
797
798       $XDG_CONFIG_HOME/fontconfig/fonts.conf and ~/.fonts.conf is the conven‐
799       tional  location  for  per-user font configuration, although the actual
800       location is specified in the global fonts.conf file. please  note  that
801       ~/.fonts.conf  is deprecated now. it will not be read by default in the
802       future version.
803
804       $XDG_CACHE_HOME/fontconfig/*.cache-*  and   ~/.fontconfig/*.cache-*  is
805       the conventional repository of font information that isn't found in the
806       per-directory caches. This file is automatically maintained by fontcon‐
807       fig.  please  note  that  ~/.fontconfig/*.cache-* is deprecated now. it
808       will not be read by default in the future version.
809

ENVIRONMENT VARIABLES

811       FONTCONFIG_FILE is used to override the default configuration file.
812
813       FONTCONFIG_PATH is used to override the  default  configuration  direc‐
814       tory.
815
816       FONTCONFIG_SYSROOT is used to set a default sysroot directory.
817
818       FC_DEBUG  is used to output the detailed debugging messages. see Debug‐
819       ging Applications section for more details.
820
821       FC_DBG_MATCH_FILTER is used to filter out the patterns.  this  takes  a
822       comma-separated list of object names and effects only when FC_DEBUG has
823       MATCH2. see Debugging Applications section for more details.
824
825       FC_LANG is used to specify the default language as the weak binding  in
826       the  query.  if this isn't set, the default language will be determined
827       from current locale.
828
829       FONTCONFIG_USE_MMAP is used to control the use of mmap(2) for the cache
830       files  if  available. this take a boolean value. fontconfig will checks
831       if the cache files are stored on the filesystem that  is  safe  to  use
832       mmap(2). explicitly setting this environment variable will causes skip‐
833       ping this check and enforce to use or not use mmap(2) anyway.
834
835       SOURCE_DATE_EPOCH is used to ensure fc-cache(1) generates  files  in  a
836       deterministic  manner in order to support reproducible builds. When set
837       to a numeric representation of UNIX timestamp, fontconfig  will  prefer
838       this value over using the modification timestamps of the input files in
839       order  to  identify  which  cache  files   require   regeneration.   If
840       SOURCE_DATE_EPOCH  is not set (or is newer than the mtime of the direc‐
841       tory), the existing behaviour is unchanged.
842

SEE ALSO

844       fc-cat(1),   fc-cache(1),   fc-list(1),    fc-match(1),    fc-query(1),
845       SOURCE_DATE_EPOCH    <URL:https://reproducible-builds.org/specs/source-
846       date-epoch/>.
847

VERSION

849       Fontconfig version 2.14.2
850
851
852
853                                  27 1月 2023                    FONTS-CONF(5)
Impressum