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