12c393a42Smrg/*
2a6844aabSmrg * fontconfig/doc/fcfontset.fncs
32c393a42Smrg *
42c393a42Smrg * Copyright © 2003 Keith Packard
52c393a42Smrg *
62c393a42Smrg * Permission to use, copy, modify, distribute, and sell this software and its
72c393a42Smrg * documentation for any purpose is hereby granted without fee, provided that
82c393a42Smrg * the above copyright notice appear in all copies and that both that
92c393a42Smrg * copyright notice and this permission notice appear in supporting
10ca08ab68Smrg * documentation, and that the name of the author(s) not be used in
112c393a42Smrg * advertising or publicity pertaining to distribution of the software without
12ca08ab68Smrg * specific, written prior permission.  The authors make no
132c393a42Smrg * representations about the suitability of this software for any purpose.  It
142c393a42Smrg * is provided "as is" without express or implied warranty.
152c393a42Smrg *
16a6844aabSmrg * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
172c393a42Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18a6844aabSmrg * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
192c393a42Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
202c393a42Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
212c393a42Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
222c393a42Smrg * PERFORMANCE OF THIS SOFTWARE.
232c393a42Smrg */
241cc69409Smrg@RET@           FcFontSet *
251cc69409Smrg@FUNC@          FcFontSetCreate
261cc69409Smrg@TYPE1@         void
271cc69409Smrg@PURPOSE@       Create a font set
282c393a42Smrg@DESC@
292c393a42SmrgCreates an empty font set.
302c393a42Smrg@@
312c393a42Smrg
321cc69409Smrg@RET@           void
331cc69409Smrg@FUNC@          FcFontSetDestroy
341cc69409Smrg@TYPE1@         FcFontSet *                     @ARG1@          s
351cc69409Smrg@PURPOSE@       Destroy a font set
362c393a42Smrg@DESC@
372c393a42SmrgDestroys a font set.  Note that this destroys any referenced patterns as
382c393a42Smrgwell.
392c393a42Smrg@@
402c393a42Smrg
411cc69409Smrg@RET@           FcBool
421cc69409Smrg@FUNC@          FcFontSetAdd
431cc69409Smrg@TYPE1@         FcFontSet *                     @ARG1@          s
441cc69409Smrg@TYPE2@         FcPattern *                     @ARG2@          font
451cc69409Smrg@PURPOSE@       Add to a font set
462c393a42Smrg@DESC@
472c393a42SmrgAdds a pattern to a font set.  Note that the pattern is not copied before
482c393a42Smrgbeing inserted into the set. Returns FcFalse if the pattern cannot be
492c393a42Smrginserted into the set (due to allocation failure). Otherwise returns FcTrue.
502c393a42Smrg@@
512c393a42Smrg
521cc69409Smrg@RET@           FcFontSet *
531cc69409Smrg@FUNC@          FcFontSetList
541cc69409Smrg@TYPE1@         FcConfig *                      @ARG1@          config
551cc69409Smrg@TYPE2@         FcFontSet **                    @ARG2@          sets
561cc69409Smrg@TYPE3@         int                             @ARG3@          nsets
571cc69409Smrg@TYPE4@         FcPattern *                     @ARG4@          pattern
581cc69409Smrg@TYPE5@         FcObjectSet *                   @ARG5@          object_set
591cc69409Smrg@PURPOSE@       List fonts from a set of font sets
602c393a42Smrg@DESC@
612c393a42SmrgSelects fonts matching <parameter>pattern</parameter> from
622c393a42Smrg<parameter>sets</parameter>, creates patterns from those
632c393a42Smrgfonts containing only the objects in <parameter>object_set</parameter> and returns
642c393a42Smrgthe set of unique such patterns.
65a6844aabSmrgIf <parameter>config</parameter> is NULL, the default configuration is checked
66a6844aabSmrgto be up to date, and used.
672c393a42Smrg@@
682c393a42Smrg
691cc69409Smrg@RET@           FcPattern *
701cc69409Smrg@FUNC@          FcFontSetMatch
711cc69409Smrg@TYPE1@         FcConfig *                      @ARG1@          config
721cc69409Smrg@TYPE2@         FcFontSet **                    @ARG2@          sets
731cc69409Smrg@TYPE3@         int                             @ARG3@          nsets
741cc69409Smrg@TYPE4@         FcPattern *                     @ARG4@          pattern
751cc69409Smrg@TYPE5@         FcResult *                      @ARG5@          result
761cc69409Smrg@PURPOSE@       Return the best font from a set of font sets
772c393a42Smrg@DESC@
782c393a42SmrgFinds the font in <parameter>sets</parameter> most closely matching
792c393a42Smrg<parameter>pattern</parameter> and returns the result of
802c393a42Smrg<function>FcFontRenderPrepare</function> for that font and the provided
812c393a42Smrgpattern. This function should be called only after
822c393a42Smrg<function>FcConfigSubstitute</function> and
832c393a42Smrg<function>FcDefaultSubstitute</function> have been called for
842c393a42Smrg<parameter>pattern</parameter>; otherwise the results will not be correct.
85a6844aabSmrgIf <parameter>config</parameter> is NULL, the current configuration is used.
862c393a42SmrgReturns NULL if an error occurs during this process.
872c393a42Smrg@@
882c393a42Smrg
891cc69409Smrg@RET@           void
901cc69409Smrg@FUNC@          FcFontSetPrint
911cc69409Smrg@TYPE1@         FcFontSet *                     @ARG1@          set
921cc69409Smrg@PURPOSE@       Print a set of patterns to stdout
932c393a42Smrg@DESC@
942c393a42SmrgThis function is useful for diagnosing font related issues, printing the
952c393a42Smrgcomplete contents of every pattern in <parameter>set</parameter>. The format
962c393a42Smrgof the output is designed to be of help to users and developers, and may
972c393a42Smrgchange at any time.
982c393a42Smrg@@
992c393a42Smrg
1001cc69409Smrg@RET@           FcFontSet *
1011cc69409Smrg@FUNC@          FcFontSetSort
1021cc69409Smrg@TYPE1@         FcConfig *                      @ARG1@          config
1031cc69409Smrg@TYPE2@         FcFontSet **                    @ARG2@          sets
1041cc69409Smrg@TYPE3@         int                             @ARG3@          nsets
1051cc69409Smrg@TYPE4@         FcPattern *                     @ARG4@          pattern
1061cc69409Smrg@TYPE5@         FcBool%                         @ARG5@          trim
1071cc69409Smrg@TYPE6@         FcCharSet **                    @ARG6@          csp
1081cc69409Smrg@TYPE7@         FcResult *                      @ARG7@          result
1091cc69409Smrg@PURPOSE@       Add to a font set
1102c393a42Smrg@DESC@
1112c393a42SmrgReturns the list of fonts from <parameter>sets</parameter>
1121cc69409Smrgsorted by closeness to <parameter>pattern</parameter>.
1132c393a42SmrgIf <parameter>trim</parameter> is FcTrue,
1142c393a42Smrgelements in the list which don't include Unicode coverage not provided by
1152c393a42Smrgearlier elements in the list are elided.  The union of Unicode coverage of
1162c393a42Smrgall of the fonts is returned in <parameter>csp</parameter>,
1172c393a42Smrgif <parameter>csp</parameter> is not NULL.  This function
1182c393a42Smrgshould be called only after FcConfigSubstitute and FcDefaultSubstitute have
1192c393a42Smrgbeen called for <parameter>p</parameter>;
1202c393a42Smrgotherwise the results will not be correct.
1212c393a42Smrg    </para><para>
1222c393a42SmrgThe returned FcFontSet references FcPattern structures which may be shared
1232c393a42Smrgby the return value from multiple FcFontSort calls, applications cannot
1242c393a42Smrgmodify these patterns.  Instead, they should be passed, along with
1252c393a42Smrg<parameter>pattern</parameter> to
1262c393a42Smrg<function>FcFontRenderPrepare</function> which combines them into a complete pattern.
1272c393a42Smrg    </para><para>
128ca08ab68SmrgThe FcFontSet returned by FcFontSetSort is destroyed by calling FcFontSetDestroy.
1292c393a42Smrg@@
1302c393a42Smrg
1311cc69409Smrg@RET@           void
1321cc69409Smrg@FUNC@          FcFontSetSortDestroy
1331cc69409Smrg@TYPE1@         FcFontSet *                     @ARG1@          set
1341cc69409Smrg@PURPOSE@       DEPRECATED destroy a font set
1352c393a42Smrg@DESC@
1362c393a42SmrgThis function is DEPRECATED. <function>FcFontSetSortDestroy</function>
1372c393a42Smrgdestroys <parameter>set</parameter> by calling
1382c393a42Smrg<function>FcFontSetDestroy</function>. Applications should use
1392c393a42Smrg<function>FcFontSetDestroy</function> directly instead.
1402c393a42Smrg@@
141