aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/doc/fcconfig.fncs
blob: 24d7121e476712b7ff4bf6c6e1c34464e1213045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
/*
 * fontconfig/doc/fcconfig.fncs
 *
 * Copyright © 2003 Keith Packard
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of the author(s) not be used in
 * advertising or publicity pertaining to distribution of the software without
 * specific, written prior permission.  The authors make no
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.
 *
 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */
@RET@           FcConfig *
@FUNC@          FcConfigCreate
@TYPE1@		void
@PURPOSE@	Create a configuration
@DESC@
Creates an empty configuration.
@@

@RET@           FcConfig *
@FUNC@          FcConfigReference
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Increment config reference count
@DESC@
Add another reference to <parameter>config</parameter>. Configs are freed only
when the reference count reaches zero.
If <parameter>config</parameter> is NULL, the current configuration is used.
In that case this function will be similar to FcConfigGetCurrent() except that
it increments the reference count before returning and the user is responsible
for destroying the configuration when not needed anymore.
@@

@RET@           void
@FUNC@          FcConfigDestroy
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Destroy a configuration
@DESC@
Decrements the config reference count. If all references are gone, destroys
the configuration and any data associated with it.
Note that calling this function with the return from FcConfigGetCurrent will
cause a new configuration to be created for use as current configuration.
@@

@RET@           FcBool
@FUNC@          FcConfigSetCurrent
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Set configuration as default
@DESC@
Sets the current default configuration to <parameter>config</parameter>.  Implicitly calls
FcConfigBuildFonts if necessary, returning FcFalse if that call fails.
@@

@RET@           FcConfig *
@FUNC@          FcConfigGetCurrent
@TYPE1@		void
@PURPOSE@	Return current configuration
@DESC@
Returns the current default configuration.
@@

@RET@           FcBool
@FUNC@          FcConfigUptoDate
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Check timestamps on config files
@DESC@
Checks all of the files related to <parameter>config</parameter> and returns
whether any of them has been modified since the configuration was created.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@		FcChar8 *
@FUNC@		FcConfigHome
@TYPE1@		void
@PURPOSE@	return the current home directory.
@DESC@
Return the current user's home directory, if it is available, and if using it
is enabled, and NULL otherwise.
See also <function>FcConfigEnableHome</function>).
@@

@RET@		FcBool
@FUNC@		FcConfigEnableHome
@TYPE1@		FcBool%				@ARG1@		enable
@PURPOSE@	controls use of the home directory.
@DESC@
If <parameter>enable</parameter> is FcTrue, then Fontconfig will use various
files which are specified relative to the user's home directory (using the ~
notation in the configuration). When <parameter>enable</parameter> is
FcFalse, then all use of the home directory in these contexts will be
disabled. The previous setting of the value is returned.
@@

@RET@           FcBool
@FUNC@          FcConfigBuildFonts
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Build font database
@DESC@
Builds the set of available fonts for the given configuration.  Note that
any changes to the configuration after this call have indeterminate effects.
Returns FcFalse if this operation runs out of memory.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcStrList *
@FUNC@          FcConfigGetConfigDirs
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Get config directories
@DESC@
Returns the list of font directories specified in the configuration files
for <parameter>config</parameter>.  Does not include any subdirectories.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcStrList *
@FUNC@          FcConfigGetFontDirs
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Get font directories
@DESC@
Returns the list of font directories in <parameter>config</parameter>. This includes the
configured font directories along with any directories below those in the
filesystem.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcStrList *
@FUNC@          FcConfigGetConfigFiles
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Get config files
@DESC@
Returns the list of known configuration files used to generate <parameter>config</parameter>.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcChar8 *
@FUNC@          FcConfigGetCache
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	DEPRECATED used to return per-user cache filename
@DESC@
With fontconfig no longer using per-user cache files, this function now
simply returns NULL to indicate that no per-user file exists.
@@

