Blame doc/fontconfig-user.sgml

Packit 352660
Packit 352660
Packit 352660
Packit 352660
]>
Packit 352660
Packit 352660
    Copyright © 2003 Keith Packard
Packit 352660
   
Packit 352660
    Permission to use, copy, modify, distribute, and sell this software and its
Packit 352660
    documentation for any purpose is hereby granted without fee, provided that
Packit 352660
    the above copyright notice appear in all copies and that both that
Packit 352660
    copyright notice and this permission notice appear in supporting
Packit 352660
    documentation, and that the name of the author(s) not be used in
Packit 352660
    advertising or publicity pertaining to distribution of the software without
Packit 352660
    specific, written prior permission.  The authors make no
Packit 352660
    representations about the suitability of this software for any purpose.  It
Packit 352660
    is provided "as is" without express or implied warranty.
Packit 352660
   
Packit 352660
    THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
Packit 352660
    INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
Packit 352660
    EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Packit 352660
    CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
Packit 352660
    DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
Packit 352660
    TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
Packit 352660
    PERFORMANCE OF THIS SOFTWARE.
Packit 352660
-->
Packit 352660
<refentry>
Packit 352660
<refmeta>
Packit 352660
  <refentrytitle>fonts-conf</refentrytitle>
Packit 352660
  <manvolnum>5</manvolnum>
Packit 352660
</refmeta>
Packit 352660
<refnamediv>
Packit 352660
	<refname>fonts.conf</refname>
Packit 352660
	<refpurpose>Font configuration files</refpurpose>
Packit 352660
</refnamediv>
Packit 352660
<refsynopsisdiv>
Packit 352660
<synopsis>
Packit 352660
   &confdir;/fonts.conf
Packit 352660
   &confdir;/fonts.dtd
Packit 352660
   &confdir;/conf.d
Packit 352660
   $XDG_CONFIG_HOME/fontconfig/conf.d
Packit 352660
   $XDG_CONFIG_HOME/fontconfig/fonts.conf
Packit 352660
   ~/.fonts.conf.d
Packit 352660
   ~/.fonts.conf
Packit 352660
</synopsis>
Packit 352660
</refsynopsisdiv>
Packit 352660
<refsect1><title>Description</title>
Packit 352660
  <para>
Packit 352660
Fontconfig is a library designed to provide system-wide font configuration,
Packit 352660
customization and application access.
Packit 352660
  </para>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>Functional Overview</title>
Packit 352660
  <para>
Packit 352660
Fontconfig contains two essential modules, the configuration module which
Packit 352660
builds an internal configuration from XML files and the matching module
Packit 352660
which accepts font patterns and returns the nearest matching font.
Packit 352660
  </para>
Packit 352660
  <refsect2><title>Font Configuration</title>
Packit 352660
    <para>
Packit 352660
The configuration module consists of the FcConfig datatype, libexpat and
Packit 352660
FcConfigParse which walks over an XML tree and amends a configuration with
Packit 352660
data found within.  From an external perspective, configuration of the
Packit 352660
library consists of generating a valid XML tree and feeding that to
Packit 352660
FcConfigParse.  The only other mechanism provided to applications for
Packit 352660
changing the running configuration is to add fonts and directories to the
Packit 352660
list of application-provided font files.  
Packit 352660
    </para><para>
Packit 352660
The intent is to make font configurations relatively static, and shared by
Packit 352660
as many applications as possible.  It is hoped that this will lead to more
Packit 352660
stable font selection when passing names from one application to another.
Packit 352660
XML was chosen as a configuration file format because it provides a format
Packit 352660
which is easy for external agents to edit while retaining the correct
Packit 352660
structure and syntax.
Packit 352660
    </para><para>
Packit 352660
Font configuration is separate from font matching; applications needing to
Packit 352660
do their own matching can access the available fonts from the library and
Packit 352660
perform private matching.  The intent is to permit applications to pick and
Packit 352660
choose appropriate functionality from the library instead of forcing them to
Packit 352660
choose between this library and a private configuration mechanism.  The hope
Packit 352660
is that this will ensure that configuration of fonts for all applications
Packit 352660
can be centralized in one place.  Centralizing font configuration will
Packit 352660
simplify and regularize font installation and customization.
Packit 352660
    </para>
Packit 352660
  </refsect2>
Packit 352660
  <refsect2>
Packit 352660
    <title>Font Properties</title>
Packit 352660
    <para>
Packit 352660
While font patterns may contain essentially any properties, there are some
Packit 352660
well known properties with associated types.  Fontconfig uses some of these
Packit 352660
properties for font matching and font completion.  Others are provided as a
Packit 352660
convenience for the applications' rendering mechanism.
Packit 352660
    </para>
Packit 352660
    <programlisting>
Packit 352660
  Property        Type    Description
Packit 352660
  --------------------------------------------------------------
Packit 352660
  family          String  Font family names
Packit 352660
  familylang      String  Languages corresponding to each family
Packit 352660
  style           String  Font style. Overrides weight and slant
Packit 352660
  stylelang       String  Languages corresponding to each style
Packit 352660
  fullname        String  Font full names (often includes style)
Packit 352660
  fullnamelang    String  Languages corresponding to each fullname
Packit 352660
  slant           Int     Italic, oblique or roman
Packit 352660
  weight          Int     Light, medium, demibold, bold or black
Packit 352660
  size            Double  Point size
Packit 352660
  width           Int     Condensed, normal or expanded
Packit 352660
  aspect          Double  Stretches glyphs horizontally before hinting
