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