fcfontset.fncs revision ca08ab68
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 */ 242c393a42Smrg@RET@ FcFontSet * 252c393a42Smrg@FUNC@ FcFontSetCreate 262c393a42Smrg@TYPE1@ void 272c393a42Smrg@PURPOSE@ Create a font set 282c393a42Smrg@DESC@ 292c393a42SmrgCreates an empty font set. 302c393a42Smrg@@ 312c393a42Smrg 322c393a42Smrg@RET@ void 332c393a42Smrg@FUNC@ FcFontSetDestroy 342c393a42Smrg@TYPE1@ FcFontSet * @ARG1@ s 352c393a42Smrg@PURPOSE@ Destroy a font set 362c393a42Smrg@DESC@ 372c393a42SmrgDestroys a font set. Note that this destroys any referenced patterns as 382c393a42Smrgwell. 392c393a42Smrg@@ 402c393a42Smrg 412c393a42Smrg@RET@ FcBool 422c393a42Smrg@FUNC@ FcFontSetAdd 432c393a42Smrg@TYPE1@ FcFontSet * @ARG1@ s 442c393a42Smrg@TYPE2@ FcPattern * @ARG2@ font 452c393a42Smrg@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 522c393a42Smrg@RET@ FcFontSet * 532c393a42Smrg@FUNC@ FcFontSetList 542c393a42Smrg@TYPE1@ FcConfig * @ARG1@ config 552c393a42Smrg@TYPE2@ FcFontSet ** @ARG2@ sets 562c393a42Smrg@TYPE3@ int @ARG3@ nsets 572c393a42Smrg@TYPE4@ FcPattern * @ARG4@ pattern 582c393a42Smrg@TYPE5@ FcObjectSet * @ARG5@ object_set 592c393a42Smrg@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 692c393a42Smrg@RET@ FcPattern * 702c393a42Smrg@FUNC@ FcFontSetMatch 712c393a42Smrg@TYPE1@ FcConfig * @ARG1@ config 722c393a42Smrg@TYPE2@ FcFontSet ** @ARG2@ sets 732c393a42Smrg@TYPE3@ int @ARG3@ nsets 742c393a42Smrg@TYPE4@ FcPattern * @ARG4@ pattern 752c393a42Smrg@TYPE5@ FcResult * @ARG5@ result 762c393a42Smrg@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 892c393a42Smrg@RET@ void 902c393a42Smrg@FUNC@ FcFontSetPrint 912c393a42Smrg@TYPE1@ FcFontSet * @ARG1@ set 922c393a42Smrg@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 1002c393a42Smrg@RET@ 1012c393a42Smrg@FUNC@ FcFontSetSort 1022c393a42Smrg@TYPE1@ FcConfig * @ARG1@ config 1032c393a42Smrg@TYPE2@ FcFontSet ** @ARG2@ sets 1042c393a42Smrg@TYPE3@ int @ARG3@ nsets 1052c393a42Smrg@TYPE4@ FcPattern * @ARG4@ pattern 1062c393a42Smrg@TYPE5@ FcBool% @ARG5@ trim 1072c393a42Smrg@TYPE6@ FcCharSet ** @ARG6@ csp 1082c393a42Smrg@TYPE7@ FcResult * @ARG7@ result 1092c393a42Smrg@PURPOSE@ Add to a font set 1102c393a42Smrg@DESC@ 1112c393a42SmrgReturns the list of fonts from <parameter>sets</parameter> 1122c393a42Smrgsorted 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 1312c393a42Smrg@RET@ 1322c393a42Smrg@FUNC@ FcFontSetSortDestroy 1332c393a42Smrg@TYPE1@ FcFontSet * @ARG1@ set 1342c393a42Smrg@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