Packit 352660
  pixelsize       Double  Pixel size
Packit 352660
  spacing         Int     Proportional, dual-width, monospace or charcell
Packit 352660
  foundry         String  Font foundry name
Packit 352660
  antialias       Bool    Whether glyphs can be antialiased
Packit 352660
  hinting         Bool    Whether the rasterizer should use hinting
Packit 352660
  hintstyle       Int     Automatic hinting style
Packit 352660
  verticallayout  Bool    Use vertical layout
Packit 352660
  autohint        Bool    Use autohinter instead of normal hinter
Packit 352660
  globaladvance   Bool    Use font global advance data (deprecated)
Packit 352660
  file            String  The filename holding the font
Packit 352660
  index           Int     The index of the font within the file
Packit 352660
  ftface          FT_Face Use the specified FreeType face object
Packit 352660
  rasterizer      String  Which rasterizer is in use (deprecated)
Packit 352660
  outline         Bool    Whether the glyphs are outlines
Packit 352660
  scalable        Bool    Whether glyphs can be scaled
Packit 352660
  color           Bool    Whether any glyphs have color
Packit 352660
  scale           Double  Scale factor for point->pixel conversions (deprecated)
Packit 352660
  dpi             Double  Target dots per inch
Packit 352660
  rgba            Int     unknown, rgb, bgr, vrgb, vbgr,
Packit 352660
                          none - subpixel geometry
Packit 352660
  lcdfilter       Int     Type of LCD filter
Packit 352660
  minspace        Bool    Eliminate leading from line spacing
Packit 352660
  charset         CharSet Unicode chars encoded by the font
Packit 352660
  lang            String  List of RFC-3066-style languages this
Packit 352660
                          font supports
Packit 352660
  fontversion     Int     Version number of the font
Packit 352660
  capability      String  List of layout capabilities in the font
Packit 352660
  fontformat      String  String name of the font format
Packit 352660
  embolden        Bool    Rasterizer should synthetically embolden the font
Packit 352660
  embeddedbitmap  Bool    Use the embedded bitmap instead of the outline
Packit 352660
  decorative      Bool    Whether the style is a decorative variant
Packit 352660
  fontfeatures    String  List of the feature tags in OpenType to be enabled
Packit 352660
  namelang        String  Language name to be used for the default value of
Packit 352660
                          familylang, stylelang, and fullnamelang
Packit 352660
  prgname         String  String  Name of the running program
Packit 352660
  postscriptname  String  Font family name in PostScript
Packit 352660
    </programlisting>
Packit 352660
  </refsect2>
Packit 352660
  <refsect2>
Packit 352660
  <title>Font Matching</title>
Packit 352660
    <para>
Packit 352660
Fontconfig performs matching by measuring the distance from a provided
Packit 352660
pattern to all of the available fonts in the system.  The closest matching
Packit 352660
font is selected.  This ensures that a font will always be returned, but
Packit 352660
doesn't ensure that it is anything like the requested pattern.
Packit 352660
    </para><para> 
Packit 352660
Font matching starts with an application constructed pattern.  The desired
Packit 352660
attributes of the resulting font are collected together in a pattern.  Each
Packit 352660
property of the pattern can contain one or more values; these are listed in
Packit 352660
priority order; matches earlier in the list are considered "closer" than
Packit 352660
matches later in the list.
Packit 352660
    </para><para>
Packit 352660
The initial pattern is modified by applying the list of editing instructions
Packit 352660
specific to patterns found in the configuration; each consists of a match
Packit 352660
predicate and a set of editing operations.  They are executed in the order
Packit 352660
they appeared in the configuration.  Each match causes the associated
Packit 352660
sequence of editing operations to be applied.
Packit 352660
    </para><para>
Packit 352660
After the pattern has been edited, a sequence of default substitutions are
Packit 352660
performed to canonicalize the set of available properties; this avoids the
Packit 352660
need for the lower layers to constantly provide default values for various
Packit 352660
font properties during rendering.
Packit 352660
    </para><para>
Packit 352660
The canonical font pattern is finally matched against all available fonts.
Packit 352660
The distance from the pattern to the font is measured for each of several
Packit 352660
properties: foundry, charset, family, lang, spacing, pixelsize, style,
Packit 352660
slant, weight, antialias, rasterizer and outline.  This list is in priority
Packit 352660
order -- results of comparing earlier elements of this list weigh more
Packit 352660
heavily than later elements.
Packit 352660
    </para><para>
Packit 352660
There is one special case to this rule; family names are split into two
Packit 352660
bindings; strong and weak.  Strong family names are given greater precedence
Packit 352660
in the match than lang elements while weak family names are given lower
Packit 352660
precedence than lang elements.  This permits the document language to drive
Packit 352660
font selection when any document specified font is unavailable.
Packit 352660
    </para><para>
Packit 352660
The pattern representing that font is augmented to include any properties
Packit 352660
found in the pattern but not found in the font itself; this permits the
Packit 352660
application to pass rendering instructions or any other data through the
Packit 352660
matching system.  Finally, the list of editing instructions specific to
Packit 352660
fonts found in the configuration are applied to the pattern.  This modified
Packit 352660
pattern is returned to the application.
Packit 352660
    </para><para>
Packit 352660
The return value contains sufficient information to locate and rasterize the
Packit 352660
font, including the file name, pixel size and other rendering data.  As
Packit 352660
none of the information involved pertains to the FreeType library,
Packit 352660
applications are free to use any rasterization engine or even to take
Packit 352660
the identified font file and access it directly.
Packit 352660
    </para><para>
