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