@RET@		FcStrList *
@FUNC@		FcConfigGetCacheDirs
@TYPE1@		const FcConfig *		@ARG1@		config
@PURPOSE@	return the list of directories searched for cache files
@DESC@
<function>FcConfigGetCacheDirs</function> returns a string list containing
all of the directories that fontconfig will search when attempting to load a
cache file for a font directory.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcFontSet *
@FUNC@          FcConfigGetFonts
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		FcSetName%                      @ARG2@          set
@PURPOSE@	Get config font set
@DESC@
Returns one of the two sets of fonts from the configuration as specified
by <parameter>set</parameter>. This font set is owned by the library and must
not be modified or freed.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcBlanks *
@FUNC@          FcConfigGetBlanks
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Get config blanks
@DESC@
Returns the FcBlanks object associated with the given configuration, if no
blanks were present in the configuration, this function will return 0.
The returned FcBlanks object if not NULL, is valid as long as the owning
FcConfig is alive.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           int
@FUNC@          FcConfigGetRescanInterval
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Get config rescan interval
@DESC@
Returns the interval between automatic checks of the configuration (in
seconds) specified in <parameter>config</parameter>.  The configuration is checked during
a call to FcFontList when this interval has passed since the last check.
An interval setting of zero disables automatic checks.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcBool
@FUNC@          FcConfigSetRescanInterval
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		int%                       	@ARG2@          rescanInterval
@PURPOSE@	Set config rescan interval
@DESC@
Sets the rescan interval. Returns FcFalse if the interval cannot be set (due
to allocation failure). Otherwise returns FcTrue.
An interval setting of zero disables automatic checks.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcBool
@FUNC@          FcConfigAppFontAddFile
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		const FcChar8 *			@ARG2@          file
@PURPOSE@	Add font file to font database
@DESC@
Adds an application-specific font to the configuration. Returns FcFalse
if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcBool
@FUNC@          FcConfigAppFontAddDir
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		const FcChar8 *			@ARG2@          dir
@PURPOSE@	Add fonts from directory to font database
@DESC@
Scans the specified directory for fonts, adding each one found to the
application-specific set of fonts. Returns FcFalse
if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           void
@FUNC@          FcConfigAppFontClear
@TYPE1@         FcConfig *                      @ARG1@          config
@PURPOSE@	Remove all app fonts from font database
@DESC@
Clears the set of application-specific fonts.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcBool
@FUNC@          FcConfigSubstituteWithPat
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		FcPattern *			@ARG2@		p
@TYPE3@		FcPattern *			@ARG3@		p_pat
@TYPE4@		FcMatchKind%                     @ARG4@          kind
@PURPOSE@	Execute substitutions
@DESC@
Performs the sequence of pattern modification operations, if <parameter>kind</parameter> is
FcMatchPattern, then those tagged as pattern operations are applied, else
if <parameter>kind</parameter> is FcMatchFont, those tagged as font operations are applied and
p_pat is used for &lt;test&gt; elements with target=pattern. Returns FcFalse
if the substitution cannot be performed (due to allocation failure). Otherwise returns FcTrue.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcBool
@FUNC@          FcConfigSubstitute
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		FcPattern *			@ARG2@		p
@TYPE3@		FcMatchKind%                    @ARG3@          kind
@PURPOSE@	Execute substitutions
@DESC@
Calls FcConfigSubstituteWithPat setting p_pat to NULL. Returns FcFalse
if the substitution cannot be performed (due to allocation failure). Otherwise returns FcTrue.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcPattern *
@FUNC@          FcFontMatch
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		FcPattern *			@ARG2@		p
@TYPE3@		FcResult *                      @ARG3@          result
@PURPOSE@	Return best font
@DESC@
Finds the font in <parameter>sets</parameter> most closely matching
<parameter>pattern</parameter> and returns the result of
<function>FcFontRenderPrepare</function> for that font and the provided
pattern. This function should be called only after
<function>FcConfigSubstitute</function> and
<function>FcDefaultSubstitute</function> have been called for
<parameter>p</parameter>; otherwise the results will not be correct.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcFontSet *
@FUNC@          FcFontSort
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		FcPattern *			@ARG2@		p
@TYPE3@		FcBool%				@ARG3@		trim
@TYPE4@		FcCharSet **			@ARG4@		csp
@TYPE5@		FcResult *                      @ARG5@          result
@PURPOSE@	Return list of matching fonts
@DESC@
Returns the list of fonts sorted by closeness to <parameter>p</parameter>.  If <parameter>trim</parameter> is FcTrue,
elements in the list which don't include Unicode coverage not provided by
earlier elements in the list are elided.  The union of Unicode coverage of
all of the fonts is returned in <parameter>csp</parameter>, if <parameter>csp</parameter> is not NULL.  This function
should be called only after FcConfigSubstitute and FcDefaultSubstitute have
been called for <parameter>p</parameter>; otherwise the results will not be correct.
    </para><para>
