2 * fontconfig/doc/fccharset.fncs
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 the author(s) not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. The authors make no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
16 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL THE AUTHOR(S) 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.
25 @FUNC@ FcCharSetCreate
27 @PURPOSE@ Create an empty character set
29 <function>FcCharSetCreate</function> allocates and initializes a new empty
34 @FUNC@ FcCharSetDestroy
35 @TYPE1@ FcCharSet * @ARG1@ fcs
36 @PURPOSE@ Destroy a character set
38 <function>FcCharSetDestroy</function> decrements the reference count
39 <parameter>fcs</parameter>. If the reference count becomes zero, all
40 memory referenced is freed.
44 @FUNC@ FcCharSetAddChar
45 @TYPE1@ FcCharSet * @ARG1@ fcs
46 @TYPE2@ FcChar32% @ARG2@ ucs4
47 @PURPOSE@ Add a character to a charset
49 <function>FcCharSetAddChar</function> adds a single Unicode char to the set,
50 returning FcFalse on failure, either as a result of a constant set or from
51 running out of memory.
55 @FUNC@ FcCharSetDelChar
56 @TYPE1@ FcCharSet * @ARG1@ fcs
57 @TYPE2@ FcChar32% @ARG2@ ucs4
58 @PURPOSE@ Add a character to a charset
60 <function>FcCharSetDelChar</function> deletes a single Unicode char from the set,
61 returning FcFalse on failure, either as a result of a constant set or from
62 running out of memory.
68 @TYPE1@ FcCharSet * @ARG1@ src
69 @PURPOSE@ Copy a charset
71 Makes a copy of <parameter>src</parameter>; note that this may not actually do anything more
72 than increment the reference count on <parameter>src</parameter>.
77 @TYPE1@ const FcCharSet * @ARG1@ a
78 @TYPE2@ const FcCharSet * @ARG2@ b
79 @PURPOSE@ Compare two charsets
81 Returns whether <parameter>a</parameter> and <parameter>b</parameter>
82 contain the same set of Unicode chars.
86 @FUNC@ FcCharSetIntersect
87 @TYPE1@ const FcCharSet * @ARG1@ a
88 @TYPE2@ const FcCharSet * @ARG2@ b
89 @PURPOSE@ Intersect charsets
91 Returns a set including only those chars found in both
92 <parameter>a</parameter> and <parameter>b</parameter>.
97 @TYPE1@ const FcCharSet * @ARG1@ a
98 @TYPE2@ const FcCharSet * @ARG2@ b
99 @PURPOSE@ Add charsets
101 Returns a set including only those chars found in either <parameter>a</parameter> or <parameter>b</parameter>.
105 @FUNC@ FcCharSetSubtract
106 @TYPE1@ const FcCharSet * @ARG1@ a
107 @TYPE2@ const FcCharSet * @ARG2@ b
108 @PURPOSE@ Subtract charsets
110 Returns a set including only those chars found in <parameter>a</parameter> but not <parameter>b</parameter>.
114 @FUNC@ FcCharSetMerge
115 @TYPE1@ FcCharSet * @ARG1@ a
116 @TYPE2@ const FcCharSet * @ARG2@ b
117 @TYPE3@ FcBool * @ARG3@ changed
118 @PURPOSE@ Merge charsets
120 Adds all chars in <parameter>b</parameter> to <parameter>a</parameter>.
121 In other words, this is an in-place version of FcCharSetUnion.
122 If <parameter>changed</parameter> is not NULL, then it returns whether any new
123 chars from <parameter>b</parameter> were added to <parameter>a</parameter>.
124 Returns FcFalse on failure, either when <parameter>a</parameter> is a constant
125 set or from running out of memory.
129 @FUNC@ FcCharSetHasChar
130 @TYPE1@ const FcCharSet * @ARG1@ fcs
131 @TYPE2@ FcChar32% @ARG2@ ucs4
132 @PURPOSE@ Check a charset for a char
134 Returns whether <parameter>fcs</parameter> contains the char <parameter>ucs4</parameter>.
138 @FUNC@ FcCharSetCount
139 @TYPE1@ const FcCharSet * @ARG1@ a
140 @PURPOSE@ Count entries in a charset
142 Returns the total number of Unicode chars in <parameter>a</parameter>.
146 @FUNC@ FcCharSetIntersectCount
147 @TYPE1@ const FcCharSet * @ARG1@ a
148 @TYPE2@ const FcCharSet * @ARG2@ b
149 @PURPOSE@ Intersect and count charsets
151 Returns the number of chars that are in both <parameter>a</parameter> and <parameter>b</parameter>.
155 @FUNC@ FcCharSetSubtractCount
156 @TYPE1@ const FcCharSet * @ARG1@ a
157 @TYPE2@ const FcCharSet * @ARG2@ b
158 @PURPOSE@ Subtract and count charsets
160 Returns the number of chars that are in <parameter>a</parameter> but not in <parameter>b</parameter>.
164 @FUNC@ FcCharSetIsSubset
165 @TYPE1@ const FcCharSet * @ARG1@ a
166 @TYPE2@ const FcCharSet * @ARG2@ b
167 @PURPOSE@ Test for charset inclusion
169 Returns whether <parameter>a</parameter> is a subset of <parameter>b</parameter>.
173 @FUNC@ FcCharSetFirstPage
174 @TYPE1@ const FcCharSet * @ARG1@ a
175 @TYPE2@ FcChar32[FC_CHARSET_MAP_SIZE]% @ARG2@ map
176 @TYPE3@ FcChar32 * @ARG3@ next
177 @PURPOSE@ Start enumerating charset contents
179 Builds an array of bits in <parameter>map</parameter> marking the
180 first page of Unicode coverage of <parameter>a</parameter>.
181 <parameter>*next</parameter> is set to contains the base code point
182 for the next page in <parameter>a</parameter>. Returns the base code
183 point for the page, or <constant>FC_CHARSET_DONE</constant> if
184 <parameter>a</parameter> contains no pages. As an example, if
185 <function>FcCharSetFirstPage</function> returns
186 <literal>0x300</literal> and fills <parameter>map</parameter> with
187 <literallayout class="monospaced">
188 0xffffffff 0xffffffff 0x01000008 0x44300002 0xffffd7f0 0xfffffffb 0xffff7fff 0xffff0003
190 Then the page contains code points <literal>0x300</literal> through
191 <literal>0x33f</literal> (the first 64 code points on the page)
192 because <parameter>map[0]</parameter> and
193 <parameter>map[1]</parameter> both have all their bits set. It also
194 contains code points <literal>0x343</literal> (<parameter>0x300 + 32*2
195 + (4-1)</parameter>) and <literal>0x35e</literal> (<parameter>0x300 +
196 32*2 + (31-1)</parameter>) because <parameter>map[2]</parameter> has
197 the 4th and 31st bits set. The code points represented by
198 <literal>map[3]</literal> and later are left as an excercise for the
203 @FUNC@ FcCharSetNextPage
204 @TYPE1@ const FcCharSet * @ARG1@ a
205 @TYPE2@ FcChar32[FC_CHARSET_MAP_SIZE]% @ARG2@ map
206 @TYPE3@ FcChar32 * @ARG3@ next
207 @PURPOSE@ Continue enumerating charset contents
209 Builds an array of bits in <parameter>map</parameter> marking the
210 Unicode coverage of <parameter>a</parameter> for page containing
211 <parameter>*next</parameter> (see the
212 <function>FcCharSetFirstPage</function> description for details).
213 <parameter>*next</parameter> is set to contains the base code point
214 for the next page in <parameter>a</parameter>. Returns the base of
215 code point for the page, or <constant>FC_CHARSET_DONE</constant> if
216 <parameter>a</parameter> does not contain
217 <parameter>*next</parameter>.
221 @FUNC@ FcCharSetCoverage
222 @TYPE1@ const FcCharSet * @ARG1@ a
223 @TYPE2@ FcChar32 @ARG2@ page
224 @TYPE3@ FcChar32[8] @ARG3@ result
225 @PURPOSE@ DEPRECATED return coverage for a Unicode page
228 This function returns a bitmask in <parameter>result</parameter> which
229 indicates which code points in
230 <parameter>page</parameter> are included in <parameter>a</parameter>.
231 <function>FcCharSetCoverage</function> returns the next page in the charset which has any
238 @PURPOSE@ DEPRECATED alias for FcCharSetCreate
240 <function>FcCharSetNew</function> is a DEPRECATED alias for FcCharSetCreate.