fontconfig-user.txt revision 2c393a42
12c393a42Smrg                               fonts-conf
22c393a42Smrg
32c393a42SmrgName
42c393a42Smrg
52c393a42Smrg   fonts.conf -- Font configuration files
62c393a42Smrg
72c393a42SmrgSynopsis
82c393a42Smrg
92c393a42Smrg   /etc/fonts/fonts.conf
102c393a42Smrg   /etc/fonts/fonts.dtd
112c393a42Smrg   /etc/fonts/conf.d
122c393a42Smrg   ~/.fonts.conf
132c393a42Smrg
142c393a42SmrgDescription
152c393a42Smrg
162c393a42Smrg   Fontconfig is a library designed to provide system-wide font
172c393a42Smrg   configuration, customization and application access.
182c393a42Smrg
192c393a42SmrgFunctional Overview
202c393a42Smrg
212c393a42Smrg   Fontconfig contains two essential modules, the configuration
222c393a42Smrg   module which builds an internal configuration from XML files
232c393a42Smrg   and the matching module which accepts font patterns and returns
242c393a42Smrg   the nearest matching font.
252c393a42Smrg
262c393a42SmrgFont Configuration
272c393a42Smrg
282c393a42Smrg   The configuration module consists of the FcConfig datatype,
292c393a42Smrg   libexpat and FcConfigParse which walks over an XML tree and
302c393a42Smrg   amends a configuration with data found within. From an external
312c393a42Smrg   perspective, configuration of the library consists of
322c393a42Smrg   generating a valid XML tree and feeding that to FcConfigParse.
332c393a42Smrg   The only other mechanism provided to applications for changing
342c393a42Smrg   the running configuration is to add fonts and directories to
352c393a42Smrg   the list of application-provided font files.
362c393a42Smrg
372c393a42Smrg   The intent is to make font configurations relatively static,
382c393a42Smrg   and shared by as many applications as possible. It is hoped
392c393a42Smrg   that this will lead to more stable font selection when passing
402c393a42Smrg   names from one application to another. XML was chosen as a
412c393a42Smrg   configuration file format because it provides a format which is
422c393a42Smrg   easy for external agents to edit while retaining the correct
432c393a42Smrg   structure and syntax.
442c393a42Smrg
452c393a42Smrg   Font configuration is separate from font matching; applications
462c393a42Smrg   needing to do their own matching can access the available fonts
472c393a42Smrg   from the library and perform private matching. The intent is to
482c393a42Smrg   permit applications to pick and choose appropriate
492c393a42Smrg   functionality from the library instead of forcing them to
502c393a42Smrg   choose between this library and a private configuration
512c393a42Smrg   mechanism. The hope is that this will ensure that configuration
522c393a42Smrg   of fonts for all applications can be centralized in one place.
532c393a42Smrg   Centralizing font configuration will simplify and regularize
542c393a42Smrg   font installation and customization.
552c393a42Smrg
562c393a42SmrgFont Properties
572c393a42Smrg
582c393a42Smrg   While font patterns may contain essentially any properties,
592c393a42Smrg   there are some well known properties with associated types.
602c393a42Smrg   Fontconfig uses some of these properties for font matching and
612c393a42Smrg   font completion. Others are provided as a convenience for the
622c393a42Smrg   applications' rendering mechanism.
632c393a42Smrg  Property        Type    Description
642c393a42Smrg  --------------------------------------------------------------
652c393a42Smrg  family          String  Font family names
662c393a42Smrg  familylang      String  Languages corresponding to each family
672c393a42Smrg  style           String  Font style. Overrides weight and slant
682c393a42Smrg  stylelang       String  Languages corresponding to each style
692c393a42Smrg  fullname        String  Font full names (often includes style)
702c393a42Smrg  fullnamelang    String  Languages corresponding to each fullname
712c393a42Smrg  slant           Int     Italic, oblique or roman
722c393a42Smrg  weight          Int     Light, medium, demibold, bold or black
732c393a42Smrg  size            Double  Point size
742c393a42Smrg  width           Int     Condensed, normal or expanded
752c393a42Smrg  aspect          Double  Stretches glyphs horizontally before hinting
762c393a42Smrg  pixelsize       Double  Pixel size
772c393a42Smrg  spacing         Int     Proportional, dual-width, monospace or charcel
782c393a42Smrgl
792c393a42Smrg  foundry         String  Font foundry name
802c393a42Smrg  antialias       Bool    Whether glyphs can be antialiased
812c393a42Smrg  hinting         Bool    Whether the rasterizer should use hinting
822c393a42Smrg  hintstyle       Int     Automatic hinting style
832c393a42Smrg  verticallayout  Bool    Use vertical layout
842c393a42Smrg  autohint        Bool    Use autohinter instead of normal hinter
852c393a42Smrg  globaladvance   Bool    Use font global advance data
862c393a42Smrg  file            String  The filename holding the font
872c393a42Smrg  index           Int     The index of the font within the file
882c393a42Smrg  ftface          FT_Face Use the specified FreeType face object
892c393a42Smrg  rasterizer      String  Which rasterizer is in use
902c393a42Smrg  outline         Bool    Whether the glyphs are outlines
912c393a42Smrg  scalable        Bool    Whether glyphs can be scaled
922c393a42Smrg  scale           Double  Scale factor for point->pixel conversions
932c393a42Smrg  dpi             Double  Target dots per inch
942c393a42Smrg  rgba            Int     unknown, rgb, bgr, vrgb, vbgr,
952c393a42Smrg                          none - subpixel geometry
962c393a42Smrg  lcdfilter       Int     Type of LCD filter
972c393a42Smrg  minspace        Bool    Eliminate leading from line spacing
982c393a42Smrg  charset         CharSet Unicode chars encoded by the font
992c393a42Smrg  lang            String  List of RFC-3066-style languages this
1002c393a42Smrg                          font supports
1012c393a42Smrg  fontversion     Int     Version number of the font
1022c393a42Smrg  capability      String  List of layout capabilities in the font
1032c393a42Smrg  embolden        Bool    Rasterizer should synthetically embolden the f
1042c393a42Smrgont
1052c393a42Smrg
1062c393a42SmrgFont Matching
1072c393a42Smrg
1082c393a42Smrg   Fontconfig performs matching by measuring the distance from a
1092c393a42Smrg   provided pattern to all of the available fonts in the system.
1102c393a42Smrg   The closest matching font is selected. This ensures that a font
1112c393a42Smrg   will always be returned, but doesn't ensure that it is anything
1122c393a42Smrg   like the requested pattern.
1132c393a42Smrg
1142c393a42Smrg   Font matching starts with an application constructed pattern.
1152c393a42Smrg   The desired attributes of the resulting font are collected
1162c393a42Smrg   together in a pattern. Each property of the pattern can contain
1172c393a42Smrg   one or more values; these are listed in priority order; matches
1182c393a42Smrg   earlier in the list are considered "closer" than matches later
1192c393a42Smrg   in the list.
1202c393a42Smrg
1212c393a42Smrg   The initial pattern is modified by applying the list of editing
1222c393a42Smrg   instructions specific to patterns found in the configuration;
1232c393a42Smrg   each consists of a match predicate and a set of editing
1242c393a42Smrg   operations. They are executed in the order they appeared in the
1252c393a42Smrg   configuration. Each match causes the associated sequence of
1262c393a42Smrg   editing operations to be applied.
1272c393a42Smrg
1282c393a42Smrg   After the pattern has been edited, a sequence of default
1292c393a42Smrg   substitutions are performed to canonicalize the set of
1302c393a42Smrg   available properties; this avoids the need for the lower layers
1312c393a42Smrg   to constantly provide default values for various font
1322c393a42Smrg   properties during rendering.
1332c393a42Smrg
1342c393a42Smrg   The canonical font pattern is finally matched against all
1352c393a42Smrg   available fonts. The distance from the pattern to the font is
1362c393a42Smrg   measured for each of several properties: foundry, charset,
1372c393a42Smrg   family, lang, spacing, pixelsize, style, slant, weight,
1382c393a42Smrg   antialias, rasterizer and outline. This list is in priority
1392c393a42Smrg   order -- results of comparing earlier elements of this list
1402c393a42Smrg   weigh more heavily than later elements.
1412c393a42Smrg
1422c393a42Smrg   There is one special case to this rule; family names are split
1432c393a42Smrg   into two bindings; strong and weak. Strong family names are
1442c393a42Smrg   given greater precedence in the match than lang elements while
1452c393a42Smrg   weak family names are given lower precedence than lang
1462c393a42Smrg   elements. This permits the document language to drive font
1472c393a42Smrg   selection when any document specified font is unavailable.
1482c393a42Smrg
1492c393a42Smrg   The pattern representing that font is augmented to include any
1502c393a42Smrg   properties found in the pattern but not found in the font
1512c393a42Smrg   itself; this permits the application to pass rendering
1522c393a42Smrg   instructions or any other data through the matching system.
1532c393a42Smrg   Finally, the list of editing instructions specific to fonts
1542c393a42Smrg   found in the configuration are applied to the pattern. This
1552c393a42Smrg   modified pattern is returned to the application.
1562c393a42Smrg
1572c393a42Smrg   The return value contains sufficient information to locate and
1582c393a42Smrg   rasterize the font, including the file name, pixel size and
1592c393a42Smrg   other rendering data. As none of the information involved
1602c393a42Smrg   pertains to the FreeType library, applications are free to use
1612c393a42Smrg   any rasterization engine or even to take the identified font
1622c393a42Smrg   file and access it directly.
1632c393a42Smrg
1642c393a42Smrg   The match/edit sequences in the configuration are performed in
1652c393a42Smrg   two passes because there are essentially two different
1662c393a42Smrg   operations necessary -- the first is to modify how fonts are
1672c393a42Smrg   selected; aliasing families and adding suitable defaults. The
1682c393a42Smrg   second is to modify how the selected fonts are rasterized.
1692c393a42Smrg   Those must apply to the selected font, not the original pattern
1702c393a42Smrg   as false matches will often occur.
1712c393a42Smrg
1722c393a42SmrgFont Names
1732c393a42Smrg
1742c393a42Smrg   Fontconfig provides a textual representation for patterns that
1752c393a42Smrg   the library can both accept and generate. The representation is
1762c393a42Smrg   in three parts, first a list of family names, second a list of
1772c393a42Smrg   point sizes and finally a list of additional properties:
1782c393a42Smrg        <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>...
1792c393a42Smrg
1802c393a42Smrg   Values in a list are separated with commas. The name needn't
1812c393a42Smrg   include either families or point sizes; they can be elided. In
1822c393a42Smrg   addition, there are symbolic constants that simultaneously
1832c393a42Smrg   indicate both a name and a value. Here are some examples:
1842c393a42Smrg  Name                            Meaning
1852c393a42Smrg  ----------------------------------------------------------
1862c393a42Smrg  Times-12                        12 point Times Roman
1872c393a42Smrg  Times-12:bold                   12 point Times Bold
1882c393a42Smrg  Courier:italic                  Courier Italic in the default size
1892c393a42Smrg  Monospace:matrix=1 .1 0 1       The users preferred monospace font
1902c393a42Smrg                                  with artificial obliquing
1912c393a42Smrg
1922c393a42Smrg   The '\', '-', ':' and ',' characters in family names must be
1932c393a42Smrg   preceeded by a '\' character to avoid having them
1942c393a42Smrg   misinterpreted. Similarly, values containing '\', '=', '_', ':'
1952c393a42Smrg   and ',' must also have them preceeded by a '\' character. The
1962c393a42Smrg   '\' characters are stripped out of the family name and values
1972c393a42Smrg   as the font name is read.
1982c393a42Smrg
1992c393a42SmrgDebugging Applications
2002c393a42Smrg
2012c393a42Smrg   To help diagnose font and applications problems, fontconfig is
2022c393a42Smrg   built with a large amount of internal debugging left enabled.
2032c393a42Smrg   It is controlled by means of the FC_DEBUG environment variable.
2042c393a42Smrg   The value of this variable is interpreted as a number, and each
2052c393a42Smrg   bit within that value controls different debugging messages.
2062c393a42Smrg  Name         Value    Meaning
2072c393a42Smrg  ---------------------------------------------------------
2082c393a42Smrg  MATCH            1    Brief information about font matching
2092c393a42Smrg  MATCHV           2    Extensive font matching information
2102c393a42Smrg  EDIT             4    Monitor match/test/edit execution
2112c393a42Smrg  FONTSET          8    Track loading of font information at startup
2122c393a42Smrg  CACHE           16    Watch cache files being written
2132c393a42Smrg  CACHEV          32    Extensive cache file writing information
2142c393a42Smrg  PARSE           64    (no longer in use)
2152c393a42Smrg  SCAN           128    Watch font files being scanned to build caches
2162c393a42Smrg  SCANV          256    Verbose font file scanning information
2172c393a42Smrg  MEMORY         512    Monitor fontconfig memory usage
2182c393a42Smrg  CONFIG        1024    Monitor which config files are loaded
2192c393a42Smrg  LANGSET       2048    Dump char sets used to construct lang values
2202c393a42Smrg  OBJTYPES      4096    Display message when value typechecks fail
2212c393a42Smrg
2222c393a42Smrg   Add the value of the desired debug levels together and assign
2232c393a42Smrg   that (in base 10) to the FC_DEBUG environment variable before
2242c393a42Smrg   running the application. Output from these statements is sent
2252c393a42Smrg   to stdout.
2262c393a42Smrg
2272c393a42SmrgLang Tags
2282c393a42Smrg
2292c393a42Smrg   Each font in the database contains a list of languages it
2302c393a42Smrg   supports. This is computed by comparing the Unicode coverage of
2312c393a42Smrg   the font with the orthography of each language. Languages are
2322c393a42Smrg   tagged using an RFC-3066 compatible naming and occur in two
2332c393a42Smrg   parts -- the ISO 639 language tag followed a hyphen and then by
2342c393a42Smrg   the ISO 3166 country code. The hyphen and country code may be
2352c393a42Smrg   elided.
2362c393a42Smrg
2372c393a42Smrg   Fontconfig has orthographies for several languages built into
2382c393a42Smrg   the library. No provision has been made for adding new ones
2392c393a42Smrg   aside from rebuilding the library. It currently supports 122 of
2402c393a42Smrg   the 139 languages named in ISO 639-1, 141 of the languages with
2412c393a42Smrg   two-letter codes from ISO 639-2 and another 30 languages with
2422c393a42Smrg   only three-letter codes. Languages with both two and three
2432c393a42Smrg   letter codes are provided with only the two letter code.
2442c393a42Smrg
2452c393a42Smrg   For languages used in multiple territories with radically
2462c393a42Smrg   different character sets, fontconfig includes per-territory
2472c393a42Smrg   orthographies. This includes Azerbaijani, Kurdish, Pashto,
2482c393a42Smrg   Tigrinya and Chinese.
2492c393a42Smrg
2502c393a42SmrgConfiguration File Format
2512c393a42Smrg
2522c393a42Smrg   Configuration files for fontconfig are stored in XML format;
2532c393a42Smrg   this format makes external configuration tools easier to write
2542c393a42Smrg   and ensures that they will generate syntactically correct
2552c393a42Smrg   configuration files. As XML files are plain text, they can also
2562c393a42Smrg   be manipulated by the expert user using a text editor.
2572c393a42Smrg
2582c393a42Smrg   The fontconfig document type definition resides in the external
2592c393a42Smrg   entity "fonts.dtd"; this is normally stored in the default font
2602c393a42Smrg   configuration directory (/etc/fonts). Each configuration file
2612c393a42Smrg   should contain the following structure:
2622c393a42Smrg        <?xml version="1.0"?>
2632c393a42Smrg        <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
2642c393a42Smrg        <fontconfig>
2652c393a42Smrg        ...
2662c393a42Smrg        </fontconfig>
2672c393a42Smrg
2682c393a42Smrg<fontconfig>
2692c393a42Smrg
2702c393a42Smrg   This is the top level element for a font configuration and can
2712c393a42Smrg   contain <dir>, <cache>, <include>, <match> and <alias> elements
2722c393a42Smrg   in any order.
2732c393a42Smrg
2742c393a42Smrg<dir>
2752c393a42Smrg
2762c393a42Smrg   This element contains a directory name which will be scanned
2772c393a42Smrg   for font files to include in the set of available fonts.
2782c393a42Smrg
2792c393a42Smrg<cache>
2802c393a42Smrg
2812c393a42Smrg   This element contains a file name for the per-user cache of
2822c393a42Smrg   font information. If it starts with '~', it refers to a file in
2832c393a42Smrg   the users home directory. This file is used to hold information
2842c393a42Smrg   about fonts that isn't present in the per-directory cache
2852c393a42Smrg   files. It is automatically maintained by the fontconfig
2862c393a42Smrg   library. The default for this file is
2872c393a42Smrg   ``~/.fonts.cache-<version>'', where <version> is the font
2882c393a42Smrg   configuration file version number (currently 2).
2892c393a42Smrg
2902c393a42Smrg<include ignore_missing="no">
2912c393a42Smrg
2922c393a42Smrg   This element contains the name of an additional configuration
2932c393a42Smrg   file or directory. If a directory, every file within that
2942c393a42Smrg   directory starting with an ASCII digit (U+0030 - U+0039) and
2952c393a42Smrg   ending with the string ``.conf'' will be processed in sorted
2962c393a42Smrg   order. When the XML datatype is traversed by FcConfigParse, the
2972c393a42Smrg   contents of the file(s) will also be incorporated into the
2982c393a42Smrg   configuration by passing the filename(s) to
2992c393a42Smrg   FcConfigLoadAndParse. If 'ignore_missing' is set to "yes"
3002c393a42Smrg   instead of the default "no", a missing file or directory will
3012c393a42Smrg   elicit no warning message from the library.
3022c393a42Smrg
3032c393a42Smrg<config>
3042c393a42Smrg
3052c393a42Smrg   This element provides a place to consolidate additional
3062c393a42Smrg   configuration information. <config> can contain <blank> and
3072c393a42Smrg   <rescan> elements in any order.
3082c393a42Smrg
3092c393a42Smrg<blank>
3102c393a42Smrg
3112c393a42Smrg   Fonts often include "broken" glyphs which appear in the
3122c393a42Smrg   encoding but are drawn as blanks on the screen. Within the
3132c393a42Smrg   <blank> element, place each Unicode characters which is
3142c393a42Smrg   supposed to be blank in an <int> element. Characters outside of
3152c393a42Smrg   this set which are drawn as blank will be elided from the set
3162c393a42Smrg   of characters supported by the font.
3172c393a42Smrg
3182c393a42Smrg<rescan>
3192c393a42Smrg
3202c393a42Smrg   The <rescan> element holds an <int> element which indicates the
3212c393a42Smrg   default interval between automatic checks for font
3222c393a42Smrg   configuration changes. Fontconfig will validate all of the
3232c393a42Smrg   configuration files and directories and automatically rebuild
3242c393a42Smrg   the internal datastructures when this interval passes.
3252c393a42Smrg
3262c393a42Smrg<selectfont>
3272c393a42Smrg
3282c393a42Smrg   This element is used to black/white list fonts from being
3292c393a42Smrg   listed or matched against. It holds acceptfont and rejectfont
3302c393a42Smrg   elements.
3312c393a42Smrg
3322c393a42Smrg<acceptfont>
3332c393a42Smrg
3342c393a42Smrg   Fonts matched by an acceptfont element are "whitelisted"; such
3352c393a42Smrg   fonts are explicitly included in the set of fonts used to
3362c393a42Smrg   resolve list and match requests; including them in this list
3372c393a42Smrg   protects them from being "blacklisted" by a rejectfont element.
3382c393a42Smrg   Acceptfont elements include glob and pattern elements which are
3392c393a42Smrg   used to match fonts.
3402c393a42Smrg
3412c393a42Smrg<rejectfont>
3422c393a42Smrg
3432c393a42Smrg   Fonts matched by an rejectfont element are "blacklisted"; such
3442c393a42Smrg   fonts are excluded from the set of fonts used to resolve list
3452c393a42Smrg   and match requests as if they didn't exist in the system.
3462c393a42Smrg   Rejectfont elements include glob and pattern elements which are
3472c393a42Smrg   used to match fonts.
3482c393a42Smrg
3492c393a42Smrg<glob>
3502c393a42Smrg
3512c393a42Smrg   Glob elements hold shell-style filename matching patterns
3522c393a42Smrg   (including ? and *) which match fonts based on their complete
3532c393a42Smrg   pathnames. This can be used to exclude a set of directories
3542c393a42Smrg   (/usr/share/fonts/uglyfont*), or particular font file types
3552c393a42Smrg   (*.pcf.gz), but the latter mechanism relies rather heavily on
3562c393a42Smrg   filenaming conventions which can't be relied upon. Note that
3572c393a42Smrg   globs only apply to directories, not to individual fonts.
3582c393a42Smrg
3592c393a42Smrg<pattern>
3602c393a42Smrg
3612c393a42Smrg   Pattern elements perform list-style matching on incoming fonts;
3622c393a42Smrg   that is, they hold a list of elements and associated values. If
3632c393a42Smrg   all of those elements have a matching value, then the pattern
3642c393a42Smrg   matches the font. This can be used to select fonts based on
3652c393a42Smrg   attributes of the font (scalable, bold, etc), which is a more
3662c393a42Smrg   reliable mechanism than using file extensions. Pattern elements
3672c393a42Smrg   include patelt elements.
3682c393a42Smrg
3692c393a42Smrg<patelt name="property">
3702c393a42Smrg
3712c393a42Smrg   Patelt elements hold a single pattern element and list of
3722c393a42Smrg   values. They must have a 'name' attribute which indicates the
3732c393a42Smrg   pattern element name. Patelt elements include int, double,
3742c393a42Smrg   string, matrix, bool, charset and const elements.
3752c393a42Smrg
3762c393a42Smrg<match target="pattern">
3772c393a42Smrg
3782c393a42Smrg   This element holds first a (possibly empty) list of <test>
3792c393a42Smrg   elements and then a (possibly empty) list of <edit> elements.
3802c393a42Smrg   Patterns which match all of the tests are subjected to all the
3812c393a42Smrg   edits. If 'target' is set to "font" instead of the default
3822c393a42Smrg   "pattern", then this element applies to the font name resulting
3832c393a42Smrg   from a match rather than a font pattern to be matched. If
3842c393a42Smrg   'target' is set to "scan", then this element applies when the
3852c393a42Smrg   font is scanned to build the fontconfig database.
3862c393a42Smrg
3872c393a42Smrg<test qual="any" name="property" target="default" compare="eq">
3882c393a42Smrg
3892c393a42Smrg   This element contains a single value which is compared with the
3902c393a42Smrg   target ('pattern', 'font', 'scan' or 'default') property
3912c393a42Smrg   "property" (substitute any of the property names seen above).
3922c393a42Smrg   'compare' can be one of "eq", "not_eq", "less", "less_eq",
3932c393a42Smrg   "more", or "more_eq". 'qual' may either be the default, "any",
3942c393a42Smrg   in which case the match succeeds if any value associated with
3952c393a42Smrg   the property matches the test value, or "all", in which case
3962c393a42Smrg   all of the values associated with the property must match the
3972c393a42Smrg   test value. When used in a <match target="font"> element, the
3982c393a42Smrg   target= attribute in the <test> element selects between
3992c393a42Smrg   matching the original pattern or the font. "default" selects
4002c393a42Smrg   whichever target the outer <match> element has selected.
4012c393a42Smrg
4022c393a42Smrg<edit name="property" mode="assign" binding="weak">
4032c393a42Smrg
4042c393a42Smrg   This element contains a list of expression elements (any of the
4052c393a42Smrg   value or operator elements). The expression elements are
4062c393a42Smrg   evaluated at run-time and modify the property "property". The
4072c393a42Smrg   modification depends on whether "property" was matched by one
4082c393a42Smrg   of the associated <test> elements, if so, the modification may
4092c393a42Smrg   affect the first matched value. Any values inserted into the
4102c393a42Smrg   property are given the indicated binding ("strong", "weak" or
4112c393a42Smrg   "same") with "same" binding using the value from the matched
4122c393a42Smrg   pattern element. 'mode' is one of:
4132c393a42Smrg  Mode                    With Match              Without Match
4142c393a42Smrg  ---------------------------------------------------------------------
4152c393a42Smrg  "assign"                Replace matching value  Replace all values
4162c393a42Smrg  "assign_replace"        Replace all values      Replace all values
4172c393a42Smrg  "prepend"               Insert before matching  Insert at head of list
4182c393a42Smrg  "prepend_first"         Insert at head of list  Insert at head of list
4192c393a42Smrg  "append"                Append after matching   Append at end of list
4202c393a42Smrg  "append_last"           Append at end of list   Append at end of list
4212c393a42Smrg
4222c393a42Smrg<int>, <double>, <string>, <bool>
4232c393a42Smrg
4242c393a42Smrg   These elements hold a single value of the indicated type.
4252c393a42Smrg   <bool> elements hold either true or false. An important
4262c393a42Smrg   limitation exists in the parsing of floating point numbers --
4272c393a42Smrg   fontconfig requires that the mantissa start with a digit, not a
4282c393a42Smrg   decimal point, so insert a leading zero for purely fractional
4292c393a42Smrg   values (e.g. use 0.5 instead of .5 and -0.5 instead of -.5).
4302c393a42Smrg
4312c393a42Smrg<matrix>
4322c393a42Smrg
4332c393a42Smrg   This element holds the four <double> elements of an affine
4342c393a42Smrg   transformation.
4352c393a42Smrg
4362c393a42Smrg<name>
4372c393a42Smrg
4382c393a42Smrg   Holds a property name. Evaluates to the first value from the
4392c393a42Smrg   property of the font, not the pattern.
4402c393a42Smrg
4412c393a42Smrg<const>
4422c393a42Smrg
4432c393a42Smrg   Holds the name of a constant; these are always integers and
4442c393a42Smrg   serve as symbolic names for common font values:
4452c393a42Smrg  Constant        Property        Value
4462c393a42Smrg  -------------------------------------
4472c393a42Smrg  thin            weight          0
4482c393a42Smrg  extralight      weight          40
4492c393a42Smrg  ultralight      weight          40
4502c393a42Smrg  light           weight          50
4512c393a42Smrg  book            weight          75
4522c393a42Smrg  regular         weight          80
4532c393a42Smrg  normal          weight          80
4542c393a42Smrg  medium          weight          100
4552c393a42Smrg  demibold        weight          180
4562c393a42Smrg  semibold        weight          180
4572c393a42Smrg  bold            weight          200
4582c393a42Smrg  extrabold       weight          205
4592c393a42Smrg  black           weight          210
4602c393a42Smrg  heavy           weight          210
4612c393a42Smrg  roman           slant           0
4622c393a42Smrg  italic          slant           100
4632c393a42Smrg  oblique         slant           110
4642c393a42Smrg  ultracondensed  width           50
4652c393a42Smrg  extracondensed  width           63
4662c393a42Smrg  condensed       width           75
4672c393a42Smrg  semicondensed   width           87
4682c393a42Smrg  normal          width           100
4692c393a42Smrg  semiexpanded    width           113
4702c393a42Smrg  expanded        width           125
4712c393a42Smrg  extraexpanded   width           150
4722c393a42Smrg  ultraexpanded   width           200
4732c393a42Smrg  proportional    spacing         0
4742c393a42Smrg  dual            spacing         90
4752c393a42Smrg  mono            spacing         100
4762c393a42Smrg  charcell        spacing         110
4772c393a42Smrg  unknown         rgba            0
4782c393a42Smrg  rgb             rgba            1
4792c393a42Smrg  bgr             rgba            2
4802c393a42Smrg  vrgb            rgba            3
4812c393a42Smrg  vbgr            rgba            4
4822c393a42Smrg  none            rgba            5
4832c393a42Smrg  lcdnone         lcdfilter       0
4842c393a42Smrg  lcddefault      lcdfilter       1
4852c393a42Smrg  lcdlight        lcdfilter       2
4862c393a42Smrg  lcdlegacy       lcdfilter       3
4872c393a42Smrg  hintnone        hintstyle       0
4882c393a42Smrg  hintslight      hintstyle       1
4892c393a42Smrg  hintmedium      hintstyle       2
4902c393a42Smrg  hintfull        hintstyle       3
4912c393a42Smrg
4922c393a42Smrg<or>, <and>, <plus>, <minus>, <times>, <divide>
4932c393a42Smrg
4942c393a42Smrg   These elements perform the specified operation on a list of
4952c393a42Smrg   expression elements. <or> and <and> are boolean, not bitwise.
4962c393a42Smrg
4972c393a42Smrg<eq>, <not_eq>, <less>, <less_eq>, <more>, <more_eq>
4982c393a42Smrg
4992c393a42Smrg   These elements compare two values, producing a boolean result.
5002c393a42Smrg
5012c393a42Smrg<not>
5022c393a42Smrg
5032c393a42Smrg   Inverts the boolean sense of its one expression element
5042c393a42Smrg
5052c393a42Smrg<if>
5062c393a42Smrg
5072c393a42Smrg   This element takes three expression elements; if the value of
5082c393a42Smrg   the first is true, it produces the value of the second,
5092c393a42Smrg   otherwise it produces the value of the third.
5102c393a42Smrg
5112c393a42Smrg<alias>
5122c393a42Smrg
5132c393a42Smrg   Alias elements provide a shorthand notation for the set of
5142c393a42Smrg   common match operations needed to substitute one font family
5152c393a42Smrg   for another. They contain a <family> element followed by
5162c393a42Smrg   optional <prefer>, <accept> and <default> elements. Fonts
5172c393a42Smrg   matching the <family> element are edited to prepend the list of
5182c393a42Smrg   <prefer>ed families before the matching <family>, append the
5192c393a42Smrg   <accept>able families after the matching <family> and append
5202c393a42Smrg   the <default> families to the end of the family list.
5212c393a42Smrg
5222c393a42Smrg<family>
5232c393a42Smrg
5242c393a42Smrg   Holds a single font family name
5252c393a42Smrg
5262c393a42Smrg<prefer>, <accept>, <default>
5272c393a42Smrg
5282c393a42Smrg   These hold a list of <family> elements to be used by the
5292c393a42Smrg   <alias> element.
5302c393a42Smrg
5312c393a42SmrgEXAMPLE CONFIGURATION FILE
5322c393a42Smrg
5332c393a42SmrgSystem configuration file
5342c393a42Smrg
5352c393a42Smrg   This is an example of a system-wide configuration file
5362c393a42Smrg<?xml version="1.0"?>
5372c393a42Smrg<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
5382c393a42Smrg<!-- /etc/fonts/fonts.conf file to configure system font access -->
5392c393a42Smrg<fontconfig>
5402c393a42Smrg<!--
5412c393a42Smrg        Find fonts in these directories
5422c393a42Smrg-->
5432c393a42Smrg<dir>/usr/share/fonts</dir>
5442c393a42Smrg<dir>/usr/X11R6/lib/X11/fonts</dir>
5452c393a42Smrg
5462c393a42Smrg<!--
5472c393a42Smrg        Accept deprecated 'mono' alias, replacing it with 'monospace'
5482c393a42Smrg-->
5492c393a42Smrg<match target="pattern">
5502c393a42Smrg        <test qual="any" name="family"><string>mono</string></test>
5512c393a42Smrg        <edit name="family" mode="assign"><string>monospace</string></ed
5522c393a42Smrgit>
5532c393a42Smrg</match>
5542c393a42Smrg
5552c393a42Smrg<!--
5562c393a42Smrg        Names not including any well known alias are given 'sans'
5572c393a42Smrg-->
5582c393a42Smrg<match target="pattern">
5592c393a42Smrg        <test qual="all" name="family" mode="not_eq">sans</test>
5602c393a42Smrg        <test qual="all" name="family" mode="not_eq">serif</test>
5612c393a42Smrg        <test qual="all" name="family" mode="not_eq">monospace</test>
5622c393a42Smrg        <edit name="family" mode="append_last"><string>sans</string></ed
5632c393a42Smrgit>
5642c393a42Smrg</match>
5652c393a42Smrg
5662c393a42Smrg<!--
5672c393a42Smrg        Load per-user customization file, but don't complain
5682c393a42Smrg        if it doesn't exist
5692c393a42Smrg-->
5702c393a42Smrg<include ignore_missing="yes">~/.fonts.conf</include>
5712c393a42Smrg
5722c393a42Smrg<!--
5732c393a42Smrg        Load local customization files, but don't complain
5742c393a42Smrg        if there aren't any
5752c393a42Smrg-->
5762c393a42Smrg<include ignore_missing="yes">conf.d</include>
5772c393a42Smrg<include ignore_missing="yes">local.conf</include>
5782c393a42Smrg
5792c393a42Smrg<!--
5802c393a42Smrg        Alias well known font names to available TrueType fonts.
5812c393a42Smrg        These substitute TrueType faces for similar Type1
5822c393a42Smrg        faces to improve screen appearance.
5832c393a42Smrg-->
5842c393a42Smrg<alias>
5852c393a42Smrg        <family>Times</family>
5862c393a42Smrg        <prefer><family>Times New Roman</family></prefer>
5872c393a42Smrg        <default><family>serif</family></default>
5882c393a42Smrg</alias>
5892c393a42Smrg<alias>
5902c393a42Smrg        <family>Helvetica</family>
5912c393a42Smrg        <prefer><family>Arial</family></prefer>
5922c393a42Smrg        <default><family>sans</family></default>
5932c393a42Smrg</alias>
5942c393a42Smrg<alias>
5952c393a42Smrg        <family>Courier</family>
5962c393a42Smrg        <prefer><family>Courier New</family></prefer>
5972c393a42Smrg        <default><family>monospace</family></default>
5982c393a42Smrg</alias>
5992c393a42Smrg
6002c393a42Smrg<!--
6012c393a42Smrg        Provide required aliases for standard names
6022c393a42Smrg        Do these after the users configuration file so that
6032c393a42Smrg        any aliases there are used preferentially
6042c393a42Smrg-->
6052c393a42Smrg<alias>
6062c393a42Smrg        <family>serif</family>
6072c393a42Smrg        <prefer><family>Times New Roman</family></prefer>
6082c393a42Smrg</alias>
6092c393a42Smrg<alias>
6102c393a42Smrg        <family>sans</family>
6112c393a42Smrg        <prefer><family>Arial</family></prefer>
6122c393a42Smrg</alias>
6132c393a42Smrg<alias>
6142c393a42Smrg        <family>monospace</family>
6152c393a42Smrg        <prefer><family>Andale Mono</family></prefer>
6162c393a42Smrg</alias>
6172c393a42Smrg</fontconfig>
6182c393a42Smrg
6192c393a42SmrgUser configuration file
6202c393a42Smrg
6212c393a42Smrg   This is an example of a per-user configuration file that lives
6222c393a42Smrg   in ~/.fonts.conf
6232c393a42Smrg<?xml version="1.0"?>
6242c393a42Smrg<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
6252c393a42Smrg<!-- ~/.fonts.conf for per-user font configuration -->
6262c393a42Smrg<fontconfig>
6272c393a42Smrg
6282c393a42Smrg<!--
6292c393a42Smrg        Private font directory
6302c393a42Smrg-->
6312c393a42Smrg<dir>~/.fonts</dir>
6322c393a42Smrg
6332c393a42Smrg<!--
6342c393a42Smrg        use rgb sub-pixel ordering to improve glyph appearance on
6352c393a42Smrg        LCD screens.  Changes affecting rendering, but not matching
6362c393a42Smrg        should always use target="font".
6372c393a42Smrg-->
6382c393a42Smrg<match target="font">
6392c393a42Smrg        <edit name="rgba" mode="assign"><const>rgb</const></edit>
6402c393a42Smrg</match>
6412c393a42Smrg</fontconfig>
6422c393a42Smrg
6432c393a42SmrgFiles
6442c393a42Smrg
6452c393a42Smrg   fonts.conf contains configuration information for the
6462c393a42Smrg   fontconfig library consisting of directories to look at for
6472c393a42Smrg   font information as well as instructions on editing program
6482c393a42Smrg   specified font patterns before attempting to match the
6492c393a42Smrg   available fonts. It is in xml format.
6502c393a42Smrg
6512c393a42Smrg   conf.d is the conventional name for a directory of additional
6522c393a42Smrg   configuration files managed by external applications or the
6532c393a42Smrg   local administrator. The filenames starting with decimal digits
6542c393a42Smrg   are sorted in lexicographic order and used as additional
6552c393a42Smrg   configuration files. All of these files are in xml format. The
6562c393a42Smrg   master fonts.conf file references this directory in an
6572c393a42Smrg   <include> directive.
6582c393a42Smrg
6592c393a42Smrg   fonts.dtd is a DTD that describes the format of the
6602c393a42Smrg   configuration files.
6612c393a42Smrg
6622c393a42Smrg   ~/.fonts.conf is the conventional location for per-user font
6632c393a42Smrg   configuration, although the actual location is specified in the
6642c393a42Smrg   global fonts.conf file.
6652c393a42Smrg
6662c393a42Smrg   ~/.fonts.cache-* is the conventional repository of font
6672c393a42Smrg   information that isn't found in the per-directory caches. This
6682c393a42Smrg   file is automatically maintained by fontconfig.
6692c393a42Smrg
6702c393a42SmrgSee Also
6712c393a42Smrg
6722c393a42Smrg   fc-cache(1), fc-match(1), fc-list(1)
6732c393a42Smrg
6742c393a42SmrgVersion
6752c393a42Smrg
6762c393a42Smrg   Fontconfig version 2.6.0
677