Packit 352660
The match/edit sequences in the configuration are performed in two passes
Packit 352660
because there are essentially two different operations necessary -- the
Packit 352660
first is to modify how fonts are selected; aliasing families and adding
Packit 352660
suitable defaults.  The second is to modify how the selected fonts are
Packit 352660
rasterized.  Those must apply to the selected font, not the original pattern
Packit 352660
as false matches will often occur.
Packit 352660
    </para>
Packit 352660
  </refsect2>
Packit 352660
  <refsect2><title>Font Names</title>
Packit 352660
    <para>
Packit 352660
Fontconfig provides a textual representation for patterns that the library
Packit 352660
can both accept and generate.  The representation is in three parts, first a
Packit 352660
list of family names, second a list of point sizes and finally a list of
Packit 352660
additional properties:
Packit 352660
    </para>
Packit 352660
    <programlisting>
Packit 352660
	<families>-<point sizes>:<name1>=<values1>:<name2>=<values2>...
Packit 352660
    </programlisting>
Packit 352660
    <para>
Packit 352660
Values in a list are separated with commas.  The name needn't include either
Packit 352660
families or point sizes; they can be elided.  In addition, there are
Packit 352660
symbolic constants that simultaneously indicate both a name and a value.
Packit 352660
Here are some examples:
Packit 352660
    </para>
Packit 352660
    <programlisting>
Packit 352660
  Name                            Meaning
Packit 352660
  ----------------------------------------------------------
Packit 352660
  Times-12                        12 point Times Roman
Packit 352660
  Times-12:bold                   12 point Times Bold
Packit 352660
  Courier:italic                  Courier Italic in the default size
Packit 352660
  Monospace:matrix=1 .1 0 1       The users preferred monospace font
Packit 352660
                                  with artificial obliquing
Packit 352660
    </programlisting>
Packit 352660
    <para>
Packit 352660
The '\', '-', ':' and ',' characters in family names must be preceded by a
Packit 352660
'\' character to avoid having them misinterpreted. Similarly, values
Packit 352660
containing '\', '=', '_', ':' and ',' must also have them preceded by a
Packit 352660
'\' character. The '\' characters are stripped out of the family name and
Packit 352660
values as the font name is read.
Packit 352660
    </para>
Packit 352660
  </refsect2>
Packit 352660
</refsect1>
Packit 352660
<refsect1 id="debug"><title>Debugging Applications</title>
Packit 352660
  <para>
Packit 352660
To help diagnose font and applications problems, fontconfig is built with a
Packit 352660
large amount of internal debugging left enabled. It is controlled by means
Packit 352660
of the FC_DEBUG environment variable. The value of this variable is
Packit 352660
interpreted as a number, and each bit within that value controls different
Packit 352660
debugging messages.
Packit 352660
  </para>
Packit 352660
  <programlisting>
Packit 352660
  Name         Value    Meaning
Packit 352660
  ---------------------------------------------------------
Packit 352660
  MATCH            1    Brief information about font matching
Packit 352660
  MATCHV           2    Extensive font matching information
Packit 352660
  EDIT             4    Monitor match/test/edit execution
Packit 352660
  FONTSET          8    Track loading of font information at startup
Packit 352660
  CACHE           16    Watch cache files being written
Packit 352660
  CACHEV          32    Extensive cache file writing information
Packit 352660
  PARSE           64    (no longer in use)
Packit 352660
  SCAN           128    Watch font files being scanned to build caches
Packit 352660
  SCANV          256    Verbose font file scanning information
Packit 352660
  MEMORY         512    Monitor fontconfig memory usage
Packit 352660
  CONFIG        1024    Monitor which config files are loaded
Packit 352660
  LANGSET       2048    Dump char sets used to construct lang values
Packit 352660
  MATCH2        4096    Display font-matching transformation in patterns
Packit 352660
  </programlisting>
Packit 352660
  <para>
Packit 352660
Add the value of the desired debug levels together and assign that (in
Packit 352660
base 10) to the FC_DEBUG environment variable before running the
Packit 352660
application. Output from these statements is sent to stdout.
Packit 352660
  </para>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>Lang Tags</title>
Packit 352660
  <para>
Packit 352660
Each font in the database contains a list of languages it supports.  This is
Packit 352660
computed by comparing the Unicode coverage of the font with the orthography
Packit 352660
of each language.  Languages are tagged using an RFC-3066 compatible naming
Packit 352660
and occur in two parts -- the ISO 639 language tag followed a hyphen and then
Packit 352660
by the ISO 3166 country code.  The hyphen and country code may be elided.
Packit 352660
  </para><para>
Packit 352660
Fontconfig has orthographies for several languages built into the library.
Packit 352660
No provision has been made for adding new ones aside from rebuilding the
Packit 352660
library.  It currently supports 122 of the 139 languages named in ISO 639-1,
Packit 352660
141 of the languages with two-letter codes from ISO 639-2 and another 30
Packit 352660
languages with only three-letter codes.  Languages with both two and three
Packit 352660
letter codes are provided with only the two letter code.
Packit 352660
  </para><para>
Packit 352660
For languages used in multiple territories with radically different
Packit 352660
character sets, fontconfig includes per-territory orthographies.  This
Packit 352660
includes Azerbaijani, Kurdish, Pashto, Tigrinya and Chinese.
Packit 352660
  </para>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>Configuration File Format</title>
Packit 352660
  <para>
