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