The returned FcFontSet references FcPattern structures which may be shared
by the return value from multiple FcFontSort calls, applications must not
modify these patterns.  Instead, they should be passed, along with <parameter>p</parameter> to
<function>FcFontRenderPrepare</function> which combines them into a complete pattern.
    </para><para>
The FcFontSet returned by FcFontSort is destroyed by calling FcFontSetDestroy.
If <parameter>config</parameter> is NULL, the current configuration is used.
@@

@RET@           FcPattern *
@FUNC@          FcFontRenderPrepare
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		FcPattern *			@ARG2@		pat
@TYPE3@		FcPattern *                     @ARG3@          font
@PURPOSE@	Prepare pattern for loading font file
@DESC@
Creates a new pattern consisting of elements of <parameter>font</parameter> not appearing
in <parameter>pat</parameter>, elements of <parameter>pat</parameter> not appearing in <parameter>font</parameter> and the best matching
value from <parameter>pat</parameter> for elements appearing in both.  The result is passed to
FcConfigSubstituteWithPat with <parameter>kind</parameter> FcMatchFont and then returned.
@@

@RET@           FcFontSet *
@FUNC@          FcFontList
@TYPE1@         FcConfig *			@ARG1@		config
@TYPE2@		FcPattern *			@ARG2@		p
@TYPE3@		FcObjectSet *                   @ARG3@          os
@PURPOSE@	List fonts
@DESC@
Selects fonts matching <parameter>p</parameter>, creates patterns from those fonts containing
only the objects in <parameter>os</parameter> and returns the set of unique such patterns.
If <parameter>config</parameter> is NULL, the default configuration is checked
to be up to date, and used.
@@

@RET@           FcChar8 *
@FUNC@          FcConfigFilename
@TYPE1@         const FcChar8 *			@ARG1@          name
@PURPOSE@	Find a config file
@DESC@
Given the specified external entity name, return the associated filename.
This provides applications a way to convert various configuration file
references into filename form.
    </para><para>
A null or empty <parameter>name</parameter> indicates that the default configuration file should
be used; which file this references can be overridden with the
FONTCONFIG_FILE environment variable.  Next, if the name starts with <parameter>~</parameter>, it
refers to a file in the current users home directory.  Otherwise if the name
doesn't start with '/', it refers to a file in the default configuration
directory; the built-in default directory can be overridden with the
FONTCONFIG_PATH environment variable.
@@

@RET@		FcBool
@FUNC@		FcConfigParseAndLoad
@TYPE1@		FcConfig *			@ARG1@		config
@TYPE2@		const FcChar8 *			@ARG2@		file
@TYPE3@		FcBool%				@ARG3@		complain
@PURPOSE@	load a configuration file
@DESC@
Walks the configuration in 'file' and constructs the internal representation
in 'config'.  Any include files referenced from within 'file' will be loaded
and parsed.  If 'complain' is FcFalse, no warning will be displayed if
'file' does not exist. Error and warning messages will be output to stderr.
Returns FcFalse if some error occurred while loading the file, either a
parse error, semantic error or allocation failure. Otherwise returns FcTrue.
@@

@RET@		const FcChar8 *
@FUNC@		FcConfigGetSysRoot
@TYPE1@		const FcConfig *		@ARG1@		config
@PURPOSE@	Obtain the system root directory
@DESC@
Obtrains the system root directory in 'config' if available.
@SINCE@		2.10.92
@@

@RET@		void
@FUNC@		FcConfigSetSysRoot
@TYPE1@		FcConfig *			@ARG1@		config
@TYPE2@		const FcChar8 *			@ARG2@		sysroot
@PURPOSE@	Set the system root directory
@DESC@
Set 'sysroot' as the system root directory. fontconfig prepend 'sysroot'
to the cache directories in order to allow people to generate caches at
the build time. Note that this causes changing current config. i.e.
this function calls FcConfigSetCurrent() internally.
@SINCE@		2.10.92
@@