Packit 352660
Configuration files for fontconfig are stored in XML format; this
Packit 352660
format makes external configuration tools easier to write and ensures that
Packit 352660
they will generate syntactically correct configuration files.  As XML
Packit 352660
files are plain text, they can also be manipulated by the expert user using
Packit 352660
a text editor.
Packit 352660
  </para><para>
Packit 352660
The fontconfig document type definition resides in the external entity
Packit 352660
"fonts.dtd"; this is normally stored in the default font configuration
Packit 352660
directory (&confdir;).  Each configuration file should contain the
Packit 352660
following structure:
Packit 352660
    <programlisting>
Packit 352660
	<?xml version="1.0"?>
Packit 352660
	<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
Packit 352660
	<fontconfig>
Packit 352660
	...
Packit 352660
	</fontconfig>
Packit 352660
    </programlisting>
Packit 352660
  </para>
Packit 352660
<refsect2><title><literal><fontconfig></literal></title><para>
Packit 352660
This is the top level element for a font configuration and can contain
Packit 352660
<literal><dir></literal>, <literal><cachedir></literal>, <literal><include></literal>, <literal><match></literal> and <literal><alias></literal> elements in any order.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><dir prefix="default"></literal></title><para>
Packit 352660
This element contains a directory name which will be scanned for font files
Packit 352660
to include in the set of available fonts. If 'prefix' is set to "xdg", the value in the XDG_DATA_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><cachedir prefix="default"></literal></title><para>
Packit 352660
This element contains a directory name that is supposed to be stored or read
Packit 352660
the cache of font information.  If multiple elements are specified in
Packit 352660
the configuration file, the directory that can be accessed first in the list
Packit 352660
will be used to store the cache files.  If it starts with '~', it refers to
Packit 352660
a directory in the users home directory.  If 'prefix' is set to "xdg", the value in the XDG_CACHE_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
Packit 352660
The default directory is ``$XDG_CACHE_HOME/fontconfig'' and it contains the cache files
Packit 352660
named ``<literal><hash value></literal>-<literal><architecture></literal>.cache-<literal><version></literal>'',
Packit 352660
where <literal><version></literal> is the fontconfig cache file
Packit 352660
version number (currently 7).
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><include ignore_missing="no" prefix="default"></literal></title><para>
Packit 352660
This element contains the name of an additional configuration file or
Packit 352660
directory.  If a directory, every file within that directory starting with an
Packit 352660
ASCII digit (U+0030 - U+0039) and ending with the string ``.conf'' will be processed in sorted order.  When
Packit 352660
the XML datatype is traversed by FcConfigParse, the contents of the file(s)
Packit 352660
will also be incorporated into the configuration by passing the filename(s) to
Packit 352660
FcConfigLoadAndParse.  If 'ignore_missing' is set to "yes" instead of the
Packit 352660
default "no", a missing file or directory will elicit no warning message from
Packit 352660
the library.  If 'prefix' is set to "xdg", the value in the XDG_CONFIG_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><config></literal></title><para>
Packit 352660
This element provides a place to consolidate additional configuration
Packit 352660
information.  <literal><config></literal> can contain <literal><blank></literal> and <literal><rescan></literal> elements in any
Packit 352660
order.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><blank></literal></title><para>
Packit 352660
Fonts often include "broken" glyphs which appear in the encoding but are
Packit 352660
drawn as blanks on the screen.  Within the <literal><blank></literal> element, place each
Packit 352660
Unicode characters which is supposed to be blank in an <literal><int></literal> element.
Packit 352660
Characters outside of this set which are drawn as blank will be elided from
Packit 352660
the set of characters supported by the font.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><rescan></literal></title><para>
Packit 352660
The <literal><rescan></literal> element holds an <literal><int></literal> element which indicates the default
Packit 352660
interval between automatic checks for font configuration changes.
Packit 352660
Fontconfig will validate all of the configuration files and directories and
Packit 352660
automatically rebuild the internal datastructures when this interval passes.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><selectfont></literal></title><para>
Packit 352660
This element is used to black/white list fonts from being listed or matched
Packit 352660
against.  It holds acceptfont and rejectfont elements.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><acceptfont></literal></title><para>
Packit 352660
Fonts matched by an acceptfont element are "whitelisted"; such fonts are
Packit 352660
explicitly included in the set of fonts used to resolve list and match
Packit 352660
requests; including them in this list protects them from being "blacklisted"
Packit 352660
by a rejectfont element.  Acceptfont elements include glob and pattern
Packit 352660
elements which are used to match fonts.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><rejectfont></literal></title><para>
Packit 352660
Fonts matched by an rejectfont element are "blacklisted"; such fonts are
Packit 352660
excluded from the set of fonts used to resolve list and match requests as if
Packit 352660
they didn't exist in the system.  Rejectfont elements include glob and
Packit 352660
pattern elements which are used to match fonts.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><glob></literal></title><para>
Packit 352660
Glob elements hold shell-style filename matching patterns (including ? and
Packit 352660
*) which match fonts based on their complete pathnames.  This can be used to
Packit 352660
exclude a set of directories (/usr/share/fonts/uglyfont*), or particular
Packit 352660
font file types (*.pcf.gz), but the latter mechanism relies rather heavily
Packit 352660
on filenaming conventions which can't be relied upon.  Note that globs
Packit 352660
only apply to directories, not to individual fonts.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><pattern></literal></title><para>
Packit 352660
Pattern elements perform list-style matching on incoming fonts; that is,
Packit 352660
they hold a list of elements and associated values.  If all of those
Packit 352660
elements have a matching value, then the pattern matches the font.  This can
Packit 352660
be used to select fonts based on attributes of the font (scalable, bold,
Packit 352660
etc), which is a more reliable mechanism than using file extensions.
Packit 352660
Pattern elements include patelt elements.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><patelt name="property"></literal></title><para>
Packit 352660
Patelt elements hold a single pattern element and list of values.  They must
Packit 352660
have a 'name' attribute which indicates the pattern element name.  Patelt
Packit 352660
elements include int, double, string, matrix, bool, charset and const
Packit 352660
elements.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><match target="pattern"></literal></title><para>
Packit 352660
This element holds first a (possibly empty) list of <literal><test></literal> elements and then
Packit 352660
a (possibly empty) list of <literal><edit></literal> elements.  Patterns which match all of the
Packit 352660
tests are subjected to all the edits.  If 'target' is set to "font" instead
Packit 352660
of the default "pattern", then this element applies to the font name
Packit 352660
resulting from a match rather than a font pattern to be matched. If 'target'
Packit 352660
is set to "scan", then this element applies when the font is scanned to
Packit 352660
build the fontconfig database.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><test qual="any" name="property" target="default" compare="eq"></literal></title><para>
Packit 352660
This element contains a single value which is compared with the target
Packit 352660
('pattern', 'font', 'scan' or 'default') property "property" (substitute any of the property names seen 
Packit 352660
above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", "more_eq", "contains" or
Packit 352660
"not_contains".  'qual' may either be the default, "any", in which case the match
Packit 352660
succeeds if any value associated with the property matches the test value, or
Packit 352660
"all", in which case all of the values associated with the property must
Packit 352660
match the test value.  'ignore-blanks' takes a boolean value. if 'ignore-blanks' is set "true", any blanks in the string will be ignored on its comparison. this takes effects only when compare="eq" or compare="not_eq".
Packit 352660
When used in a <match target="font"> element,
Packit 352660
the target= attribute in the <test> element selects between matching
Packit 352660
the original pattern or the font.  "default" selects whichever target the
Packit 352660
outer <match> element has selected.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><edit name="property" mode="assign" binding="weak"></literal></title><para>
Packit 352660
This element contains a list of expression elements (any of the value or
Packit 352660
operator elements).  The expression elements are evaluated at run-time and
Packit 352660
modify the property "property".  The modification depends on whether
Packit 352660
"property" was matched by one of the associated <literal><test></literal> elements, if so, the
Packit 352660
modification may affect the first matched value.  Any values inserted into
Packit 352660
the property are given the indicated binding ("strong", "weak" or "same")
Packit 352660
with "same" binding using the value from the matched pattern element.
Packit 352660
'mode' is one of:
Packit 352660
    <programlisting>
Packit 352660
  Mode                    With Match              Without Match
Packit 352660
  ---------------------------------------------------------------------
Packit 352660
  "assign"                Replace matching value  Replace all values
Packit 352660
  "assign_replace"        Replace all values      Replace all values
Packit 352660
  "prepend"               Insert before matching  Insert at head of list
Packit 352660
  "prepend_first"         Insert at head of list  Insert at head of list
Packit 352660
  "append"                Append after matching   Append at end of list
Packit 352660
  "append_last"           Append at end of list   Append at end of list
Packit 352660
  "delete"                Delete matching value   Delete all values
Packit 352660
  "delete_all"            Delete all values       Delete all values
Packit 352660
    </programlisting>
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><int></literal>, <literal><double></literal>, <literal><string></literal>, <literal><bool></literal></title><para>
Packit 352660
These elements hold a single value of the indicated type.  <literal><bool></literal>
Packit 352660
elements hold either true or false.  An important limitation exists in
Packit 352660
the parsing of floating point numbers -- fontconfig requires that
Packit 352660
the mantissa start with a digit, not a decimal point, so insert a leading
Packit 352660
zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
Packit 352660
instead of -.5).
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><matrix></literal></title><para>
Packit 352660
This element holds four numerical expressions of an affine transformation.
Packit 352660
At their simplest these will be four <literal><double></literal> elements
Packit 352660
but they can also be more involved expressions.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><range></literal></title><para>
Packit 352660
This element holds the two <literal><int></literal> elements of a range
Packit 352660
representation.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><charset></literal></title><para>
Packit 352660
This element holds at least one <literal><int></literal> element of
Packit 352660
an Unicode code point or more.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><langset></literal></title><para>
Packit 352660
This element holds at least one <literal><string></literal> element of
Packit 352660
a RFC-3066-style languages or more.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><name></literal></title><para>
Packit 352660
Holds a property name.  Evaluates to the first value from the property of
Packit 352660
the pattern.  If the 'target' attribute is not present, it will default to
Packit 352660
'default', in which case the property is returned from the font pattern
Packit 352660
during a target="font" match, and to the pattern during a target="pattern"
Packit 352660
match.  The attribute can also take the values 'font' or 'pattern' to
Packit 352660
explicitly choose which pattern to use.  It is an error to use a target
Packit 352660
of 'font' in a match that has target="pattern".
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><const></literal></title><para>
Packit 352660
Holds the name of a constant; these are always integers and serve as
Packit 352660
symbolic names for common font values:
Packit 352660
    <programlisting>
