]> git.wh0rd.org - fontconfig.git/blame - doc/fcconfig.fncs
Spelling errors in documentation. (bug 10879).
[fontconfig.git] / doc / fcconfig.fncs
CommitLineData
bfc2dc3a
KP
1/*
2 * $Id$
3 *
46b51147 4 * Copyright © 2003 Keith Packard
bfc2dc3a
KP
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. Keith Packard makes no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
15 *
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
23 */
39381776 24@RET@ FcConfig *
bfc2dc3a
KP
25@FUNC@ FcConfigCreate
26@TYPE1@ void
27@PURPOSE@ Create a configuration
28@DESC@
29Creates an empty configuration.
30@@
31
39381776
KP
32@RET@ void
33@FUNC@ FcConfigDestroy
34@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
35@PURPOSE@ Destroy a configuration
36@DESC@
37Destroys a configuration and any data associated with it. Note that calling
38this function with the return from FcConfigGetCurrent will place the library
39in an indeterminate state.
40@@
41
39381776
KP
42@RET@ FcBool
43@FUNC@ FcConfigSetCurrent
44@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
45@PURPOSE@ Set configuration as default
46@DESC@
2df0c662 47Sets the current default configuration to <parameter>config</parameter>. Implicitly calls
bfc2dc3a
KP
48FcConfigBuildFonts if necessary, returning FcFalse if that call fails.
49@@
50
39381776 51@RET@ FcConfig *
bfc2dc3a
KP
52@FUNC@ FcConfigGetCurrent
53@TYPE1@ void
54@PURPOSE@ Return current configuration
55@DESC@
56Returns the current default configuration.
57@@
58
39381776
KP
59@RET@ FcBool
60@FUNC@ FcConfigUptoDate
61@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
62@PURPOSE@ Check timestamps on config files
63@DESC@
2df0c662 64Checks all of the files related to <parameter>config</parameter> and returns whether the
bfc2dc3a
KP
65in-memory version is in sync with the disk version.
66@@
67
39381776
KP
68@RET@ FcBool
69@FUNC@ FcConfigBuildFonts
70@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
71@PURPOSE@ Build font database
72@DESC@
73Builds the set of available fonts for the given configuration. Note that
74any changes to the configuration after this call have indeterminate effects.
75Returns FcFalse if this operation runs out of memory.
76@@
77
39381776
KP
78@RET@ FcStrList *
79@FUNC@ FcConfigGetConfigDirs
80@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
81@PURPOSE@ Get config directories
82@DESC@
83Returns the list of font directories specified in the configuration files
2df0c662 84for <parameter>config</parameter>. Does not include any subdirectories.
bfc2dc3a
KP
85@@
86
39381776
KP
87@RET@ FcStrList *
88@FUNC@ FcConfigGetFontDirs
89@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
90@PURPOSE@ Get font directories
91@DESC@
2df0c662 92Returns the list of font directories in <parameter>config</parameter>. This includes the
bfc2dc3a
KP
93configured font directories along with any directories below those in the
94filesystem.
95@@
96
39381776
KP
97@RET@ FcStrList *
98@FUNC@ FcConfigGetConfigFiles
99@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
100@PURPOSE@ Get config files
101@DESC@
2df0c662 102Returns the list of known configuration files used to generate <parameter>config</parameter>.
bfc2dc3a
KP
103Note that this will not include any configuration done with FcConfigParse.
104@@
105
39381776
KP
106@RET@ char *
107@FUNC@ FcConfigGetCache
108@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
109@PURPOSE@ Get cache filename
110@DESC@
111Returns the name of the file used to store per-user font information.
112@@
113
39381776
KP
114@RET@ FcFontSet *
115@FUNC@ FcConfigGetFonts
bfc2dc3a 116@TYPE1@ FcConfig * @ARG1@ config
61895ed1 117@TYPE2@ FcSetName% @ARG2@ set
bfc2dc3a
KP
118@PURPOSE@ Get config font set
119@DESC@
39381776 120Returns one of the two sets of fonts from the configuration as specified
2df0c662 121by <parameter>set</parameter>.
bfc2dc3a
KP
122@@
123
39381776
KP
124@RET@ FcBlanks *
125@FUNC@ FcConfigGetBlanks
126@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
127@PURPOSE@ Get config blanks
128@DESC@
129Returns the FcBlanks object associated with the given configuration, if no
130blanks were present in the configuration, this function will return 0.
131@@
132
39381776 133@RET@ int
61139cf6 134@FUNC@ FcConfigGetRescanInterval
39381776 135@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
136@PURPOSE@ Get config rescan interval
137@DESC@
138Returns the interval between automatic checks of the configuration (in
2df0c662 139seconds) specified in <parameter>config</parameter>. The configuration is checked during
bfc2dc3a
KP
140a call to FcFontList when this interval has passed since the last check.
141@@
142
39381776 143@RET@ FcBool
61139cf6 144@FUNC@ FcConfigSetRescanInterval
bfc2dc3a 145@TYPE1@ FcConfig * @ARG1@ config
61895ed1 146@TYPE2@ int% @ARG2@ rescanInterval
bfc2dc3a
KP
147@PURPOSE@ Set config rescan interval
148@DESC@
149Sets the rescan interval; returns FcFalse if an error occurred.
150@@
151
39381776
KP
152@RET@ FcBool
153@FUNC@ FcConfigAppFontAddFile
bfc2dc3a 154@TYPE1@ FcConfig * @ARG1@ config
39381776 155@TYPE2@ const char * @ARG2@ file
bfc2dc3a
KP
156@PURPOSE@ Add font file to font database
157@DESC@
158Adds an application-specific font to the configuration.
159@@
160
39381776
KP
161@RET@ FcBool
162@FUNC@ FcConfigAppFontAddDir
bfc2dc3a 163@TYPE1@ FcConfig * @ARG1@ config
39381776 164@TYPE2@ const char * @ARG1@ dir
bfc2dc3a
KP
165@PURPOSE@ Add fonts from directory to font database
166@DESC@
167Scans the specified directory for fonts, adding each one found to the
168application-specific set of fonts.
169@@
170
39381776
KP
171@RET@ void
172@FUNC@ FcConfigAppFontClear
173@TYPE1@ FcConfig * @ARG1@ config
bfc2dc3a
KP
174@PURPOSE@ Remove all app fonts from font database
175@DESC@
176Clears the set of application-specific fonts.
177@@
178
39381776
KP
179@RET@ FcBool
180@FUNC@ FcConfigSubstituteWithPat
bfc2dc3a
KP
181@TYPE1@ FcConfig * @ARG1@ config
182@TYPE2@ FcPattern * @ARG2@ p
183@TYPE3@ FcPattern * @ARG3@ p_pat
61895ed1 184@TYPE4@ FcMatchKind% @ARG4@ kind
bfc2dc3a
KP
185@PURPOSE@ Execute substitutions
186@DESC@
2df0c662 187Performs the sequence of pattern modification operations, if <parameter>kind</parameter> is
39381776 188FcMatchPattern, then those tagged as pattern operations are applied, else
2df0c662 189if <parameter>kind</parameter> is FcMatchFont, those tagged as font operations are applied and
bfc2dc3a
KP
190p_pat is used for &lt;test&gt; elements with target=pattern.
191@@
192
39381776
KP
193@RET@ FcBool
194@FUNC@ FcConfigSubstitute
bfc2dc3a
KP
195@TYPE1@ FcConfig * @ARG1@ config
196@TYPE2@ FcPattern * @ARG2@ p
61895ed1 197@TYPE3@ FcMatchKind% @ARG3@ kind
bfc2dc3a
KP
198@PURPOSE@ Execute substitutions
199@DESC@
200Calls FcConfigSubstituteWithPat setting p_pat to NULL.
201@@
202
39381776
KP
203@RET@ FcPattern *
204@FUNC@ FcFontMatch
bfc2dc3a
KP
205@TYPE1@ FcConfig * @ARG1@ config
206@TYPE2@ FcPattern * @ARG2@ p
39381776 207@TYPE3@ FcResult * @ARG3@ result
bfc2dc3a
KP
208@PURPOSE@ Return best font
209@DESC@
2df0c662 210Returns the font in <parameter>config</parameter> most close matching <parameter>p</parameter>. This function
bfc2dc3a 211should be called only after FcConfigSubstitute and FcDefaultSubstitute have
2df0c662 212been called for <parameter>p</parameter>; otherwise the results will not be correct.
bfc2dc3a
KP
213@@
214
39381776
KP
215@RET@ FcFontSet *
216@FUNC@ FcFontSort
bfc2dc3a
KP
217@TYPE1@ FcConfig * @ARG1@ config
218@TYPE2@ FcPattern * @ARG2@ p
61895ed1 219@TYPE3@ FcBool% @ARG3@ trim
bfc2dc3a 220@TYPE4@ FcCharSet ** @ARG4@ csp
39381776 221@TYPE5@ FcResult * @ARG5@ result
bfc2dc3a
KP
222@PURPOSE@ Return list of matching fonts
223@DESC@
2df0c662 224Returns the list of fonts sorted by closeness to <parameter>p</parameter>. If <parameter>trim</parameter> is FcTrue,
bfc2dc3a
KP
225elements in the list which don't include Unicode coverage not provided by
226earlier elements in the list are elided. The union of Unicode coverage of
2df0c662 227all of the fonts is returned in <parameter>csp</parameter>, if <parameter>csp</parameter> is not NULL. This function
bfc2dc3a 228should be called only after FcConfigSubstitute and FcDefaultSubstitute have
2df0c662 229been called for <parameter>p</parameter>; otherwise the results will not be correct.
bfc2dc3a
KP
230 </para><para>
231The returned FcFontSet references FcPattern structures which may be shared
232by the return value from multiple FcFontSort calls, applications must not
2df0c662 233modify these patterns. Instead, they should be passed, along with <parameter>p</parameter> to
bfc2dc3a
KP
234FcFontRenderPrepare which combines them into a complete pattern.
235 </para><para>
236The FcFontSet returned by FcFontSort is destroyed by caling FcFontSetDestroy.
237@@
238
39381776
KP
239@RET@ FcPattern *
240@FUNC@ FcFontRenderPrepare
bfc2dc3a
KP
241@TYPE1@ FcConfig * @ARG1@ config
242@TYPE2@ FcPattern * @ARG2@ pat
39381776 243@TYPE3@ FcPattern * @ARG3@ font
bfc2dc3a
KP
244@PURPOSE@ Prepare pattern for loading font file
245@DESC@
2df0c662
KP
246Creates a new pattern consisting of elements of <parameter>font</parameter> not appearing
247in <parameter>pat</parameter>, elements of <parameter>pat</parameter> not appearing in <parameter>font</parameter> and the best matching
248value from <parameter>pat</parameter> for elements appearing in both. The result is passed to
249FcConfigSubstitute with <parameter>kind</parameter> FcMatchFont and then returned.
bfc2dc3a
KP
250@@
251
39381776
KP
252@RET@ FcFontSet *
253@FUNC@ FcFontList
bfc2dc3a
KP
254@TYPE1@ FcConfig * @ARG1@ config
255@TYPE2@ FcPattern * @ARG2@ p
39381776 256@TYPE3@ FcObjectSet * @ARG3@ os
bfc2dc3a
KP
257@PURPOSE@ List fonts
258@DESC@
2df0c662
KP
259Selects fonts matching <parameter>p</parameter>, creates patterns from those fonts containing
260only the objects in <parameter>os</parameter> and returns the set of unique such patterns.
bfc2dc3a
KP
261@@
262
39381776
KP
263@RET@ char *
264@FUNC@ FcConfigFilename
265@TYPE1@ const char * @ARG1@ name
bfc2dc3a
KP
266@PURPOSE@ Find a config file
267@DESC@
268Given the specified external entity name, return the associated filename.
269This provides applications a way to convert various configuration file
39381776 270references into filename form.
bfc2dc3a 271 </para><para>
2df0c662 272A null or empty <parameter>name</parameter> indicates that the default configuration file should
bfc2dc3a 273be used; which file this references can be overridden with the
2df0c662 274FC_CONFIG_FILE environment variable. Next, if the name starts with <parameter>~</parameter>, it
bfc2dc3a
KP
275refers to a file in the current users home directory. Otherwise if the name
276doesn't start with '/', it refers to a file in the default configuration
277directory; the built-in default directory can be overridden with the
278FC_CONFIG_DIR environment variable.
279@@
39381776
KP
280
281@RET@ FcBool
282@FUNC@ FcConfigParseAndLoad
283@TYPE1@ FcConfig * @ARG1@ config
284@TYPE2@ const FcChar8 * @ARG2@ file
26437d49 285@TYPE3@ FcBool% @ARG3@ complain
39381776
KP
286@PURPOSE@ load a configuration file
287@DESC@
288Walks the configuration in 'file' and constructs the internal representation
289in 'config'. Any include files referenced from within 'file' will be loaded
290with FcConfigLoad and also parsed. If 'complain' is FcFalse, no warning
291will be displayed if 'file' does not exist.
292@@