X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=doc%2Ffontconfig-user.sgml;h=9122e10d0740550cc628ae1d6a2625624355c76d;hb=22671e25510e77af1a8f2b569314ba2de1c93353;hp=49c60656b62c0b07ab0dd37bdb140643245d5064;hpb=5e1f56b567c0226da9ab650ee4809e16be2ae8eb;p=fontconfig.git diff --git a/doc/fontconfig-user.sgml b/doc/fontconfig-user.sgml index 49c6065..9122e10 100644 --- a/doc/fontconfig-user.sgml +++ b/doc/fontconfig-user.sgml @@ -1,4 +1,4 @@ - + -
- - Fontconfig Users Guide - Fontconfig - KeithPackard - krp - -NAME - - fontconfig - Font configuration and customization library - - -DESCRIPTION + + + fonts.conf + 5 + + + fonts.conf + Font configuration files + + + + /etc/fonts/fonts.conf + /etc/fonts/fonts.dtd + ~/.fonts.conf + + +DESCRIPTION Fontconfig is a library designed to provide system-wide font configuration, customization and application access. - -FUNCTIONAL OVERVIEW + +FUNCTIONAL OVERVIEW Fontconfig contains two essential modules, the configuration module which builds an internal configuration from XML files and the matching module which accepts font patterns and returns the nearest matching font. - FONT CONFIGURATION + FONT CONFIGURATION The configuration module consists of the FcConfig datatype, libexpat and FcConfigParse which walks over an XML tree and ammends a configuration with @@ -72,8 +76,8 @@ is that this will ensure that configuration of fonts for all applications can be centralized in one place. Centralizing font configuration will simplify and regularize font installation and customization. - - + + FONT PROPERTIES While font patterns may contain essentially any properties, there are some @@ -81,51 +85,40 @@ well known properties with associated types. Fontconfig uses some of these properties for font matching and font completion. Others are provided as a convenience for the applications rendering mechanism. - - Property Definitions - - - - - - - Property - Type - Description - - - -familyStringFont family name -styleStringFont style. Overrides weight and slant -slantIntItalic, oblique or roman -weightIntLight, medium, demibold, bold or black -sizeDoublePoint size -aspectDoubleStretches glyphs horizontally before hinting -pixelsizeDoublePixel size -spacingIntProportional, monospace or charcell -foundryStringFont foundry name -antialiasBoolWhether glyphs can be antialiased -hintingBoolWhether the rasterizer should use hinting -verticallayoutBoolUse vertical layout -autohintBoolUse autohinter instead of normal hinter -globaladvanceBoolUse font global advance data -fileStringThe filename holding the font -indexIntThe index of the font within the file -ftfaceFT_FaceUse the specified FreeType face object -rasterizerStringWhich rasterizer is in use -outlineBoolWhether the glyphs are outlines -scalableBoolWhether glyphs can be scaled -scaleDoubleScale factor for point->pixel conversions -dpiDoubleTarget dots per inch -rgbaIntunknown, rgb, bgr, vrgb, vbgr, none - subpixel geometry -minspaceBoolEliminate leading from line spacing -charsetCharSetUnicode chars encoded by the font -langStringList of RFC-3066-style languages this font supports - - -
-
- + + Property Type Description + -------------------------------------------------------------- + family String Font family name + style String Font style. Overrides weight and slant + slant Int Italic, oblique or roman + weight Int Light, medium, demibold, bold or black + size Double Point size + aspect Double Stretches glyphs horizontally before hinting + pixelsize Double Pixel size + spacing Int Proportional, monospace or charcell + foundry String Font foundry name + antialias Bool Whether glyphs can be antialiased + hinting Bool Whether the rasterizer should use hinting + verticallayout Bool Use vertical layout + autohint Bool Use autohinter instead of normal hinter + globaladvance Bool Use font global advance data + file String The filename holding the font + index Int The index of the font within the file + ftface FT_Face Use the specified FreeType face object + rasterizer String Which rasterizer is in use + outline Bool Whether the glyphs are outlines + scalable Bool Whether glyphs can be scaled + scale Double Scale factor for point->pixel conversions + dpi Double Target dots per inch + rgba Int unknown, rgb, bgr, vrgb, vbgr, + none - subpixel geometry + minspace Bool Eliminate leading from line spacing + charset CharSet Unicode chars encoded by the font + lang String List of RFC-3066-style languages this + font supports + + + FONT MATCHING Fontconfig performs matching by measuring the distance from a provided @@ -183,8 +176,8 @@ suitable defaults. The second is to modify how the selected fonts are rasterized. Those must apply to the selected font, not the original pattern as false matches will often occur. - - FONT NAMES + + FONT NAMES Fontconfig provides a textual representation for patterns that the library can both accept and generate. The representation is in three parts, first a @@ -200,25 +193,18 @@ families or point sizes; they can be elided. In addition, there are symbolic constants that simultaneously indicate both a name and a value. Here are some examples: - - Sample Font Names - - - Name - Meaning - - -Times-1212 point Times Roman -Times-12:bold12 point Times Bold -Courier:italicCourier Italic in the default size -Monospace:matrix=1 .1 0 1The users preferred monospace font -with artificial obliquing - - -
-
-
-LANG TAGS + + Name Meaning + ---------------------------------------------------------- + Times-12 12 point Times Roman + Times-12:bold 12 point Times Bold + Courier:italic Courier Italic in the default size + Monospace:matrix=1 .1 0 1 The users preferred monospace font + with artificial obliquing + + + +LANG TAGS Each font in the database contains a list of languages it supports. This is computed by comparing the Unicode coverage of the font with the orthography @@ -232,8 +218,8 @@ library. It currently supports 122 of the 139 languages named in ISO 639-1, 141 of the languages with two-letter codes from ISO 639-2 and another 30 languages with only three-letter codes. - -CONFIGURATION FILE FORMAT + +CONFIGURATION FILE FORMAT Configuration files for fontconfig are stored in XML format; this format makes external configuration tools easier to write and ensures that @@ -253,56 +239,56 @@ following structure: </fontconfig> - <fontconfig> +<literal><fontconfig></literal> This is the top level element for a font configuration and can contain -<dir>, <cache>, <include>, <match> and <alias> elements in any order. - - <dir> +dir, cache, include, match and alias elements in any order. + + <sgmltag>dir</> This element contains a directory name which will be scanned for font files to include in the set of available fonts. - - <cache> + + <sgmltag>cache</> This element contains a file name for the per-user cache of font information. If it starts with '~', it refers to a file in the users home directory. This file is used to hold information about fonts that isn't present in the per-directory cache files. It is automatically maintained by the fontconfig library. The default for this file -is ``~/.fonts.cache-<version>'', where <version> is the font configuration +is ``~/.fonts.cache-version'', where version is the font configuration file version number (currently 1). - - <include ignore_missing="no"> + + <sgmltag>include ignore_missing="no"</> This element contains the name of an additional configuration file. When the XML datatype is traversed by FcConfigParse, the contents of the file will also be incorporated into the configuration by passing the filename to FcConfigLoadAndParse. If 'ignore_missing' is set to "yes" instead of the default "no", a missing file will elicit no warning message from the library. - - <config> + + <sgmltag>config</> This element provides a place to consolodate additional configuration -information. <config> can contain <blank> and <rescan> elements in any +information. config can contain blank and rescan elements in any order. - - <blank> + + <sgmltag>blank</> Fonts often include "broken" glyphs which appear in the encoding but are -drawn as blanks on the screen. Within the <blank> element, place each -Unicode characters which is supposed to be blank in an <int> element. +drawn as blanks on the screen. Within the blank element, place each +Unicode characters which is supposed to be blank in an int element. Characters outside of this set which are drawn as blank will be elided from the set of characters supported by the font. - - <rescan> -The <rescan> element holds an <int> element which indicates the default + + <sgmltag>rescan</> +The rescan element holds an int element which indicates the default interval between automatic checks for font configuration changes. Fontconfig will validate all of the configuration files and directories and automatically rebuild the internal datastructures when this interval passes. - - <match target="pattern"> -This element holds first a (possibly empty) list of <test> elements and then -a (possibly empty) list of <edit> elements. Patterns which match all of the + + <sgmltag>match target="pattern"</> +This element holds first a (possibly empty) list of test elements and then +a (possibly empty) list of edit elements. Patterns which match all of the tests are subjected to all the edits. If 'target' is set to "font" instead of the default "pattern", then this element applies to the font name resulting from a match rather than a font pattern to be matched. - - <test qual="any" name="property" compare="eq"> + + <sgmltag>test qual="any" name="property" compare="eq"</> This element contains a single value which is compared with the pattern property "property" (substitute any of the property names seen above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", or @@ -310,128 +296,102 @@ above). 'compare' can be one of "eq", "not_eq", "less", "less_eq", "more", or succeeds if any value associated with the property matches the test value, or "all", in which case all of the values associated with the property must match the test value. - - <edit name="property" mode="assign" binding="weak"> + + <sgmltag>edit name="property" mode="assign" binding="weak"</> This element contains a list of expression elements (any of the value or operator elements). The expression elements are evaluated at run-time and modify the property "property". The modification depends on whether -"property" was matched by one of the associated <test> elements, if so, the +"property" was matched by one of the associated test elements, if so, the modification may affect the first matched value. Any values inserted into the property are given the indicated binding. 'mode' is one of: - - Edit Element Modes - - - - Mode - Operation With Match - Operation Without Match - - - -"assign"Replace matching valueReplace all values -"assign_replace"Replace all valuesReplace all values -"prepend"Insert before matching valueInsert at head of list -"prepend_first"Insert at head of listInsert at head of list -"append"Append after matching valueAppend at end of list -"append_last"Append at end of listAppend at end of list - - -
-
- <int>, <double>, <string>, <bool> -These elements hold a single value of the indicated type. <bool> elements + + Mode With Match Without Match + --------------------------------------------------------------------- + "assign" Replace matching value Replace all values + "assign_replace" Replace all values Replace all values + "prepend" Insert before matching Insert at head of list + "prepend_first" Insert at head of list Insert at head of list + "append" Append after matching Append at end of list + "append_last" Append at end of list Append at end of list + + + <sgmltag>int</>, <sgmltag>double</>, <sgmltag>string</>, <sgmltag>bool</> +These elements hold a single value of the indicated type. bool elements hold either true or false. - - <matrix> -This element holds the four <double> elements of an affine + + <sgmltag>matrix</> +This element holds the four double elements of an affine transformation. - - <name> + + <sgmltag>name</> Holds a property name. Evaluates to the first value from the property of the font, not the pattern. - - <const> + + <sgmltag>const</> Holds the name of a constant; these are always integers and serve as symbolic names for common font values: - - Symbolic Constants - - - - Constant - Property - CPP Symbol - - - -lightweight -mediumweight -demiboldweight -boldweight -blackweight -romanslant -italicslant -obliqueslant -proportionalspacing -monospacing -charcellspacing -unknownrgba -rgbrgba -bgrrgba -vrgbrgba -vbgrrgba -nonergba - - -
+ + Constant Property Value + ------------------------------------- + light weight 0 + medium weight 100 + demibold weight 180 + bold weight 200 + black weight 210 + roman slant 0 + italic slant 100 + oblique slant 110 + proportional spacing 0 + mono spacing 100 + charcell spacing 110 + unknown rgba 0 + rgb rgba 1 + bgr rgba 2 + vrgb rgba 3 + vbgr rgba 4 + none rgba 5 +
-
- <or>, - <and>, - <plus>, - <minus>, - <times>, - <divide> + + + <sgmltag>or</>, <sgmltag>and</>, <sgmltag>plus</>, <sgmltag>minus</>, <sgmltag>times</>, <sgmltag>divide</> + These elements perform the specified operation on a list of expression -elements. <or> and <and> are boolean, not bitwise. +elements. or and and are boolean, not bitwise. - - <eq>, - <not_eq>, - <less>, - <less_eq>, - <more>, - <more_eq> + + + <sgmltag>eq</>, <sgmltag>not_eq</>, <sgmltag>less</>, <sgmltag>less_eq</>, <sgmltag>more</>, <sgmltag>more_eq</> + These elements compare two values, producing a boolean result. - - <not> + + <sgmltag>not</> Inverts the boolean sense of its one expression element - - <if> + + <sgmltag>if</> This element takes three expression elements; if the value of the first is true, it produces the value of the second, otherwise it produces the value of the third. - - <alias> + + <sgmltag>alias</> Alias elements provide a shorthand notation for the set of common match operations needed to substitute one font family for another. They contain a -<family> element followed by optional <prefer>, <accept> and <default> -elements. Fonts matching the <family> element are edited to prepend the -list of <prefer>ed families before the matching <family>, append the -<accept>able familys after the matching <family> and append the <default> +family element followed by optional prefer, accept and default +elements. Fonts matching the family element are edited to prepend the +list of prefered families before the matching family, append the +acceptable familys after the matching family and append the default families to the end of the family list. - - <family> + + <sgmltag>family</> Holds a single font family name - - <prefer>, <accept>, <default> -These hold a list of <family> elements to be used by the <alias> element. -</article> - -
-EXAMPLE CONFIGURATION FILE - System configuration file + + <sgmltag>prefer</>, <sgmltag>accept</>, <sgmltag>default</> +These hold a list of family elements to be used by the alias element. +/article + + +EXAMPLE CONFIGURATION FILE + System configuration file This is an example of a system-wide configuration file @@ -510,8 +470,8 @@ This is an example of a system-wide configuration file </alias> </fontconfig> - - User configuration file + + User configuration file This is an example of a per-user configuration file that lives in ~/.fonts.conf @@ -537,9 +497,9 @@ This is an example of a per-user configuration file that lives in </match> </fontconfig> - - -FILES + + +FILES fonts.conf contains configuration information for the fontconfig library @@ -561,5 +521,5 @@ actual location is specified in the global fonts.conf file. is the conventional repository of font information that isn't found in the per-directory caches. This file is automatically maintained by fontconfig. - -
+ +