4 * Copyright © 2003 Keith Packard
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.
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.
27 @PURPOSE@ Create a configuration
29 Creates an empty configuration.
33 @FUNC@ FcConfigDestroy
34 @TYPE1@ FcConfig * @ARG1@ config
35 @PURPOSE@ Destroy a configuration
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.
43 @FUNC@ FcConfigSetCurrent
44 @TYPE1@ FcConfig * @ARG1@ config
45 @PURPOSE@ Set configuration as default
47 Sets the current default configuration to <parameter>config</parameter>. Implicitly calls
48 FcConfigBuildFonts if necessary, returning FcFalse if that call fails.
52 @FUNC@ FcConfigGetCurrent
54 @PURPOSE@ Return current configuration
56 Returns the current default configuration.
60 @FUNC@ FcConfigUptoDate
61 @TYPE1@ FcConfig * @ARG1@ config
62 @PURPOSE@ Check timestamps on config files
64 Checks all of the files related to <parameter>config</parameter> and returns whether the
65 in-memory version is in sync with the disk version.
69 @FUNC@ FcConfigBuildFonts
70 @TYPE1@ FcConfig * @ARG1@ config
71 @PURPOSE@ Build font database
73 Builds the set of available fonts for the given configuration. Note that
74 any changes to the configuration after this call have indeterminate effects.
75 Returns FcFalse if this operation runs out of memory.
79 @FUNC@ FcConfigGetConfigDirs
80 @TYPE1@ FcConfig * @ARG1@ config
81 @PURPOSE@ Get config directories
83 Returns the list of font directories specified in the configuration files
84 for <parameter>config</parameter>. Does not include any subdirectories.
88 @FUNC@ FcConfigGetFontDirs
89 @TYPE1@ FcConfig * @ARG1@ config
90 @PURPOSE@ Get font directories
92 Returns the list of font directories in <parameter>config</parameter>. This includes the
93 configured font directories along with any directories below those in the
98 @FUNC@ FcConfigGetConfigFiles
99 @TYPE1@ FcConfig * @ARG1@ config
100 @PURPOSE@ Get config files
102 Returns the list of known configuration files used to generate <parameter>config</parameter>.
103 Note that this will not include any configuration done with FcConfigParse.
107 @FUNC@ FcConfigGetCache
108 @TYPE1@ FcConfig * @ARG1@ config
109 @PURPOSE@ Get cache filename
111 Returns the name of the file used to store per-user font information.
115 @FUNC@ FcConfigGetFonts
116 @TYPE1@ FcConfig * @ARG1@ config
117 @TYPE2@ FcSetName @ARG2@ set
118 @PURPOSE@ Get config font set
120 Returns one of the two sets of fonts from the configuration as specified
121 by <parameter>set</parameter>.
125 @FUNC@ FcConfigGetBlanks
126 @TYPE1@ FcConfig * @ARG1@ config
127 @PURPOSE@ Get config blanks
129 Returns the FcBlanks object associated with the given configuration, if no
130 blanks were present in the configuration, this function will return 0.
134 @FUNC@ FcConfigGetRescanInverval
135 @TYPE1@ FcConfig * @ARG1@ config
136 @PURPOSE@ Get config rescan interval
138 Returns the interval between automatic checks of the configuration (in
139 seconds) specified in <parameter>config</parameter>. The configuration is checked during
140 a call to FcFontList when this interval has passed since the last check.
144 @FUNC@ FcConfigSetRescanInverval
145 @TYPE1@ FcConfig * @ARG1@ config
146 @TYPE2@ int @ARG2@ rescanInterval
147 @PURPOSE@ Set config rescan interval
149 Sets the rescan interval; returns FcFalse if an error occurred.
153 @FUNC@ FcConfigAppFontAddFile
154 @TYPE1@ FcConfig * @ARG1@ config
155 @TYPE2@ const char * @ARG2@ file
156 @PURPOSE@ Add font file to font database
158 Adds an application-specific font to the configuration.
162 @FUNC@ FcConfigAppFontAddDir
163 @TYPE1@ FcConfig * @ARG1@ config
164 @TYPE2@ const char * @ARG1@ dir
165 @PURPOSE@ Add fonts from directory to font database
167 Scans the specified directory for fonts, adding each one found to the
168 application-specific set of fonts.
172 @FUNC@ FcConfigAppFontClear
173 @TYPE1@ FcConfig * @ARG1@ config
174 @PURPOSE@ Remove all app fonts from font database
176 Clears the set of application-specific fonts.
180 @FUNC@ FcConfigSubstituteWithPat
181 @TYPE1@ FcConfig * @ARG1@ config
182 @TYPE2@ FcPattern * @ARG2@ p
183 @TYPE3@ FcPattern * @ARG3@ p_pat
184 @TYPE4@ FcMatchKind @ARG4@ kind
185 @PURPOSE@ Execute substitutions
187 Performs the sequence of pattern modification operations, if <parameter>kind</parameter> is
188 FcMatchPattern, then those tagged as pattern operations are applied, else
189 if <parameter>kind</parameter> is FcMatchFont, those tagged as font operations are applied and
190 p_pat is used for <test> elements with target=pattern.
194 @FUNC@ FcConfigSubstitute
195 @TYPE1@ FcConfig * @ARG1@ config
196 @TYPE2@ FcPattern * @ARG2@ p
197 @TYPE3@ FcMatchKind @ARG3@ kind
198 @PURPOSE@ Execute substitutions
200 Calls FcConfigSubstituteWithPat setting p_pat to NULL.
205 @TYPE1@ FcConfig * @ARG1@ config
206 @TYPE2@ FcPattern * @ARG2@ p
207 @TYPE3@ FcResult * @ARG3@ result
208 @PURPOSE@ Return best font
210 Returns the font in <parameter>config</parameter> most close matching <parameter>p</parameter>. This function
211 should be called only after FcConfigSubstitute and FcDefaultSubstitute have
212 been called for <parameter>p</parameter>; otherwise the results will not be correct.
217 @TYPE1@ FcConfig * @ARG1@ config
218 @TYPE2@ FcPattern * @ARG2@ p
219 @TYPE3@ FcBool @ARG3@ trim
220 @TYPE4@ FcCharSet ** @ARG4@ csp
221 @TYPE5@ FcResult * @ARG5@ result
222 @PURPOSE@ Return list of matching fonts
224 Returns the list of fonts sorted by closeness to <parameter>p</parameter>. If <parameter>trim</parameter> is FcTrue,
225 elements in the list which don't include Unicode coverage not provided by
226 earlier elements in the list are elided. The union of Unicode coverage of
227 all of the fonts is returned in <parameter>csp</parameter>, if <parameter>csp</parameter> is not NULL. This function
228 should be called only after FcConfigSubstitute and FcDefaultSubstitute have
229 been called for <parameter>p</parameter>; otherwise the results will not be correct.
231 The returned FcFontSet references FcPattern structures which may be shared
232 by the return value from multiple FcFontSort calls, applications must not
233 modify these patterns. Instead, they should be passed, along with <parameter>p</parameter> to
234 FcFontRenderPrepare which combines them into a complete pattern.
236 The FcFontSet returned by FcFontSort is destroyed by caling FcFontSetDestroy.
240 @FUNC@ FcFontRenderPrepare
241 @TYPE1@ FcConfig * @ARG1@ config
242 @TYPE2@ FcPattern * @ARG2@ pat
243 @TYPE3@ FcPattern * @ARG3@ font
244 @PURPOSE@ Prepare pattern for loading font file
246 Creates a new pattern consisting of elements of <parameter>font</parameter> not appearing
247 in <parameter>pat</parameter>, elements of <parameter>pat</parameter> not appearing in <parameter>font</parameter> and the best matching
248 value from <parameter>pat</parameter> for elements appearing in both. The result is passed to
249 FcConfigSubstitute with <parameter>kind</parameter> FcMatchFont and then returned.
254 @TYPE1@ FcConfig * @ARG1@ config
255 @TYPE2@ FcPattern * @ARG2@ p
256 @TYPE3@ FcObjectSet * @ARG3@ os
259 Selects fonts matching <parameter>p</parameter>, creates patterns from those fonts containing
260 only the objects in <parameter>os</parameter> and returns the set of unique such patterns.
264 @FUNC@ FcConfigFilename
265 @TYPE1@ const char * @ARG1@ name
266 @PURPOSE@ Find a config file
268 Given the specified external entity name, return the associated filename.
269 This provides applications a way to convert various configuration file
270 references into filename form.
272 A null or empty <parameter>name</parameter> indicates that the default configuration file should
273 be used; which file this references can be overridden with the
274 FC_CONFIG_FILE environment variable. Next, if the name starts with <parameter>~</parameter>, it
275 refers to a file in the current users home directory. Otherwise if the name
276 doesn't start with '/', it refers to a file in the default configuration
277 directory; the built-in default directory can be overridden with the
278 FC_CONFIG_DIR environment variable.