fontconfig-user.html revision 2c393a42
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2<HTML
3><HEAD
4><TITLE
5>fonts-conf</TITLE
6><META
7NAME="GENERATOR"
8CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD
9><BODY
10CLASS="REFENTRY"
11BGCOLOR="#FFFFFF"
12TEXT="#000000"
13LINK="#0000FF"
14VLINK="#840084"
15ALINK="#0000FF"
16><H1
17><A
18NAME="AEN1"
19></A
20>fonts-conf</H1
21><DIV
22CLASS="REFNAMEDIV"
23><A
24NAME="AEN5"
25></A
26><H2
27>Name</H2
28>fonts.conf&nbsp;--&nbsp;Font configuration files</DIV
29><DIV
30CLASS="REFSYNOPSISDIV"
31><A
32NAME="AEN8"
33></A
34><H2
35>Synopsis</H2
36><PRE
37CLASS="SYNOPSIS"
38>   /etc/fonts/fonts.conf
39   /etc/fonts/fonts.dtd
40   /etc/fonts/conf.d
41   ~/.fonts.conf</PRE
42></DIV
43><DIV
44CLASS="REFSECT1"
45><A
46NAME="AEN10"
47></A
48><H2
49>Description</H2
50><P
51>Fontconfig is a library designed to provide system-wide font configuration,
52customization and application access.
53  </P
54></DIV
55><DIV
56CLASS="REFSECT1"
57><A
58NAME="AEN13"
59></A
60><H2
61>Functional Overview</H2
62><P
63>Fontconfig contains two essential modules, the configuration module which
64builds an internal configuration from XML files and the matching module
65which accepts font patterns and returns the nearest matching font.
66  </P
67><DIV
68CLASS="REFSECT2"
69><A
70NAME="AEN16"
71></A
72><H3
73>Font Configuration</H3
74><P
75>The configuration module consists of the FcConfig datatype, libexpat and
76FcConfigParse which walks over an XML tree and amends a configuration with
77data found within.  From an external perspective, configuration of the
78library consists of generating a valid XML tree and feeding that to
79FcConfigParse.  The only other mechanism provided to applications for
80changing the running configuration is to add fonts and directories to the
81list of application-provided font files.  
82    </P
83><P
84>The intent is to make font configurations relatively static, and shared by
85as many applications as possible.  It is hoped that this will lead to more
86stable font selection when passing names from one application to another.
87XML was chosen as a configuration file format because it provides a format
88which is easy for external agents to edit while retaining the correct
89structure and syntax.
90    </P
91><P
92>Font configuration is separate from font matching; applications needing to
93do their own matching can access the available fonts from the library and
94perform private matching.  The intent is to permit applications to pick and
95choose appropriate functionality from the library instead of forcing them to
96choose between this library and a private configuration mechanism.  The hope
97is that this will ensure that configuration of fonts for all applications
98can be centralized in one place.  Centralizing font configuration will
99simplify and regularize font installation and customization.
100    </P
101></DIV
102><DIV
103CLASS="REFSECT2"
104><A
105NAME="AEN21"
106></A
107><H3
108>Font Properties</H3
109><P
110>While font patterns may contain essentially any properties, there are some
111well known properties with associated types.  Fontconfig uses some of these
112properties for font matching and font completion.  Others are provided as a
113convenience for the applications' rendering mechanism.
114    </P
115><PRE
116CLASS="PROGRAMLISTING"
117>  Property        Type    Description
118  --------------------------------------------------------------
119  family          String  Font family names
120  familylang      String  Languages corresponding to each family
121  style           String  Font style. Overrides weight and slant
122  stylelang       String  Languages corresponding to each style
123  fullname        String  Font full names (often includes style)
124  fullnamelang    String  Languages corresponding to each fullname
125  slant           Int     Italic, oblique or roman
126  weight          Int     Light, medium, demibold, bold or black
127  size            Double  Point size
128  width           Int     Condensed, normal or expanded
129  aspect          Double  Stretches glyphs horizontally before hinting
130  pixelsize       Double  Pixel size
131  spacing         Int     Proportional, dual-width, monospace or charcell
132  foundry         String  Font foundry name
133  antialias       Bool    Whether glyphs can be antialiased
134  hinting         Bool    Whether the rasterizer should use hinting
135  hintstyle       Int     Automatic hinting style
136  verticallayout  Bool    Use vertical layout
137  autohint        Bool    Use autohinter instead of normal hinter
138  globaladvance   Bool    Use font global advance data
139  file            String  The filename holding the font
140  index           Int     The index of the font within the file
141  ftface          FT_Face Use the specified FreeType face object
142  rasterizer      String  Which rasterizer is in use
143  outline         Bool    Whether the glyphs are outlines
144  scalable        Bool    Whether glyphs can be scaled
145  scale           Double  Scale factor for point-&#62;pixel conversions
146  dpi             Double  Target dots per inch
147  rgba            Int     unknown, rgb, bgr, vrgb, vbgr,
148                          none - subpixel geometry
149  lcdfilter       Int     Type of LCD filter
150  minspace        Bool    Eliminate leading from line spacing
151  charset         CharSet Unicode chars encoded by the font
152  lang            String  List of RFC-3066-style languages this
153                          font supports
154  fontversion     Int     Version number of the font
155  capability      String  List of layout capabilities in the font
156  embolden        Bool    Rasterizer should synthetically embolden the font
157    </PRE
158></DIV
159><DIV
160CLASS="REFSECT2"
161><A
162NAME="AEN25"
163></A
164><H3
165>Font Matching</H3
166><P
167>Fontconfig performs matching by measuring the distance from a provided
168pattern to all of the available fonts in the system.  The closest matching
169font is selected.  This ensures that a font will always be returned, but
170doesn't ensure that it is anything like the requested pattern.
171    </P
172><P
173> 
174Font matching starts with an application constructed pattern.  The desired
175attributes of the resulting font are collected together in a pattern.  Each
176property of the pattern can contain one or more values; these are listed in
177priority order; matches earlier in the list are considered "closer" than
178matches later in the list.
179    </P
180><P
181>The initial pattern is modified by applying the list of editing instructions
182specific to patterns found in the configuration; each consists of a match
183predicate and a set of editing operations.  They are executed in the order
184they appeared in the configuration.  Each match causes the associated
185sequence of editing operations to be applied.
186    </P
187><P
188>After the pattern has been edited, a sequence of default substitutions are
189performed to canonicalize the set of available properties; this avoids the
190need for the lower layers to constantly provide default values for various
191font properties during rendering.
192    </P
193><P
194>The canonical font pattern is finally matched against all available fonts.
195The distance from the pattern to the font is measured for each of several
196properties: foundry, charset, family, lang, spacing, pixelsize, style,
197slant, weight, antialias, rasterizer and outline.  This list is in priority
198order -- results of comparing earlier elements of this list weigh more
199heavily than later elements.
200    </P
201><P
202>There is one special case to this rule; family names are split into two
203bindings; strong and weak.  Strong family names are given greater precedence
204in the match than lang elements while weak family names are given lower
205precedence than lang elements.  This permits the document language to drive
206font selection when any document specified font is unavailable.
207    </P
208><P
209>The pattern representing that font is augmented to include any properties
210found in the pattern but not found in the font itself; this permits the
211application to pass rendering instructions or any other data through the
212matching system.  Finally, the list of editing instructions specific to
213fonts found in the configuration are applied to the pattern.  This modified
214pattern is returned to the application.
215    </P
216><P
217>The return value contains sufficient information to locate and rasterize the
218font, including the file name, pixel size and other rendering data.  As
219none of the information involved pertains to the FreeType library,
220applications are free to use any rasterization engine or even to take
221the identified font file and access it directly.
222    </P
223><P
224>The match/edit sequences in the configuration are performed in two passes
225because there are essentially two different operations necessary -- the
226first is to modify how fonts are selected; aliasing families and adding
227suitable defaults.  The second is to modify how the selected fonts are
228rasterized.  Those must apply to the selected font, not the original pattern
229as false matches will often occur.
230    </P
231></DIV
232><DIV
233CLASS="REFSECT2"
234><A
235NAME="AEN36"
236></A
237><H3
238>Font Names</H3
239><P
240>Fontconfig provides a textual representation for patterns that the library
241can both accept and generate.  The representation is in three parts, first a
242list of family names, second a list of point sizes and finally a list of
243additional properties:
244    </P
245><PRE
246CLASS="PROGRAMLISTING"
247>	&lt;families&gt;-&lt;point sizes&gt;:&lt;name1&gt;=&lt;values1&gt;:&lt;name2&gt;=&lt;values2&gt;...
248    </PRE
249><P
250>Values in a list are separated with commas.  The name needn't include either
251families or point sizes; they can be elided.  In addition, there are
252symbolic constants that simultaneously indicate both a name and a value.
253Here are some examples:
254    </P
255><PRE
256CLASS="PROGRAMLISTING"
257>  Name                            Meaning
258  ----------------------------------------------------------
259  Times-12                        12 point Times Roman
260  Times-12:bold                   12 point Times Bold
261  Courier:italic                  Courier Italic in the default size
262  Monospace:matrix=1 .1 0 1       The users preferred monospace font
263                                  with artificial obliquing
264    </PRE
265><P
266>The '\', '-', ':' and ',' characters in family names must be preceeded by a
267'\' character to avoid having them misinterpreted. Similarly, values
268containing '\', '=', '_', ':' and ',' must also have them preceeded by a
269'\' character. The '\' characters are stripped out of the family name and
270values as the font name is read.
271    </P
272></DIV
273></DIV
274><DIV
275CLASS="REFSECT1"
276><A
277NAME="AEN43"
278></A
279><H2
280>Debugging Applications</H2
281><P
282>To help diagnose font and applications problems, fontconfig is built with a
283large amount of internal debugging left enabled. It is controlled by means
284of the FC_DEBUG environment variable. The value of this variable is
285interpreted as a number, and each bit within that value controls different
286debugging messages.
287  </P
288><PRE
289CLASS="PROGRAMLISTING"
290>  Name         Value    Meaning
291  ---------------------------------------------------------
292  MATCH            1    Brief information about font matching
293  MATCHV           2    Extensive font matching information
294  EDIT             4    Monitor match/test/edit execution
295  FONTSET          8    Track loading of font information at startup
296  CACHE           16    Watch cache files being written
297  CACHEV          32    Extensive cache file writing information
298  PARSE           64    (no longer in use)
299  SCAN           128    Watch font files being scanned to build caches
300  SCANV          256    Verbose font file scanning information
301  MEMORY         512    Monitor fontconfig memory usage
302  CONFIG        1024    Monitor which config files are loaded
303  LANGSET       2048    Dump char sets used to construct lang values
304  OBJTYPES      4096    Display message when value typechecks fail
305  </PRE
306><P
307>Add the value of the desired debug levels together and assign that (in
308base 10) to the FC_DEBUG environment variable before running the
309application. Output from these statements is sent to stdout.
310  </P
311></DIV
312><DIV
313CLASS="REFSECT1"
314><A
315NAME="AEN48"
316></A
317><H2
318>Lang Tags</H2
319><P
320>Each font in the database contains a list of languages it supports.  This is
321computed by comparing the Unicode coverage of the font with the orthography
322of each language.  Languages are tagged using an RFC-3066 compatible naming
323and occur in two parts -- the ISO 639 language tag followed a hyphen and then
324by the ISO 3166 country code.  The hyphen and country code may be elided.
325  </P
326><P
327>Fontconfig has orthographies for several languages built into the library.
328No provision has been made for adding new ones aside from rebuilding the
329library.  It currently supports 122 of the 139 languages named in ISO 639-1,
330141 of the languages with two-letter codes from ISO 639-2 and another 30
331languages with only three-letter codes.  Languages with both two and three
332letter codes are provided with only the two letter code.
333  </P
334><P
335>For languages used in multiple territories with radically different
336character sets, fontconfig includes per-territory orthographies.  This
337includes Azerbaijani, Kurdish, Pashto, Tigrinya and Chinese.
338  </P
339></DIV
340><DIV
341CLASS="REFSECT1"
342><A
343NAME="AEN53"
344></A
345><H2
346>Configuration File Format</H2
347><P
348>Configuration files for fontconfig are stored in XML format; this
349format makes external configuration tools easier to write and ensures that
350they will generate syntactically correct configuration files.  As XML
351files are plain text, they can also be manipulated by the expert user using
352a text editor.
353  </P
354><P
355>The fontconfig document type definition resides in the external entity
356"fonts.dtd"; this is normally stored in the default font configuration
357directory (/etc/fonts).  Each configuration file should contain the
358following structure:
359    <PRE
360CLASS="PROGRAMLISTING"
361>	&lt;?xml version="1.0"?&gt;
362	&lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
363	&lt;fontconfig&gt;
364	...
365	&lt;/fontconfig&gt;
366    </PRE
367>
368  </P
369><DIV
370CLASS="REFSECT2"
371><A
372NAME="AEN58"
373></A
374><H3
375><TT
376CLASS="LITERAL"
377>&lt;fontconfig&gt;</TT
378></H3
379><P
380>This is the top level element for a font configuration and can contain
381<TT
382CLASS="LITERAL"
383>&lt;dir&gt;</TT
384>, <TT
385CLASS="LITERAL"
386>&lt;cache&gt;</TT
387>, <TT
388CLASS="LITERAL"
389>&lt;include&gt;</TT
390>, <TT
391CLASS="LITERAL"
392>&lt;match&gt;</TT
393> and <TT
394CLASS="LITERAL"
395>&lt;alias&gt;</TT
396> elements in any order.
397  </P
398></DIV
399><DIV
400CLASS="REFSECT2"
401><A
402NAME="AEN67"
403></A
404><H3
405><TT
406CLASS="LITERAL"
407>&lt;dir&gt;</TT
408></H3
409><P
410>This element contains a directory name which will be scanned for font files
411to include in the set of available fonts.
412  </P
413></DIV
414><DIV
415CLASS="REFSECT2"
416><A
417NAME="AEN71"
418></A
419><H3
420><TT
421CLASS="LITERAL"
422>&lt;cache&gt;</TT
423></H3
424><P
425>This element contains a file name for the per-user cache of font
426information.  If it starts with '~', it refers to a file in the users
427home directory.  This file is used to hold information about fonts that
428isn't present in the per-directory cache files.  It is automatically
429maintained by the fontconfig library.  The default for this file 
430is ``~/.fonts.cache-<TT
431CLASS="LITERAL"
432>&lt;version&gt;</TT
433>'', where <TT
434CLASS="LITERAL"
435>&lt;version&gt;</TT
436> is the font configuration
437file version number (currently 2).
438  </P
439></DIV
440><DIV
441CLASS="REFSECT2"
442><A
443NAME="AEN77"
444></A
445><H3
446><TT
447CLASS="LITERAL"
448>&lt;include ignore_missing="no"&gt;</TT
449></H3
450><P
451>This element contains the name of an additional configuration file or
452directory.  If a directory, every file within that directory starting with an
453ASCII digit (U+0030 - U+0039) and ending with the string ``.conf'' will be processed in sorted order.  When
454the XML datatype is traversed by FcConfigParse, the contents of the file(s)
455will also be incorporated into the configuration by passing the filename(s) to
456FcConfigLoadAndParse.  If 'ignore_missing' is set to "yes" instead of the
457default "no", a missing file or directory will elicit no warning message from
458the library.
459  </P
460></DIV
461><DIV
462CLASS="REFSECT2"
463><A
464NAME="AEN81"
465></A
466><H3
467><TT
468CLASS="LITERAL"
469>&lt;config&gt;</TT
470></H3
471><P
472>This element provides a place to consolidate additional configuration
473information.  <TT
474CLASS="LITERAL"
475>&lt;config&gt;</TT
476> can contain <TT
477CLASS="LITERAL"
478>&lt;blank&gt;</TT
479> and <TT
480CLASS="LITERAL"
481>&lt;rescan&gt;</TT
482> elements in any
483order.
484  </P
485></DIV
486><DIV
487CLASS="REFSECT2"
488><A
489NAME="AEN88"
490></A
491><H3
492><TT
493CLASS="LITERAL"
494>&lt;blank&gt;</TT
495></H3
496><P
497>Fonts often include "broken" glyphs which appear in the encoding but are
498drawn as blanks on the screen.  Within the <TT
499CLASS="LITERAL"
500>&lt;blank&gt;</TT
501> element, place each
502Unicode characters which is supposed to be blank in an <TT
503CLASS="LITERAL"
504>&lt;int&gt;</TT
505> element.
506Characters outside of this set which are drawn as blank will be elided from
507the set of characters supported by the font.
508  </P
509></DIV
510><DIV
511CLASS="REFSECT2"
512><A
513NAME="AEN94"
514></A
515><H3
516><TT
517CLASS="LITERAL"
518>&lt;rescan&gt;</TT
519></H3
520><P
521>The <TT
522CLASS="LITERAL"
523>&lt;rescan&gt;</TT
524> element holds an <TT
525CLASS="LITERAL"
526>&lt;int&gt;</TT
527> element which indicates the default
528interval between automatic checks for font configuration changes.
529Fontconfig will validate all of the configuration files and directories and
530automatically rebuild the internal datastructures when this interval passes.
531  </P
532></DIV
533><DIV
534CLASS="REFSECT2"
535><A
536NAME="AEN100"
537></A
538><H3
539><TT
540CLASS="LITERAL"
541>&lt;selectfont&gt;</TT
542></H3
543><P
544>This element is used to black/white list fonts from being listed or matched
545against.  It holds acceptfont and rejectfont elements.
546  </P
547></DIV
548><DIV
549CLASS="REFSECT2"
550><A
551NAME="AEN104"
552></A
553><H3
554><TT
555CLASS="LITERAL"
556>&lt;acceptfont&gt;</TT
557></H3
558><P
559>Fonts matched by an acceptfont element are "whitelisted"; such fonts are
560explicitly included in the set of fonts used to resolve list and match
561requests; including them in this list protects them from being "blacklisted"
562by a rejectfont element.  Acceptfont elements include glob and pattern
563elements which are used to match fonts.
564  </P
565></DIV
566><DIV
567CLASS="REFSECT2"
568><A
569NAME="AEN108"
570></A
571><H3
572><TT
573CLASS="LITERAL"
574>&lt;rejectfont&gt;</TT
575></H3
576><P
577>Fonts matched by an rejectfont element are "blacklisted"; such fonts are
578excluded from the set of fonts used to resolve list and match requests as if
579they didn't exist in the system.  Rejectfont elements include glob and
580pattern elements which are used to match fonts.
581  </P
582></DIV
583><DIV
584CLASS="REFSECT2"
585><A
586NAME="AEN112"
587></A
588><H3
589><TT
590CLASS="LITERAL"
591>&lt;glob&gt;</TT
592></H3
593><P
594>Glob elements hold shell-style filename matching patterns (including ? and
595*) which match fonts based on their complete pathnames.  This can be used to
596exclude a set of directories (/usr/share/fonts/uglyfont*), or particular
597font file types (*.pcf.gz), but the latter mechanism relies rather heavily
598on filenaming conventions which can't be relied upon.  Note that globs
599only apply to directories, not to individual fonts.
600  </P
601></DIV
602><DIV
603CLASS="REFSECT2"
604><A
605NAME="AEN116"
606></A
607><H3
608><TT
609CLASS="LITERAL"
610>&lt;pattern&gt;</TT
611></H3
612><P
613>Pattern elements perform list-style matching on incoming fonts; that is,
614they hold a list of elements and associated values.  If all of those
615elements have a matching value, then the pattern matches the font.  This can
616be used to select fonts based on attributes of the font (scalable, bold,
617etc), which is a more reliable mechanism than using file extensions.
618Pattern elements include patelt elements.
619  </P
620></DIV
621><DIV
622CLASS="REFSECT2"
623><A
624NAME="AEN120"
625></A
626><H3
627><TT
628CLASS="LITERAL"
629>&lt;patelt name="property"&gt;</TT
630></H3
631><P
632>Patelt elements hold a single pattern element and list of values.  They must
633have a 'name' attribute which indicates the pattern element name.  Patelt
634elements include int, double, string, matrix, bool, charset and const
635elements.
636  </P
637></DIV
638><DIV
639CLASS="REFSECT2"
640><A
641NAME="AEN124"
642></A
643><H3
644><TT
645CLASS="LITERAL"
646>&lt;match target="pattern"&gt;</TT
647></H3
648><P
649>This element holds first a (possibly empty) list of <TT
650CLASS="LITERAL"
651>&lt;test&gt;</TT
652> elements and then
653a (possibly empty) list of <TT
654CLASS="LITERAL"
655>&lt;edit&gt;</TT
656> elements.  Patterns which match all of the
657tests are subjected to all the edits.  If 'target' is set to "font" instead
658of the default "pattern", then this element applies to the font name
659resulting from a match rather than a font pattern to be matched. If 'target'
660is set to "scan", then this element applies when the font is scanned to
661build the fontconfig database.
662  </P
663></DIV
664><DIV
665CLASS="REFSECT2"
666><A
667NAME="AEN130"
668></A
669><H3
670><TT
671CLASS="LITERAL"
672>&lt;test qual="any" name="property" target="default" compare="eq"&gt;</TT
673></H3
674><P
675>This element contains a single value which is compared with the target
676('pattern', 'font', 'scan' or 'default') property "property" (substitute any of the property names seen 
677above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", or
678"more_eq".  'qual' may either be the default, "any", in which case the match
679succeeds if any value associated with the property matches the test value, or
680"all", in which case all of the values associated with the property must
681match the test value.  When used in a &lt;match target="font"&gt; element,
682the target= attribute in the &lt;test&gt; element selects between matching
683the original pattern or the font.  "default" selects whichever target the
684outer &lt;match&gt; element has selected.
685  </P
686></DIV
687><DIV
688CLASS="REFSECT2"
689><A
690NAME="AEN134"
691></A
692><H3
693><TT
694CLASS="LITERAL"
695>&lt;edit name="property" mode="assign" binding="weak"&gt;</TT
696></H3
697><P
698>This element contains a list of expression elements (any of the value or
699operator elements).  The expression elements are evaluated at run-time and
700modify the property "property".  The modification depends on whether
701"property" was matched by one of the associated <TT
702CLASS="LITERAL"
703>&lt;test&gt;</TT
704> elements, if so, the
705modification may affect the first matched value.  Any values inserted into
706the property are given the indicated binding ("strong", "weak" or "same")
707with "same" binding using the value from the matched pattern element.
708'mode' is one of:
709    <PRE
710CLASS="PROGRAMLISTING"
711>  Mode                    With Match              Without Match
712  ---------------------------------------------------------------------
713  "assign"                Replace matching value  Replace all values
714  "assign_replace"        Replace all values      Replace all values
715  "prepend"               Insert before matching  Insert at head of list
716  "prepend_first"         Insert at head of list  Insert at head of list
717  "append"                Append after matching   Append at end of list
718  "append_last"           Append at end of list   Append at end of list
719    </PRE
720>
721  </P
722></DIV
723><DIV
724CLASS="REFSECT2"
725><A
726NAME="AEN140"
727></A
728><H3
729><TT
730CLASS="LITERAL"
731>&lt;int&gt;</TT
732>, <TT
733CLASS="LITERAL"
734>&lt;double&gt;</TT
735>, <TT
736CLASS="LITERAL"
737>&lt;string&gt;</TT
738>, <TT
739CLASS="LITERAL"
740>&lt;bool&gt;</TT
741></H3
742><P
743>These elements hold a single value of the indicated type.  <TT
744CLASS="LITERAL"
745>&lt;bool&gt;</TT
746>
747elements hold either true or false.  An important limitation exists in
748the parsing of floating point numbers -- fontconfig requires that
749the mantissa start with a digit, not a decimal point, so insert a leading
750zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
751instead of -.5).
752  </P
753></DIV
754><DIV
755CLASS="REFSECT2"
756><A
757NAME="AEN148"
758></A
759><H3
760><TT
761CLASS="LITERAL"
762>&lt;matrix&gt;</TT
763></H3
764><P
765>This element holds the four <TT
766CLASS="LITERAL"
767>&lt;double&gt;</TT
768> elements of an affine
769transformation.
770  </P
771></DIV
772><DIV
773CLASS="REFSECT2"
774><A
775NAME="AEN153"
776></A
777><H3
778><TT
779CLASS="LITERAL"
780>&lt;name&gt;</TT
781></H3
782><P
783>Holds a property name.  Evaluates to the first value from the property of
784the font, not the pattern.
785  </P
786></DIV
787><DIV
788CLASS="REFSECT2"
789><A
790NAME="AEN157"
791></A
792><H3
793><TT
794CLASS="LITERAL"
795>&lt;const&gt;</TT
796></H3
797><P
798>Holds the name of a constant; these are always integers and serve as
799symbolic names for common font values:
800    <PRE
801CLASS="PROGRAMLISTING"
802>  Constant        Property        Value
803  -------------------------------------
804  thin            weight          0
805  extralight      weight          40
806  ultralight      weight          40
807  light           weight          50
808  book            weight          75
809  regular         weight          80
810  normal          weight          80
811  medium          weight          100
812  demibold        weight          180
813  semibold        weight          180
814  bold            weight          200
815  extrabold       weight          205
816  black           weight          210
817  heavy           weight          210
818  roman           slant           0
819  italic          slant           100
820  oblique         slant           110
821  ultracondensed  width           50
822  extracondensed  width           63
823  condensed       width           75
824  semicondensed   width           87
825  normal          width           100
826  semiexpanded    width           113
827  expanded        width           125
828  extraexpanded   width           150
829  ultraexpanded   width           200
830  proportional    spacing         0
831  dual            spacing         90
832  mono            spacing         100
833  charcell        spacing         110
834  unknown         rgba            0
835  rgb             rgba            1
836  bgr             rgba            2
837  vrgb            rgba            3
838  vbgr            rgba            4
839  none            rgba            5
840  lcdnone         lcdfilter       0
841  lcddefault      lcdfilter       1
842  lcdlight        lcdfilter       2
843  lcdlegacy       lcdfilter       3
844  hintnone        hintstyle       0
845  hintslight      hintstyle       1
846  hintmedium      hintstyle       2
847  hintfull        hintstyle       3
848    </PRE
849>
850      </P
851></DIV
852><DIV
853CLASS="REFSECT2"
854><A
855NAME="AEN162"
856></A
857><H3
858><TT
859CLASS="LITERAL"
860>&lt;or&gt;</TT
861>, <TT
862CLASS="LITERAL"
863>&lt;and&gt;</TT
864>, <TT
865CLASS="LITERAL"
866>&lt;plus&gt;</TT
867>, <TT
868CLASS="LITERAL"
869>&lt;minus&gt;</TT
870>, <TT
871CLASS="LITERAL"
872>&lt;times&gt;</TT
873>, <TT
874CLASS="LITERAL"
875>&lt;divide&gt;</TT
876></H3
877><P
878>These elements perform the specified operation on a list of expression
879elements.  <TT
880CLASS="LITERAL"
881>&lt;or&gt;</TT
882> and <TT
883CLASS="LITERAL"
884>&lt;and&gt;</TT
885> are boolean, not bitwise.
886      </P
887></DIV
888><DIV
889CLASS="REFSECT2"
890><A
891NAME="AEN173"
892></A
893><H3
894><TT
895CLASS="LITERAL"
896>&lt;eq&gt;</TT
897>, <TT
898CLASS="LITERAL"
899>&lt;not_eq&gt;</TT
900>, <TT
901CLASS="LITERAL"
902>&lt;less&gt;</TT
903>, <TT
904CLASS="LITERAL"
905>&lt;less_eq&gt;</TT
906>, <TT
907CLASS="LITERAL"
908>&lt;more&gt;</TT
909>, <TT
910CLASS="LITERAL"
911>&lt;more_eq&gt;</TT
912></H3
913><P
914>These elements compare two values, producing a boolean result.
915  </P
916></DIV
917><DIV
918CLASS="REFSECT2"
919><A
920NAME="AEN182"
921></A
922><H3
923><TT
924CLASS="LITERAL"
925>&lt;not&gt;</TT
926></H3
927><P
928>Inverts the boolean sense of its one expression element
929  </P
930></DIV
931><DIV
932CLASS="REFSECT2"
933><A
934NAME="AEN186"
935></A
936><H3
937><TT
938CLASS="LITERAL"
939>&lt;if&gt;</TT
940></H3
941><P
942>This element takes three expression elements; if the value of the first is
943true, it produces the value of the second, otherwise it produces the value
944of the third.
945  </P
946></DIV
947><DIV
948CLASS="REFSECT2"
949><A
950NAME="AEN190"
951></A
952><H3
953><TT
954CLASS="LITERAL"
955>&lt;alias&gt;</TT
956></H3
957><P
958>Alias elements provide a shorthand notation for the set of common match
959operations needed to substitute one font family for another.  They contain a
960<TT
961CLASS="LITERAL"
962>&lt;family&gt;</TT
963> element followed by optional <TT
964CLASS="LITERAL"
965>&lt;prefer&gt;</TT
966>, <TT
967CLASS="LITERAL"
968>&lt;accept&gt;</TT
969> and <TT
970CLASS="LITERAL"
971>&lt;default&gt;</TT
972>
973elements.  Fonts matching the <TT
974CLASS="LITERAL"
975>&lt;family&gt;</TT
976> element are edited to prepend the
977list of <TT
978CLASS="LITERAL"
979>&lt;prefer&gt;</TT
980>ed families before the matching <TT
981CLASS="LITERAL"
982>&lt;family&gt;</TT
983>, append the
984<TT
985CLASS="LITERAL"
986>&lt;accept&gt;</TT
987>able families after the matching <TT
988CLASS="LITERAL"
989>&lt;family&gt;</TT
990> and append the <TT
991CLASS="LITERAL"
992>&lt;default&gt;</TT
993>
994families to the end of the family list.
995  </P
996></DIV
997><DIV
998CLASS="REFSECT2"
999><A
1000NAME="AEN204"
1001></A
1002><H3
1003><TT
1004CLASS="LITERAL"
1005>&lt;family&gt;</TT
1006></H3
1007><P
1008>Holds a single font family name
1009  </P
1010></DIV
1011><DIV
1012CLASS="REFSECT2"
1013><A
1014NAME="AEN208"
1015></A
1016><H3
1017><TT
1018CLASS="LITERAL"
1019>&lt;prefer&gt;</TT
1020>, <TT
1021CLASS="LITERAL"
1022>&lt;accept&gt;</TT
1023>, <TT
1024CLASS="LITERAL"
1025>&lt;default&gt;</TT
1026></H3
1027><P
1028>These hold a list of <TT
1029CLASS="LITERAL"
1030>&lt;family&gt;</TT
1031> elements to be used by the <TT
1032CLASS="LITERAL"
1033>&lt;alias&gt;</TT
1034> element.
1035  </P
1036></DIV
1037></DIV
1038><DIV
1039CLASS="REFSECT1"
1040><A
1041NAME="AEN216"
1042></A
1043><H2
1044>EXAMPLE CONFIGURATION FILE</H2
1045><DIV
1046CLASS="REFSECT2"
1047><A
1048NAME="AEN218"
1049></A
1050><H3
1051>System configuration file</H3
1052><P
1053>This is an example of a system-wide configuration file
1054    </P
1055><PRE
1056CLASS="PROGRAMLISTING"
1057>&lt;?xml version="1.0"?&gt;
1058&lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
1059&lt;!-- /etc/fonts/fonts.conf file to configure system font access --&gt;
1060&lt;fontconfig&gt;
1061&lt;!-- 
1062	Find fonts in these directories
1063--&gt;
1064&lt;dir&gt;/usr/share/fonts&lt;/dir&gt;
1065&lt;dir&gt;/usr/X11R6/lib/X11/fonts&lt;/dir&gt;
1066
1067&lt;!--
1068	Accept deprecated 'mono' alias, replacing it with 'monospace'
1069--&gt;
1070&lt;match target="pattern"&gt;
1071	&lt;test qual="any" name="family"&gt;&lt;string&gt;mono&lt;/string&gt;&lt;/test&gt;
1072	&lt;edit name="family" mode="assign"&gt;&lt;string&gt;monospace&lt;/string&gt;&lt;/edit&gt;
1073&lt;/match&gt;
1074
1075&lt;!--
1076	Names not including any well known alias are given 'sans'
1077--&gt;
1078&lt;match target="pattern"&gt;
1079	&lt;test qual="all" name="family" mode="not_eq"&gt;sans&lt;/test&gt;
1080	&lt;test qual="all" name="family" mode="not_eq"&gt;serif&lt;/test&gt;
1081	&lt;test qual="all" name="family" mode="not_eq"&gt;monospace&lt;/test&gt;
1082	&lt;edit name="family" mode="append_last"&gt;&lt;string&gt;sans&lt;/string&gt;&lt;/edit&gt;
1083&lt;/match&gt;
1084
1085&lt;!--
1086	Load per-user customization file, but don't complain
1087	if it doesn't exist
1088--&gt;
1089&lt;include ignore_missing="yes"&gt;~/.fonts.conf&lt;/include&gt;
1090
1091&lt;!--
1092	Load local customization files, but don't complain
1093	if there aren't any
1094--&gt;
1095&lt;include ignore_missing="yes"&gt;conf.d&lt;/include&gt;
1096&lt;include ignore_missing="yes"&gt;local.conf&lt;/include&gt;
1097
1098&lt;!--
1099	Alias well known font names to available TrueType fonts.
1100	These substitute TrueType faces for similar Type1
1101	faces to improve screen appearance.
1102--&gt;
1103&lt;alias&gt;
1104	&lt;family&gt;Times&lt;/family&gt;
1105	&lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
1106	&lt;default&gt;&lt;family&gt;serif&lt;/family&gt;&lt;/default&gt;
1107&lt;/alias&gt;
1108&lt;alias&gt;
1109	&lt;family&gt;Helvetica&lt;/family&gt;
1110	&lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
1111	&lt;default&gt;&lt;family&gt;sans&lt;/family&gt;&lt;/default&gt;
1112&lt;/alias&gt;
1113&lt;alias&gt;
1114	&lt;family&gt;Courier&lt;/family&gt;
1115	&lt;prefer&gt;&lt;family&gt;Courier New&lt;/family&gt;&lt;/prefer&gt;
1116	&lt;default&gt;&lt;family&gt;monospace&lt;/family&gt;&lt;/default&gt;
1117&lt;/alias&gt;
1118
1119&lt;!--
1120	Provide required aliases for standard names
1121	Do these after the users configuration file so that
1122	any aliases there are used preferentially
1123--&gt;
1124&lt;alias&gt;
1125	&lt;family&gt;serif&lt;/family&gt;
1126	&lt;prefer&gt;&lt;family&gt;Times New Roman&lt;/family&gt;&lt;/prefer&gt;
1127&lt;/alias&gt;
1128&lt;alias&gt;
1129	&lt;family&gt;sans&lt;/family&gt;
1130	&lt;prefer&gt;&lt;family&gt;Arial&lt;/family&gt;&lt;/prefer&gt;
1131&lt;/alias&gt;
1132&lt;alias&gt;
1133	&lt;family&gt;monospace&lt;/family&gt;
1134	&lt;prefer&gt;&lt;family&gt;Andale Mono&lt;/family&gt;&lt;/prefer&gt;
1135&lt;/alias&gt;
1136&lt;/fontconfig&gt;
1137    </PRE
1138></DIV
1139><DIV
1140CLASS="REFSECT2"
1141><A
1142NAME="AEN222"
1143></A
1144><H3
1145>User configuration file</H3
1146><P
1147>This is an example of a per-user configuration file that lives in
1148~/.fonts.conf
1149    </P
1150><PRE
1151CLASS="PROGRAMLISTING"
1152>&lt;?xml version="1.0"?&gt;
1153&lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
1154&lt;!-- ~/.fonts.conf for per-user font configuration --&gt;
1155&lt;fontconfig&gt;
1156
1157&lt;!--
1158	Private font directory
1159--&gt;
1160&lt;dir&gt;~/.fonts&lt;/dir&gt;
1161
1162&lt;!--
1163	use rgb sub-pixel ordering to improve glyph appearance on
1164	LCD screens.  Changes affecting rendering, but not matching
1165	should always use target="font".
1166--&gt;
1167&lt;match target="font"&gt;
1168	&lt;edit name="rgba" mode="assign"&gt;&lt;const&gt;rgb&lt;/const&gt;&lt;/edit&gt;
1169&lt;/match&gt;
1170&lt;/fontconfig&gt;
1171    </PRE
1172></DIV
1173></DIV
1174><DIV
1175CLASS="REFSECT1"
1176><A
1177NAME="AEN226"
1178></A
1179><H2
1180>Files</H2
1181><P
1182><SPAN
1183CLASS="emphasis"
1184><I
1185CLASS="EMPHASIS"
1186>fonts.conf</I
1187></SPAN
1188>
1189contains configuration information for the fontconfig library
1190consisting of directories to look at for font information as well as
1191instructions on editing program specified font patterns before attempting to
1192match the available fonts.  It is in xml format.
1193  </P
1194><P
1195><SPAN
1196CLASS="emphasis"
1197><I
1198CLASS="EMPHASIS"
1199>conf.d</I
1200></SPAN
1201>
1202is the conventional name for a directory of additional configuration files
1203managed by external applications or the local administrator.  The
1204filenames starting with decimal digits are sorted in lexicographic order
1205and used as additional configuration files.  All of these files are in xml
1206format.  The master fonts.conf file references this directory in an 
1207&lt;include&gt; directive.
1208  </P
1209><P
1210><SPAN
1211CLASS="emphasis"
1212><I
1213CLASS="EMPHASIS"
1214>fonts.dtd</I
1215></SPAN
1216>
1217is a DTD that describes the format of the configuration files.
1218  </P
1219><P
1220><SPAN
1221CLASS="emphasis"
1222><I
1223CLASS="EMPHASIS"
1224>~/.fonts.conf</I
1225></SPAN
1226>
1227is the conventional location for per-user font configuration, although the
1228actual location is specified in the global fonts.conf file.
1229  </P
1230><P
1231><SPAN
1232CLASS="emphasis"
1233><I
1234CLASS="EMPHASIS"
1235> ~/.fonts.cache-*</I
1236></SPAN
1237>
1238is the conventional repository of font information that isn't found in the
1239per-directory caches.  This file is automatically maintained by fontconfig.
1240  </P
1241></DIV
1242><DIV
1243CLASS="REFSECT1"
1244><A
1245NAME="AEN238"
1246></A
1247><H2
1248>See Also</H2
1249><P
1250>fc-cache(1), fc-match(1), fc-list(1)
1251  </P
1252></DIV
1253><DIV
1254CLASS="REFSECT1"
1255><A
1256NAME="AEN241"
1257></A
1258><H2
1259>Version</H2
1260><P
1261>Fontconfig version 2.6.0
1262
1263	    </P
1264></DIV
1265></BODY
1266></HTML
1267>