]> git.wh0rd.org - fontconfig.git/blob - doc/fcconfig.fncs
Update documentation for stale FcConfigGetConfig function.
[fontconfig.git] / doc / fcconfig.fncs
1 /*
2 * $Id$
3 *
4 * Copyright © 2003 Keith Packard
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 */
24 @RET@ FcConfig *
25 @FUNC@ FcConfigCreate
26 @TYPE1@ void
27 @PURPOSE@ Create a configuration
28 @DESC@
29 Creates an empty configuration.
30 @@
31
32 @RET@ void
33 @FUNC@ FcConfigDestroy
34 @TYPE1@ FcConfig * @ARG1@ config
35 @PURPOSE@ Destroy a configuration
36 @DESC@
37 Destroys a configuration and any data associated with it. Note that calling
38 this function with the return from FcConfigGetCurrent will place the library
39 in an indeterminate state.
40 @@
41
42 @RET@ FcBool
43 @FUNC@ FcConfigSetCurrent
44 @TYPE1@ FcConfig * @ARG1@ config
45 @PURPOSE@ Set configuration as default
46 @DESC@
47 Sets the current default configuration to <parameter>config</parameter>. Implicitly calls
48 FcConfigBuildFonts if necessary, returning FcFalse if that call fails.
49 @@
50
51 @RET@ FcConfig *
52 @FUNC@ FcConfigGetCurrent
53 @TYPE1@ void
54 @PURPOSE@ Return current configuration
55 @DESC@
56 Returns the current default configuration.
57 @@
58
59 @RET@ FcBool
60 @FUNC@ FcConfigUptoDate
61 @TYPE1@ FcConfig * @ARG1@ config
62 @PURPOSE@ Check timestamps on config files
63 @DESC@
64 Checks all of the files related to <parameter>config</parameter> and returns
65 whether any of them has been modified since the configuration was created.
66 @@
67
68 @RET@ FcBool
69 @FUNC@ FcConfigHome
70 @TYPE1@ void
71 @PURPOSE@ return the current home directory.
72 @DESC@
73 Return the current user's home directory, if it is available, and if using it
74 is enabled. See also <function>FcConfigEnableHome</function>).
75 @@
76
77 @RET@ FcBol
78 @FUNC@ FcConfigEnableHome
79 @TYPE1@ FcBool% @ARG1@ enable
80 @PURPOSE@ controls use of the home directory.
81 @DESC@
82 If <parameter>enable</parameter> is FcTrue, then Fontconfig will use various
83 files which are specified relative to the user's home directory (using the ~
84 notation in the configuration). When <parameter>enable</parameter> is
85 FcFalse, then all use of the home directory in these contexts will be
86 disabled. The previous setting of the value is returned.
87 @@
88
89 @RET@ FcBool
90 @FUNC@ FcConfigBuildFonts
91 @TYPE1@ FcConfig * @ARG1@ config
92 @PURPOSE@ Build font database
93 @DESC@
94 Builds the set of available fonts for the given configuration. Note that
95 any changes to the configuration after this call have indeterminate effects.
96 Returns FcFalse if this operation runs out of memory.
97 @@
98
99 @RET@ FcStrList *
100 @FUNC@ FcConfigGetConfigDirs
101 @TYPE1@ FcConfig * @ARG1@ config
102 @PURPOSE@ Get config directories
103 @DESC@
104 Returns the list of font directories specified in the configuration files
105 for <parameter>config</parameter>. Does not include any subdirectories.
106 @@
107
108 @RET@ FcStrList *
109 @FUNC@ FcConfigGetFontDirs
110 @TYPE1@ FcConfig * @ARG1@ config
111 @PURPOSE@ Get font directories
112 @DESC@
113 Returns the list of font directories in <parameter>config</parameter>. This includes the
114 configured font directories along with any directories below those in the
115 filesystem.
116 @@
117
118 @RET@ FcStrList *
119 @FUNC@ FcConfigGetConfigFiles
120 @TYPE1@ FcConfig * @ARG1@ config
121 @PURPOSE@ Get config files
122 @DESC@
123 Returns the list of known configuration files used to generate <parameter>config</parameter>.
124 Note that this will not include any configuration done with FcConfigParse.
125 @@
126
127 @RET@ char *
128 @FUNC@ FcConfigGetCache
129 @TYPE1@ FcConfig * @ARG1@ config
130 @PURPOSE@ DEPRECATED used to return per-user cache filename
131 @DESC@
132 With fontconfig no longer using per-user cache files, this function now
133 simply returns NULL to indicate that no per-user file exists.
134 @@
135
136 @RET@ FcStrList *
137 @FUNC@ FcConfigGetCacheDirs
138 @TYPE1@ FcConfig * @ARG1@ config
139 @PURPOSE@ return the list of directories searched for cache files
140 @DESC@
141 <function>FcConfigGetCacheDirs</function> returns a string list containing
142 all of the directories that fontconfig will search when attempting to load a
143 cache file for a font directory.
144 @@
145
146 @RET@ FcFontSet *
147 @FUNC@ FcConfigGetFonts
148 @TYPE1@ FcConfig * @ARG1@ config
149 @TYPE2@ FcSetName% @ARG2@ set
150 @PURPOSE@ Get config font set
151 @DESC@
152 Returns one of the two sets of fonts from the configuration as specified
153 by <parameter>set</parameter>.
154 @@
155
156 @RET@ FcBlanks *
157 @FUNC@ FcConfigGetBlanks
158 @TYPE1@ FcConfig * @ARG1@ config
159 @PURPOSE@ Get config blanks
160 @DESC@
161 Returns the FcBlanks object associated with the given configuration, if no
162 blanks were present in the configuration, this function will return 0.
163 @@
164
165 @RET@ int
166 @FUNC@ FcConfigGetRescanInterval
167 @TYPE1@ FcConfig * @ARG1@ config
168 @PURPOSE@ Get config rescan interval
169 @DESC@
170 Returns the interval between automatic checks of the configuration (in
171 seconds) specified in <parameter>config</parameter>. The configuration is checked during
172 a call to FcFontList when this interval has passed since the last check.
173 @@
174
175 @RET@ FcBool
176 @FUNC@ FcConfigSetRescanInterval
177 @TYPE1@ FcConfig * @ARG1@ config
178 @TYPE2@ int% @ARG2@ rescanInterval
179 @PURPOSE@ Set config rescan interval
180 @DESC@
181 Sets the rescan interval; returns FcFalse if an error occurred.
182 @@
183
184 @RET@ FcBool
185 @FUNC@ FcConfigAppFontAddFile
186 @TYPE1@ FcConfig * @ARG1@ config
187 @TYPE2@ const char * @ARG2@ file
188 @PURPOSE@ Add font file to font database
189 @DESC@
190 Adds an application-specific font to the configuration.
191 @@
192
193 @RET@ FcBool
194 @FUNC@ FcConfigAppFontAddDir
195 @TYPE1@ FcConfig * @ARG1@ config
196 @TYPE2@ const char * @ARG1@ dir
197 @PURPOSE@ Add fonts from directory to font database
198 @DESC@
199 Scans the specified directory for fonts, adding each one found to the
200 application-specific set of fonts.
201 @@
202
203 @RET@ void
204 @FUNC@ FcConfigAppFontClear
205 @TYPE1@ FcConfig * @ARG1@ config
206 @PURPOSE@ Remove all app fonts from font database
207 @DESC@
208 Clears the set of application-specific fonts.
209 @@
210
211 @RET@ FcBool
212 @FUNC@ FcConfigSubstituteWithPat
213 @TYPE1@ FcConfig * @ARG1@ config
214 @TYPE2@ FcPattern * @ARG2@ p
215 @TYPE3@ FcPattern * @ARG3@ p_pat
216 @TYPE4@ FcMatchKind% @ARG4@ kind
217 @PURPOSE@ Execute substitutions
218 @DESC@
219 Performs the sequence of pattern modification operations, if <parameter>kind</parameter> is
220 FcMatchPattern, then those tagged as pattern operations are applied, else
221 if <parameter>kind</parameter> is FcMatchFont, those tagged as font operations are applied and
222 p_pat is used for &lt;test&gt; elements with target=pattern.
223 @@
224
225 @RET@ FcBool
226 @FUNC@ FcConfigSubstitute
227 @TYPE1@ FcConfig * @ARG1@ config
228 @TYPE2@ FcPattern * @ARG2@ p
229 @TYPE3@ FcMatchKind% @ARG3@ kind
230 @PURPOSE@ Execute substitutions
231 @DESC@
232 Calls FcConfigSubstituteWithPat setting p_pat to NULL.
233 @@
234
235 @RET@ FcPattern *
236 @FUNC@ FcFontMatch
237 @TYPE1@ FcConfig * @ARG1@ config
238 @TYPE2@ FcPattern * @ARG2@ p
239 @TYPE3@ FcResult * @ARG3@ result
240 @PURPOSE@ Return best font
241 @DESC@
242 Returns the font in <parameter>config</parameter> most close matching <parameter>p</parameter>. This function
243 should be called only after FcConfigSubstitute and FcDefaultSubstitute have
244 been called for <parameter>p</parameter>; otherwise the results will not be correct.
245 @@
246
247 @RET@ FcFontSet *
248 @FUNC@ FcFontSort
249 @TYPE1@ FcConfig * @ARG1@ config
250 @TYPE2@ FcPattern * @ARG2@ p
251 @TYPE3@ FcBool% @ARG3@ trim
252 @TYPE4@ FcCharSet ** @ARG4@ csp
253 @TYPE5@ FcResult * @ARG5@ result
254 @PURPOSE@ Return list of matching fonts
255 @DESC@
256 Returns the list of fonts sorted by closeness to <parameter>p</parameter>. If <parameter>trim</parameter> is FcTrue,
257 elements in the list which don't include Unicode coverage not provided by
258 earlier elements in the list are elided. The union of Unicode coverage of
259 all of the fonts is returned in <parameter>csp</parameter>, if <parameter>csp</parameter> is not NULL. This function
260 should be called only after FcConfigSubstitute and FcDefaultSubstitute have
261 been called for <parameter>p</parameter>; otherwise the results will not be correct.
262 </para><para>
263 The returned FcFontSet references FcPattern structures which may be shared
264 by the return value from multiple FcFontSort calls, applications must not
265 modify these patterns. Instead, they should be passed, along with <parameter>p</parameter> to
266 FcFontRenderPrepare which combines them into a complete pattern.
267 </para><para>
268 The FcFontSet returned by FcFontSort is destroyed by caling FcFontSetDestroy.
269 @@
270
271 @RET@ FcPattern *
272 @FUNC@ FcFontRenderPrepare
273 @TYPE1@ FcConfig * @ARG1@ config
274 @TYPE2@ FcPattern * @ARG2@ pat
275 @TYPE3@ FcPattern * @ARG3@ font
276 @PURPOSE@ Prepare pattern for loading font file
277 @DESC@
278 Creates a new pattern consisting of elements of <parameter>font</parameter> not appearing
279 in <parameter>pat</parameter>, elements of <parameter>pat</parameter> not appearing in <parameter>font</parameter> and the best matching
280 value from <parameter>pat</parameter> for elements appearing in both. The result is passed to
281 FcConfigSubstitute with <parameter>kind</parameter> FcMatchFont and then returned.
282 @@
283
284 @RET@ FcFontSet *
285 @FUNC@ FcFontList
286 @TYPE1@ FcConfig * @ARG1@ config
287 @TYPE2@ FcPattern * @ARG2@ p
288 @TYPE3@ FcObjectSet * @ARG3@ os
289 @PURPOSE@ List fonts
290 @DESC@
291 Selects fonts matching <parameter>p</parameter>, creates patterns from those fonts containing
292 only the objects in <parameter>os</parameter> and returns the set of unique such patterns.
293 @@
294
295 @RET@ char *
296 @FUNC@ FcConfigFilename
297 @TYPE1@ const char * @ARG1@ name
298 @PURPOSE@ Find a config file
299 @DESC@
300 Given the specified external entity name, return the associated filename.
301 This provides applications a way to convert various configuration file
302 references into filename form.
303 </para><para>
304 A null or empty <parameter>name</parameter> indicates that the default configuration file should
305 be used; which file this references can be overridden with the
306 FC_CONFIG_FILE environment variable. Next, if the name starts with <parameter>~</parameter>, it
307 refers to a file in the current users home directory. Otherwise if the name
308 doesn't start with '/', it refers to a file in the default configuration
309 directory; the built-in default directory can be overridden with the
310 FC_CONFIG_DIR environment variable.
311 @@
312
313 @RET@ FcBool
314 @FUNC@ FcConfigParseAndLoad
315 @TYPE1@ FcConfig * @ARG1@ config
316 @TYPE2@ const FcChar8 * @ARG2@ file
317 @TYPE3@ FcBool% @ARG3@ complain
318 @PURPOSE@ load a configuration file
319 @DESC@
320 Walks the configuration in 'file' and constructs the internal representation
321 in 'config'. Any include files referenced from within 'file' will be loaded
322 with FcConfigLoad and also parsed. If 'complain' is FcFalse, no warning
323 will be displayed if 'file' does not exist.
324 @@