Packit 352660
  Constant        Property        Value
Packit 352660
  -------------------------------------
Packit 352660
  thin            weight          0
Packit 352660
  extralight      weight          40
Packit 352660
  ultralight      weight          40
Packit 352660
  light           weight          50
Packit 352660
  demilight       weight          55
Packit 352660
  semilight       weight          55
Packit 352660
  book            weight          75
Packit 352660
  regular         weight          80
Packit 352660
  normal          weight          80
Packit 352660
  medium          weight          100
Packit 352660
  demibold        weight          180
Packit 352660
  semibold        weight          180
Packit 352660
  bold            weight          200
Packit 352660
  extrabold       weight          205
Packit 352660
  black           weight          210
Packit 352660
  heavy           weight          210
Packit 352660
  roman           slant           0
Packit 352660
  italic          slant           100
Packit 352660
  oblique         slant           110
Packit 352660
  ultracondensed  width           50
Packit 352660
  extracondensed  width           63
Packit 352660
  condensed       width           75
Packit 352660
  semicondensed   width           87
Packit 352660
  normal          width           100
Packit 352660
  semiexpanded    width           113
Packit 352660
  expanded        width           125
Packit 352660
  extraexpanded   width           150
Packit 352660
  ultraexpanded   width           200
Packit 352660
  proportional    spacing         0
