Blame doc/fccharset.fncs

Packit 352660
/*
Packit 352660
 * fontconfig/doc/fccharset.fncs
Packit 352660
 *
Packit 352660
 * Copyright © 2003 Keith Packard
Packit 352660
 *
Packit 352660
 * Permission to use, copy, modify, distribute, and sell this software and its
Packit 352660
 * documentation for any purpose is hereby granted without fee, provided that
Packit 352660
 * the above copyright notice appear in all copies and that both that
Packit 352660
 * copyright notice and this permission notice appear in supporting
Packit 352660
 * documentation, and that the name of the author(s) not be used in
Packit 352660
 * advertising or publicity pertaining to distribution of the software without
Packit 352660
 * specific, written prior permission.  The authors make no
Packit 352660
 * representations about the suitability of this software for any purpose.  It
Packit 352660
 * is provided "as is" without express or implied warranty.
Packit 352660
 *
Packit 352660
 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
Packit 352660
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
Packit 352660
 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Packit 352660
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
Packit 352660
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
Packit 352660
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
Packit 352660
 * PERFORMANCE OF THIS SOFTWARE.
Packit 352660
 */
Packit 352660
@RET@		FcCharSet *
Packit 352660
@FUNC@		FcCharSetCreate
Packit 352660
@TYPE1@		void
Packit 352660
@PURPOSE@	Create an empty character set
Packit 352660
@DESC@
Packit 352660
<function>FcCharSetCreate</function> allocates and initializes a new empty
Packit 352660
character set object.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		void
Packit 352660
@FUNC@		FcCharSetDestroy
Packit 352660
@TYPE1@		FcCharSet *		@ARG1@		fcs
Packit 352660
@PURPOSE@	Destroy a character set
Packit 352660
@DESC@
Packit 352660
<function>FcCharSetDestroy</function> decrements the reference count 
Packit 352660
<parameter>fcs</parameter>.  If the reference count becomes zero, all
Packit 352660
memory referenced is freed.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcBool 
Packit 352660
@FUNC@		FcCharSetAddChar
Packit 352660
@TYPE1@		FcCharSet *		@ARG1@		fcs
Packit 352660
@TYPE2@		FcChar32% 		@ARG2@		ucs4 
Packit 352660
@PURPOSE@	Add a character to a charset
Packit 352660
@DESC@
Packit 352660
<function>FcCharSetAddChar</function> adds a single Unicode char to the set,
Packit 352660
returning FcFalse on failure, either as a result of a constant set or from
Packit 352660
running out of memory. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcBool 
Packit 352660
@FUNC@		FcCharSetDelChar
Packit 352660
@TYPE1@		FcCharSet *		@ARG1@		fcs
Packit 352660
@TYPE2@		FcChar32% 		@ARG2@		ucs4 
Packit 352660
@PURPOSE@	Add a character to a charset
Packit 352660
@DESC@
Packit 352660
<function>FcCharSetDelChar</function> deletes a single Unicode char from the set,
Packit 352660
returning FcFalse on failure, either as a result of a constant set or from
Packit 352660
running out of memory.
Packit 352660
@SINCE@		2.9.0
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcCharSet *
Packit 352660
@FUNC@		FcCharSetCopy
Packit 352660
@TYPE1@		FcCharSet *		@ARG1@		src
Packit 352660
@PURPOSE@	Copy a charset
Packit 352660
@DESC@
Packit 352660
Makes a copy of <parameter>src</parameter>; note that this may not actually do anything more
Packit 352660
than increment the reference count on <parameter>src</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcBool
Packit 352660
@FUNC@		FcCharSetEqual
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@PURPOSE@	Compare two charsets
Packit 352660
@DESC@
Packit 352660
Returns whether <parameter>a</parameter> and <parameter>b</parameter>
Packit 352660
contain the same set of Unicode chars.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcCharSet *
Packit 352660
@FUNC@		FcCharSetIntersect
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@PURPOSE@	Intersect charsets
Packit 352660
@DESC@
Packit 352660
Returns a set including only those chars found in both
Packit 352660
<parameter>a</parameter> and <parameter>b</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcCharSet *
Packit 352660
@FUNC@		FcCharSetUnion
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@PURPOSE@	Add charsets
Packit 352660
@DESC@
Packit 352660
Returns a set including only those chars found in either <parameter>a</parameter> or <parameter>b</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcCharSet *
Packit 352660
@FUNC@		FcCharSetSubtract
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@PURPOSE@	Subtract charsets
Packit 352660
@DESC@
Packit 352660
Returns a set including only those chars found in <parameter>a</parameter> but not <parameter>b</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcBool
Packit 352660
@FUNC@		FcCharSetMerge
Packit 352660
@TYPE1@		FcCharSet *		@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@TYPE3@		FcBool *		@ARG3@		changed
Packit 352660
@PURPOSE@	Merge charsets
Packit 352660
@DESC@
Packit 352660
Adds all chars in <parameter>b</parameter> to <parameter>a</parameter>.
Packit 352660
In other words, this is an in-place version of FcCharSetUnion.
Packit 352660
If <parameter>changed</parameter> is not NULL, then it returns whether any new
Packit 352660
chars from <parameter>b</parameter> were added to <parameter>a</parameter>.
Packit 352660
Returns FcFalse on failure, either when <parameter>a</parameter> is a constant
Packit 352660
set or from running out of memory.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcBool 
Packit 352660
@FUNC@		FcCharSetHasChar
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		fcs
Packit 352660
@TYPE2@		FcChar32% 		@ARG2@		ucs4
Packit 352660
@PURPOSE@	Check a charset for a char
Packit 352660
@DESC@
Packit 352660
Returns whether <parameter>fcs</parameter> contains the char <parameter>ucs4</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcChar32
Packit 352660
@FUNC@		FcCharSetCount
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@PURPOSE@	Count entries in a charset
Packit 352660
@DESC@
Packit 352660
Returns the total number of Unicode chars in <parameter>a</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcChar32
Packit 352660
@FUNC@		FcCharSetIntersectCount
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@PURPOSE@	Intersect and count charsets
Packit 352660
@DESC@
Packit 352660
Returns the number of chars that are in both <parameter>a</parameter> and <parameter>b</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcChar32
Packit 352660
@FUNC@		FcCharSetSubtractCount
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@PURPOSE@	Subtract and count charsets
Packit 352660
@DESC@
Packit 352660
Returns the number of chars that are in <parameter>a</parameter> but not in <parameter>b</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcBool
Packit 352660
@FUNC@		FcCharSetIsSubset
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		const FcCharSet *	@ARG2@		b
Packit 352660
@PURPOSE@	Test for charset inclusion
Packit 352660
@DESC@
Packit 352660
Returns whether <parameter>a</parameter> is a subset of <parameter>b</parameter>. 
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcChar32
Packit 352660
@FUNC@		FcCharSetFirstPage
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		FcChar32[FC_CHARSET_MAP_SIZE]%	@ARG2@	map
Packit 352660
@TYPE3@		FcChar32 *		@ARG3@		next
Packit 352660
@PURPOSE@	Start enumerating charset contents
Packit 352660
@DESC@
Packit 352660
Builds an array of bits in <parameter>map</parameter> marking the
Packit 352660
first page of Unicode coverage of <parameter>a</parameter>.
Packit 352660
<parameter>*next</parameter> is set to contains the base code point
Packit 352660
for the next page in <parameter>a</parameter>.  Returns the base code
Packit 352660
point for the page, or <constant>FC_CHARSET_DONE</constant> if
Packit 352660
<parameter>a</parameter> contains no pages.  As an example, if
Packit 352660
<function>FcCharSetFirstPage</function> returns
Packit 352660
<literal>0x300</literal> and fills <parameter>map</parameter> with
Packit 352660
<literallayout class="monospaced">
Packit 352660
0xffffffff 0xffffffff 0x01000008 0x44300002 0xffffd7f0 0xfffffffb 0xffff7fff 0xffff0003
Packit 352660
</literallayout>
Packit 352660
Then the page contains code points <literal>0x300</literal> through
Packit 352660
<literal>0x33f</literal> (the first 64 code points on the page)
Packit 352660
because <parameter>map[0]</parameter> and
Packit 352660
<parameter>map[1]</parameter> both have all their bits set.  It also
Packit 352660
contains code points <literal>0x343</literal> (<parameter>0x300 + 32*2
Packit 352660
+ (4-1)</parameter>) and <literal>0x35e</literal> (<parameter>0x300 +
Packit 352660
32*2 + (31-1)</parameter>) because <parameter>map[2]</parameter> has
Packit 352660
the 4th and 31st bits set.  The code points represented by
Packit 352660
<literal>map[3]</literal> and later are left as an excercise for the
Packit 352660
reader ;).
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcChar32
Packit 352660
@FUNC@		FcCharSetNextPage
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		FcChar32[FC_CHARSET_MAP_SIZE]%	@ARG2@	map
Packit 352660
@TYPE3@		FcChar32 *		@ARG3@		next
Packit 352660
@PURPOSE@	Continue enumerating charset contents
Packit 352660
@DESC@
Packit 352660
Builds an array of bits in <parameter>map</parameter> marking the
Packit 352660
Unicode coverage of <parameter>a</parameter> for page containing
Packit 352660
<parameter>*next</parameter> (see the
Packit 352660
<function>FcCharSetFirstPage</function> description for details).
Packit 352660
<parameter>*next</parameter> is set to contains the base code point
Packit 352660
for the next page in <parameter>a</parameter>.  Returns the base of
Packit 352660
code point for the page, or <constant>FC_CHARSET_DONE</constant> if
Packit 352660
<parameter>a</parameter> does not contain
Packit 352660
<parameter>*next</parameter>.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcChar32
Packit 352660
@FUNC@		FcCharSetCoverage
Packit 352660
@TYPE1@		const FcCharSet *	@ARG1@		a
Packit 352660
@TYPE2@		FcChar32		@ARG2@		page
Packit 352660
@TYPE3@		FcChar32[8] 		@ARG3@		result
Packit 352660
@PURPOSE@	DEPRECATED return coverage for a Unicode page
Packit 352660
@DESC@
Packit 352660
DEPRECATED
Packit 352660
This function returns a bitmask in <parameter>result</parameter> which
Packit 352660
indicates which code points in
Packit 352660
<parameter>page</parameter> are included in <parameter>a</parameter>.
Packit 352660
<function>FcCharSetCoverage</function> returns the next page in the charset which has any
Packit 352660
coverage.
Packit 352660
@@
Packit 352660
Packit 352660
@RET@		FcCharSet *
Packit 352660
@FUNC@		FcCharSetNew
Packit 352660
@TYPE1@		void
Packit 352660
@PURPOSE@	DEPRECATED alias for FcCharSetCreate
Packit 352660
@DESC@
Packit 352660
<function>FcCharSetNew</function> is a DEPRECATED alias for FcCharSetCreate.
Packit 352660
@@
Packit 352660