]>
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 | ||
39381776 KP |
32 | @RET@ void |
33 | @FUNC@ FcConfigDestroy | |
34 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
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 | ||
39381776 KP |
42 | @RET@ FcBool |
43 | @FUNC@ FcConfigSetCurrent | |
44 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
45 | @PURPOSE@ Set configuration as default |
46 | @DESC@ | |
2df0c662 | 47 | Sets the current default configuration to <parameter>config</parameter>. Implicitly calls |
bfc2dc3a KP |
48 | FcConfigBuildFonts 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@ | |
56 | Returns 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@ | |
5d82c4c8 KP |
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. | |
bfc2dc3a KP |
66 | @@ |
67 | ||
a190678e KP |
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 | ||
39381776 KP |
89 | @RET@ FcBool |
90 | @FUNC@ FcConfigBuildFonts | |
91 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
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 | ||
39381776 KP |
99 | @RET@ FcStrList * |
100 | @FUNC@ FcConfigGetConfigDirs | |
101 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
102 | @PURPOSE@ Get config directories |
103 | @DESC@ | |
104 | Returns the list of font directories specified in the configuration files | |
2df0c662 | 105 | for <parameter>config</parameter>. Does not include any subdirectories. |
bfc2dc3a KP |
106 | @@ |
107 | ||
39381776 KP |
108 | @RET@ FcStrList * |
109 | @FUNC@ FcConfigGetFontDirs | |
110 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
111 | @PURPOSE@ Get font directories |
112 | @DESC@ | |
2df0c662 | 113 | Returns the list of font directories in <parameter>config</parameter>. This includes the |
bfc2dc3a KP |
114 | configured font directories along with any directories below those in the |
115 | filesystem. | |
116 | @@ | |
117 | ||
39381776 KP |
118 | @RET@ FcStrList * |
119 | @FUNC@ FcConfigGetConfigFiles | |
120 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
121 | @PURPOSE@ Get config files |
122 | @DESC@ | |
2df0c662 | 123 | Returns the list of known configuration files used to generate <parameter>config</parameter>. |
bfc2dc3a KP |
124 | @@ |
125 | ||
f2772d6b | 126 | @RET@ FcChar8 * |
39381776 KP |
127 | @FUNC@ FcConfigGetCache |
128 | @TYPE1@ FcConfig * @ARG1@ config | |
7c693979 | 129 | @PURPOSE@ DEPRECATED used to return per-user cache filename |
bfc2dc3a | 130 | @DESC@ |
7c693979 KP |
131 | With fontconfig no longer using per-user cache files, this function now |
132 | simply returns NULL to indicate that no per-user file exists. | |
bfc2dc3a KP |
133 | @@ |
134 | ||
a190678e KP |
135 | @RET@ FcStrList * |
136 | @FUNC@ FcConfigGetCacheDirs | |
137 | @TYPE1@ FcConfig * @ARG1@ config | |
138 | @PURPOSE@ return the list of directories searched for cache files | |
139 | @DESC@ | |
140 | <function>FcConfigGetCacheDirs</function> returns a string list containing | |
141 | all of the directories that fontconfig will search when attempting to load a | |
142 | cache file for a font directory. | |
143 | @@ | |
144 | ||
39381776 KP |
145 | @RET@ FcFontSet * |
146 | @FUNC@ FcConfigGetFonts | |
bfc2dc3a | 147 | @TYPE1@ FcConfig * @ARG1@ config |
61895ed1 | 148 | @TYPE2@ FcSetName% @ARG2@ set |
bfc2dc3a KP |
149 | @PURPOSE@ Get config font set |
150 | @DESC@ | |
39381776 | 151 | Returns one of the two sets of fonts from the configuration as specified |
eaf4470a KP |
152 | by <parameter>set</parameter>. This font set is owned by the library and must |
153 | not be freed. | |
bfc2dc3a KP |
154 | @@ |
155 | ||
39381776 KP |
156 | @RET@ FcBlanks * |
157 | @FUNC@ FcConfigGetBlanks | |
158 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
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 | ||
39381776 | 165 | @RET@ int |
61139cf6 | 166 | @FUNC@ FcConfigGetRescanInterval |
39381776 | 167 | @TYPE1@ FcConfig * @ARG1@ config |
bfc2dc3a KP |
168 | @PURPOSE@ Get config rescan interval |
169 | @DESC@ | |
170 | Returns the interval between automatic checks of the configuration (in | |
2df0c662 | 171 | seconds) specified in <parameter>config</parameter>. The configuration is checked during |
bfc2dc3a | 172 | a call to FcFontList when this interval has passed since the last check. |
30420509 | 173 | An interval setting of zero disables automatic checks. |
bfc2dc3a KP |
174 | @@ |
175 | ||
39381776 | 176 | @RET@ FcBool |
61139cf6 | 177 | @FUNC@ FcConfigSetRescanInterval |
bfc2dc3a | 178 | @TYPE1@ FcConfig * @ARG1@ config |
61895ed1 | 179 | @TYPE2@ int% @ARG2@ rescanInterval |
bfc2dc3a KP |
180 | @PURPOSE@ Set config rescan interval |
181 | @DESC@ | |
fab44f3c KP |
182 | Sets the rescan interval. Returns FcFalse if the interval cannot be set (due |
183 | to allocation failure). Otherwise returns FcTrue. | |
30420509 | 184 | An interval setting of zero disables automatic checks. |
bfc2dc3a KP |
185 | @@ |
186 | ||
39381776 KP |
187 | @RET@ FcBool |
188 | @FUNC@ FcConfigAppFontAddFile | |
bfc2dc3a | 189 | @TYPE1@ FcConfig * @ARG1@ config |
f2772d6b | 190 | @TYPE2@ const FcChar8 * @ARG2@ file |
bfc2dc3a KP |
191 | @PURPOSE@ Add font file to font database |
192 | @DESC@ | |
fab44f3c KP |
193 | Adds an application-specific font to the configuration. Returns FcFalse |
194 | if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue. | |
bfc2dc3a KP |
195 | @@ |
196 | ||
39381776 KP |
197 | @RET@ FcBool |
198 | @FUNC@ FcConfigAppFontAddDir | |
bfc2dc3a | 199 | @TYPE1@ FcConfig * @ARG1@ config |
f2772d6b | 200 | @TYPE2@ const FcChar8 * @ARG2@ dir |
bfc2dc3a KP |
201 | @PURPOSE@ Add fonts from directory to font database |
202 | @DESC@ | |
203 | Scans the specified directory for fonts, adding each one found to the | |
fab44f3c KP |
204 | application-specific set of fonts. Returns FcFalse |
205 | if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue. | |
bfc2dc3a KP |
206 | @@ |
207 | ||
39381776 KP |
208 | @RET@ void |
209 | @FUNC@ FcConfigAppFontClear | |
210 | @TYPE1@ FcConfig * @ARG1@ config | |
bfc2dc3a KP |
211 | @PURPOSE@ Remove all app fonts from font database |
212 | @DESC@ | |
213 | Clears the set of application-specific fonts. | |
214 | @@ | |
215 | ||
39381776 KP |
216 | @RET@ FcBool |
217 | @FUNC@ FcConfigSubstituteWithPat | |
bfc2dc3a KP |
218 | @TYPE1@ FcConfig * @ARG1@ config |
219 | @TYPE2@ FcPattern * @ARG2@ p | |
220 | @TYPE3@ FcPattern * @ARG3@ p_pat | |
61895ed1 | 221 | @TYPE4@ FcMatchKind% @ARG4@ kind |
bfc2dc3a KP |
222 | @PURPOSE@ Execute substitutions |
223 | @DESC@ | |
2df0c662 | 224 | Performs the sequence of pattern modification operations, if <parameter>kind</parameter> is |
39381776 | 225 | FcMatchPattern, then those tagged as pattern operations are applied, else |
2df0c662 | 226 | if <parameter>kind</parameter> is FcMatchFont, those tagged as font operations are applied and |
fab44f3c KP |
227 | p_pat is used for <test> elements with target=pattern. Returns FcFalse |
228 | if the substitution cannot be performed (due to allocation failure). Otherwise returns FcTrue. | |
bfc2dc3a KP |
229 | @@ |
230 | ||
39381776 KP |
231 | @RET@ FcBool |
232 | @FUNC@ FcConfigSubstitute | |
bfc2dc3a KP |
233 | @TYPE1@ FcConfig * @ARG1@ config |
234 | @TYPE2@ FcPattern * @ARG2@ p | |
61895ed1 | 235 | @TYPE3@ FcMatchKind% @ARG3@ kind |
bfc2dc3a KP |
236 | @PURPOSE@ Execute substitutions |
237 | @DESC@ | |
fab44f3c KP |
238 | Calls FcConfigSubstituteWithPat setting p_pat to NULL. Returns FcFalse |
239 | if the substitution cannot be performed (due to allocation failure). Otherwise returns FcTrue. | |
bfc2dc3a KP |
240 | @@ |
241 | ||
39381776 KP |
242 | @RET@ FcPattern * |
243 | @FUNC@ FcFontMatch | |
bfc2dc3a KP |
244 | @TYPE1@ FcConfig * @ARG1@ config |
245 | @TYPE2@ FcPattern * @ARG2@ p | |
39381776 | 246 | @TYPE3@ FcResult * @ARG3@ result |
bfc2dc3a KP |
247 | @PURPOSE@ Return best font |
248 | @DESC@ | |
3fb38716 KP |
249 | Finds the font in <parameter>sets</parameter> most closely matching |
250 | <parameter>pattern</parameter> and returns the result of | |
251 | <function>FcFontRenderPrepare</function> for that font and the provided | |
252 | pattern. This function should be called only after | |
253 | <function>FcConfigSubstitute</function> and | |
254 | <function>FcDefaultSubstitute</function> have been called for | |
255 | <parameter>p</parameter>; otherwise the results will not be correct. | |
bfc2dc3a KP |
256 | @@ |
257 | ||
39381776 KP |
258 | @RET@ FcFontSet * |
259 | @FUNC@ FcFontSort | |
bfc2dc3a KP |
260 | @TYPE1@ FcConfig * @ARG1@ config |
261 | @TYPE2@ FcPattern * @ARG2@ p | |
61895ed1 | 262 | @TYPE3@ FcBool% @ARG3@ trim |
bfc2dc3a | 263 | @TYPE4@ FcCharSet ** @ARG4@ csp |
39381776 | 264 | @TYPE5@ FcResult * @ARG5@ result |
bfc2dc3a KP |
265 | @PURPOSE@ Return list of matching fonts |
266 | @DESC@ | |
2df0c662 | 267 | Returns the list of fonts sorted by closeness to <parameter>p</parameter>. If <parameter>trim</parameter> is FcTrue, |
bfc2dc3a KP |
268 | elements in the list which don't include Unicode coverage not provided by |
269 | earlier elements in the list are elided. The union of Unicode coverage of | |
2df0c662 | 270 | all of the fonts is returned in <parameter>csp</parameter>, if <parameter>csp</parameter> is not NULL. This function |
bfc2dc3a | 271 | should be called only after FcConfigSubstitute and FcDefaultSubstitute have |
2df0c662 | 272 | been called for <parameter>p</parameter>; otherwise the results will not be correct. |
bfc2dc3a KP |
273 | </para><para> |
274 | The returned FcFontSet references FcPattern structures which may be shared | |
275 | by the return value from multiple FcFontSort calls, applications must not | |
2df0c662 | 276 | modify these patterns. Instead, they should be passed, along with <parameter>p</parameter> to |
3fb38716 | 277 | <function>FcFontRenderPrepare</function> which combines them into a complete pattern. |
bfc2dc3a KP |
278 | </para><para> |
279 | The FcFontSet returned by FcFontSort is destroyed by caling FcFontSetDestroy. | |
280 | @@ | |
281 | ||
39381776 KP |
282 | @RET@ FcPattern * |
283 | @FUNC@ FcFontRenderPrepare | |
bfc2dc3a KP |
284 | @TYPE1@ FcConfig * @ARG1@ config |
285 | @TYPE2@ FcPattern * @ARG2@ pat | |
39381776 | 286 | @TYPE3@ FcPattern * @ARG3@ font |
bfc2dc3a KP |
287 | @PURPOSE@ Prepare pattern for loading font file |
288 | @DESC@ | |
2df0c662 KP |
289 | Creates a new pattern consisting of elements of <parameter>font</parameter> not appearing |
290 | in <parameter>pat</parameter>, elements of <parameter>pat</parameter> not appearing in <parameter>font</parameter> and the best matching | |
291 | value from <parameter>pat</parameter> for elements appearing in both. The result is passed to | |
b21bea37 | 292 | FcConfigSubstituteWithPat with <parameter>kind</parameter> FcMatchFont and then returned. |
bfc2dc3a KP |
293 | @@ |
294 | ||
39381776 KP |
295 | @RET@ FcFontSet * |
296 | @FUNC@ FcFontList | |
bfc2dc3a KP |
297 | @TYPE1@ FcConfig * @ARG1@ config |
298 | @TYPE2@ FcPattern * @ARG2@ p | |
39381776 | 299 | @TYPE3@ FcObjectSet * @ARG3@ os |
bfc2dc3a KP |
300 | @PURPOSE@ List fonts |
301 | @DESC@ | |
2df0c662 KP |
302 | Selects fonts matching <parameter>p</parameter>, creates patterns from those fonts containing |
303 | only the objects in <parameter>os</parameter> and returns the set of unique such patterns. | |
bfc2dc3a KP |
304 | @@ |
305 | ||
f2772d6b | 306 | @RET@ FcChar8 * |
39381776 | 307 | @FUNC@ FcConfigFilename |
f2772d6b | 308 | @TYPE1@ const FcChar8 * @ARG1@ name |
bfc2dc3a KP |
309 | @PURPOSE@ Find a config file |
310 | @DESC@ | |
311 | Given the specified external entity name, return the associated filename. | |
312 | This provides applications a way to convert various configuration file | |
39381776 | 313 | references into filename form. |
bfc2dc3a | 314 | </para><para> |
2df0c662 | 315 | A null or empty <parameter>name</parameter> indicates that the default configuration file should |
bfc2dc3a | 316 | be used; which file this references can be overridden with the |
2df0c662 | 317 | FC_CONFIG_FILE environment variable. Next, if the name starts with <parameter>~</parameter>, it |
bfc2dc3a KP |
318 | refers to a file in the current users home directory. Otherwise if the name |
319 | doesn't start with '/', it refers to a file in the default configuration | |
320 | directory; the built-in default directory can be overridden with the | |
321 | FC_CONFIG_DIR environment variable. | |
322 | @@ | |
39381776 KP |
323 | |
324 | @RET@ FcBool | |
325 | @FUNC@ FcConfigParseAndLoad | |
326 | @TYPE1@ FcConfig * @ARG1@ config | |
327 | @TYPE2@ const FcChar8 * @ARG2@ file | |
26437d49 | 328 | @TYPE3@ FcBool% @ARG3@ complain |
39381776 KP |
329 | @PURPOSE@ load a configuration file |
330 | @DESC@ | |
331 | Walks the configuration in 'file' and constructs the internal representation | |
332 | in 'config'. Any include files referenced from within 'file' will be loaded | |
fab44f3c KP |
333 | and parsed. If 'complain' is FcFalse, no warning will be displayed if |
334 | 'file' does not exist. Error and warning messages will be output to stderr. | |
335 | Returns FcFalse if some error occurred while loading the file, either a | |
336 | parse error, semantic error or allocation failure. Otherwise returns FcTrue. | |
39381776 | 337 | @@ |