Packit 352660
  dual            spacing         90
Packit 352660
  mono            spacing         100
Packit 352660
  charcell        spacing         110
Packit 352660
  unknown         rgba            0
Packit 352660
  rgb             rgba            1
Packit 352660
  bgr             rgba            2
Packit 352660
  vrgb            rgba            3
Packit 352660
  vbgr            rgba            4
Packit 352660
  none            rgba            5
Packit 352660
  lcdnone         lcdfilter       0
Packit 352660
  lcddefault      lcdfilter       1
Packit 352660
  lcdlight        lcdfilter       2
Packit 352660
  lcdlegacy       lcdfilter       3
Packit 352660
  hintnone        hintstyle       0
Packit 352660
  hintslight      hintstyle       1
Packit 352660
  hintmedium      hintstyle       2
Packit 352660
  hintfull        hintstyle       3
Packit 352660
    </programlisting>
Packit 352660
      </para>
Packit 352660
    </refsect2>
Packit 352660
  <refsect2>
Packit 352660
      <title><literal><or></literal>, <literal><and></literal>, <literal><plus></literal>, <literal><minus></literal>, <literal><times></literal>, <literal><divide></literal></title>
Packit 352660
      <para>
Packit 352660
These elements perform the specified operation on a list of expression
Packit 352660
elements.  <literal><or></literal> and <literal><and></literal> are boolean, not bitwise.
Packit 352660
      </para>
Packit 352660
    </refsect2>
Packit 352660
  <refsect2>
Packit 352660
    <title><literal><eq></literal>, <literal><not_eq></literal>, <literal><less></literal>, <literal><less_eq></literal>, <literal><more></literal>, <literal><more_eq></literal>, <literal><contains></literal>, <literal><not_contains</literal></title>
Packit 352660
    <para>
Packit 352660
These elements compare two values, producing a boolean result.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><not></literal></title><para>
Packit 352660
Inverts the boolean sense of its one expression element
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><if></literal></title><para>
Packit 352660
This element takes three expression elements; if the value of the first is
Packit 352660
true, it produces the value of the second, otherwise it produces the value
Packit 352660
of the third.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><alias></literal></title><para>
Packit 352660
Alias elements provide a shorthand notation for the set of common match
Packit 352660
operations needed to substitute one font family for another.  They contain a
Packit 352660
<literal><family></literal> element followed by optional <literal><prefer></literal>, <literal><accept></literal> and <literal><default></literal>
Packit 352660
elements.  Fonts matching the <literal><family></literal> element are edited to prepend the
Packit 352660
list of <literal><prefer></literal>ed families before the matching <literal><family></literal>, append the
Packit 352660
<literal><accept></literal>able families after the matching <literal><family></literal> and append the <literal><default></literal>
Packit 352660
families to the end of the family list.
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><family></literal></title><para>
Packit 352660
Holds a single font family name
Packit 352660
  </para></refsect2>
Packit 352660
  <refsect2><title><literal><prefer></literal>, <literal><accept></literal>, <literal><default></literal></title><para>
Packit 352660
These hold a list of <literal><family></literal> elements to be used by the <literal><alias></literal> element.
Packit 352660
  </para></refsect2>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>EXAMPLE CONFIGURATION FILE</title>
Packit 352660
  <refsect2><title>System configuration file</title>
Packit 352660
    <para>
Packit 352660
This is an example of a system-wide configuration file
Packit 352660
    </para>
Packit 352660
    <programlisting>
Packit 352660
<?xml version="1.0"?>
Packit 352660
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
Packit 352660
<!-- &confdir;/fonts.conf file to configure system font access -->
Packit 352660
<fontconfig>
Packit 352660
<!-- 
Packit 352660
	Find fonts in these directories
Packit 352660
-->
Packit 352660
<dir>/usr/share/fonts</dir>
Packit 352660
<dir>/usr/X11R6/lib/X11/fonts</dir>
Packit 352660
Packit 352660
<!--
Packit 352660
	Accept deprecated 'mono' alias, replacing it with 'monospace'
Packit 352660
-->
Packit 352660
<match target="pattern">
Packit 352660
	<test qual="any" name="family"><string>mono</string></test>
Packit 352660
	<edit name="family" mode="assign"><string>monospace</string></edit>
Packit 352660
</match>
Packit 352660
Packit 352660
<!--
Packit 352660
	Names not including any well known alias are given 'sans-serif'
