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