Packit 352660
-->
Packit 352660
<match target="pattern">
Packit 352660
	<test qual="all" name="family" compare="not_eq"><string>sans-serif</string></test>
Packit 352660
	<test qual="all" name="family" compare="not_eq"><string>serif</string></test>
Packit 352660
	<test qual="all" name="family" compare="not_eq"><string>monospace</string></test>
Packit 352660
	<edit name="family" mode="append_last"><string>sans-serif</string></edit>
Packit 352660
</match>
Packit 352660
Packit 352660
<!--
Packit 352660
	Load per-user customization file, but don't complain
Packit 352660
	if it doesn't exist
Packit 352660
-->
Packit 352660
<include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>
Packit 352660
Packit 352660
<!--
Packit 352660
	Load local customization files, but don't complain
Packit 352660
	if there aren't any
Packit 352660
-->
Packit 352660
<include ignore_missing="yes">conf.d</include>
Packit 352660
<include ignore_missing="yes">local.conf</include>
Packit 352660
Packit 352660
<!--
Packit 352660
	Alias well known font names to available TrueType fonts.
Packit 352660
	These substitute TrueType faces for similar Type1
Packit 352660
	faces to improve screen appearance.
Packit 352660
-->
Packit 352660
<alias>
Packit 352660
	<family>Times</family>
Packit 352660
	<prefer><family>Times New Roman</family></prefer>
Packit 352660
	<default><family>serif</family></default>
Packit 352660
</alias>
Packit 352660
<alias>
Packit 352660
	<family>Helvetica</family>
Packit 352660
	<prefer><family>Arial</family></prefer>
Packit 352660
	<default><family>sans</family></default>
Packit 352660
</alias>
Packit 352660
<alias>
Packit 352660
	<family>Courier</family>
Packit 352660
	<prefer><family>Courier New</family></prefer>
Packit 352660
	<default><family>monospace</family></default>
Packit 352660
</alias>
Packit 352660
Packit 352660
<!--
Packit 352660
	Provide required aliases for standard names
Packit 352660
	Do these after the users configuration file so that
Packit 352660
	any aliases there are used preferentially
Packit 352660
-->
Packit 352660
<alias>
Packit 352660
	<family>serif</family>
Packit 352660
	<prefer><family>Times New Roman</family></prefer>
Packit 352660
</alias>
Packit 352660
<alias>
Packit 352660
	<family>sans</family>
Packit 352660
	<prefer><family>Arial</family></prefer>
Packit 352660
</alias>
Packit 352660
<alias>
Packit 352660
	<family>monospace</family>
Packit 352660
	<prefer><family>Andale Mono</family></prefer>
Packit 352660
</alias>
Packit 352660
Packit 352660
<--
Packit 352660
	The example of the requirements of OR operator;
Packit 352660
	If the 'family' contains 'Courier New' OR 'Courier'
Packit 352660
	add 'monospace' as the alternative
Packit 352660
-->
Packit 352660
<match target="pattern">
Packit 352660
	<test name="family" compare="eq">
Packit 352660
		<string>Courier New</string>
Packit 352660
	</test>
Packit 352660
	<edit name="family" mode="prepend">
Packit 352660
		<string>monospace</string>
Packit 352660
	</edit>
Packit 352660
</match>
Packit 352660
<match target="pattern">
Packit 352660
	<test name="family" compare="eq">
Packit 352660
		<string>Courier</string>
Packit 352660
	</test>
Packit 352660
	<edit name="family" mode="prepend">
Packit 352660
		<string>monospace</string>
Packit 352660
	</edit>
Packit 352660
</match>
Packit 352660
Packit 352660
</fontconfig>
Packit 352660
    </programlisting>
Packit 352660
  </refsect2>
Packit 352660
  <refsect2><title>User configuration file</title>
Packit 352660
    <para>
Packit 352660
This is an example of a per-user configuration file that lives in
Packit 352660
$XDG_CONFIG_HOME/fontconfig/fonts.conf
Packit 352660
    </para>
Packit 352660
    <programlisting>
Packit 352660
<?xml version="1.0"?>
Packit 352660
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
Packit 352660
<!-- $XDG_CONFIG_HOME/fontconfig/fonts.conf for per-user font configuration -->
Packit 352660
<fontconfig>
Packit 352660
Packit 352660
<!--
Packit 352660
	Private font directory
Packit 352660
-->
Packit 352660
<dir prefix="xdg">fonts</dir>
Packit 352660
Packit 352660
<!--
Packit 352660
	use rgb sub-pixel ordering to improve glyph appearance on
Packit 352660
	LCD screens.  Changes affecting rendering, but not matching
Packit 352660
	should always use target="font".
Packit 352660
-->
Packit 352660
<match target="font">
Packit 352660
	<edit name="rgba" mode="assign"><const>rgb</const></edit>
Packit 352660
</match>
Packit 352660
<!--
Packit 352660
	use WenQuanYi Zen Hei font when serif is requested for Chinese
Packit 352660
-->
Packit 352660
<match>
Packit 352660
	<!--
Packit 352660
		If you don't want to use WenQuanYi Zen Hei font for zh-tw etc,
Packit 352660
		you can use zh-cn instead of zh.
Packit 352660
		Please note, even if you set zh-cn, it still matches zh.
Packit 352660
		if you don't like it, you can use compare="eq"
Packit 352660
		instead of compare="contains".
Packit 352660
	-->
Packit 352660
	<test name="lang" compare="contains">
Packit 352660
		<string>zh</string>
Packit 352660
	</test>
Packit 352660
	<test name="family">
Packit 352660
		<string>serif</string>
Packit 352660
	</test>
Packit 352660
	<edit name="family" mode="prepend">
Packit 352660
		<string>WenQuanYi Zen Hei</string>
Packit 352660
	</edit>
Packit 352660
</match>
Packit 352660
<!--
Packit 352660
	use VL Gothic font when sans-serif is requested for Japanese
Packit 352660
-->
Packit 352660
<match>
Packit 352660
	<test name="lang" compare="contains">
Packit 352660
		<string>ja</string>
Packit 352660
	</test>
Packit 352660
	<test name="family">
Packit 352660
		<string>sans-serif</string>
Packit 352660
	</test>
Packit 352660
	<edit name="family" mode="prepend">
Packit 352660
		<string>VL Gothic</string>
Packit 352660
	</edit>
Packit 352660
</match>
Packit 352660
</fontconfig>
Packit 352660
    </programlisting>
Packit 352660
  </refsect2>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>Files</title>
Packit 352660
  <para>
Packit 352660
<emphasis>fonts.conf</emphasis>
Packit 352660
contains configuration information for the fontconfig library
Packit 352660
consisting of directories to look at for font information as well as
Packit 352660
instructions on editing program specified font patterns before attempting to
Packit 352660
match the available fonts.  It is in XML format.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>conf.d</emphasis>
Packit 352660
is the conventional name for a directory of additional configuration files
Packit 352660
managed by external applications or the local administrator.  The
Packit 352660
filenames starting with decimal digits are sorted in lexicographic order
Packit 352660
and used as additional configuration files.  All of these files are in XML
Packit 352660
format.  The master fonts.conf file references this directory in an 
Packit 352660
<include> directive.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>fonts.dtd</emphasis>
Packit 352660
is a DTD that describes the format of the configuration files.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>$XDG_CONFIG_HOME/fontconfig/conf.d</emphasis> and <emphasis>~/.fonts.conf.d</emphasis>
Packit 352660
is the conventional name for a per-user directory of (typically
Packit 352660
auto-generated) configuration files, although the
Packit 352660
actual location is specified in the global fonts.conf file. please note that ~/.fonts.conf.d is deprecated now. it will not be read by default in the future version.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>$XDG_CONFIG_HOME/fontconfig/fonts.conf</emphasis> and <emphasis>~/.fonts.conf</emphasis>
Packit 352660
is the conventional location for per-user font configuration, although the
Packit 352660
actual location is specified in the global fonts.conf file. please note that ~/.fonts.conf is deprecated now. it will not be read by default in the future version.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>$XDG_CACHE_HOME/fontconfig/*.cache-*</emphasis> and <emphasis> ~/.fontconfig/*.cache-*</emphasis>
Packit 352660
is the conventional repository of font information that isn't found in the
Packit 352660
per-directory caches.  This file is automatically maintained by fontconfig. please note that ~/.fontconfig/*.cache-* is deprecated now. it will not be read by default in the future version.
Packit 352660
  </para>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>Environment variables</title>
Packit 352660
  <para>
Packit 352660
<emphasis>FONTCONFIG_FILE</emphasis>
Packit 352660
is used to override the default configuration file.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>FONTCONFIG_PATH</emphasis>
Packit 352660
is used to override the default configuration directory.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>FONTCONFIG_SYSROOT</emphasis>
Packit 352660
is used to set a default sysroot directory.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>FC_DEBUG</emphasis>
Packit 352660
is used to output the detailed debugging messages. see <link linkend="debug">Debugging Applications</link> section for more details.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>FC_DBG_MATCH_FILTER</emphasis>
Packit 352660
is used to filter out the patterns. this takes a comma-separated list of object names and effects only when FC_DEBUG has MATCH2. see <link linkend="debug">Debugging Applications</link> section for more details.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>FC_LANG</emphasis>
Packit 352660
is used to specify the default language as the weak binding in the query. if this isn't set, the default language will be determined from current locale.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>FONTCONFIG_USE_MMAP</emphasis>
Packit 352660
is used to control the use of mmap(2) for the cache files if available. this take a boolean value. fontconfig will checks if the cache files are stored on the filesystem that is safe to use mmap(2). explicitly setting this environment variable will causes skipping this check and enforce to use or not use mmap(2) anyway.
Packit 352660
  </para>
Packit 352660
  <para>
Packit 352660
<emphasis>SOURCE_DATE_EPOCH</emphasis>
Packit 352660
is used to ensure <literal>fc-cache(1)</literal> generates files in a deterministic manner in order to support reproducible builds. When set to a numeric representation of UNIX timestamp, fontconfig will prefer this value over using the modification timestamps of the input files in order to identify which cache files require regeneration. If <literal>SOURCE_DATE_EPOCH</literal> is not set (or is newer than the mtime of the directory), the existing behaviour is unchanged.
Packit 352660
  </para>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>See Also</title>
Packit 352660
  <para>
Packit 352660
fc-cat(1), fc-cache(1), fc-list(1), fc-match(1), fc-query(1), <ulink url="https://reproducible-builds.org/specs/source-date-epoch/">SOURCE_DATE_EPOCH</ulink>.
Packit 352660
  </para>
Packit 352660
</refsect1>
Packit 352660
<refsect1><title>Version</title>
Packit 352660
	    <para>
Packit 352660
Fontconfig version &version;
Packit 352660
	    </para>
Packit 352660
</refsect1>
Packit 352660
</refentry>