12c393a42Smrg/* 22c393a42Smrg * Copyright © 2007 Keith Packard 32c393a42Smrg * 42c393a42Smrg * Permission to use, copy, modify, distribute, and sell this software and its 52c393a42Smrg * documentation for any purpose is hereby granted without fee, provided that 62c393a42Smrg * the above copyright notice appear in all copies and that both that copyright 72c393a42Smrg * notice and this permission notice appear in supporting documentation, and 82c393a42Smrg * that the name of the copyright holders not be used in advertising or 92c393a42Smrg * publicity pertaining to distribution of the software without specific, 102c393a42Smrg * written prior permission. The copyright holders make no representations 112c393a42Smrg * about the suitability of this software for any purpose. It is provided "as 122c393a42Smrg * is" without express or implied warranty. 132c393a42Smrg * 142c393a42Smrg * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 152c393a42Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 162c393a42Smrg * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 172c393a42Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 182c393a42Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 192c393a42Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 202c393a42Smrg * OF THIS SOFTWARE. 212c393a42Smrg */ 222c393a42Smrg 231cc69409Smrg@RET@ FcLangSet * 241cc69409Smrg@FUNC@ FcLangSetCreate 251cc69409Smrg@TYPE1@ void 261cc69409Smrg@PURPOSE@ create a langset object 272c393a42Smrg@DESC@ 282c393a42Smrg<function>FcLangSetCreate</function> creates a new FcLangSet object. 292c393a42Smrg@@ 302c393a42Smrg 311cc69409Smrg@RET@ void 321cc69409Smrg@FUNC@ FcLangSetDestroy 331cc69409Smrg@TYPE1@ FcLangSet * @ARG1@ ls 341cc69409Smrg@PURPOSE@ destroy a langset object 352c393a42Smrg@DESC@ 362c393a42Smrg<function>FcLangSetDestroy</function> destroys a FcLangSet object, freeing 372c393a42Smrgall memory associated with it. 382c393a42Smrg@@ 392c393a42Smrg 401cc69409Smrg@RET@ FcLangSet * 411cc69409Smrg@FUNC@ FcLangSetCopy 421cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls 431cc69409Smrg@PURPOSE@ copy a langset object 442c393a42Smrg@DESC@ 452c393a42Smrg<function>FcLangSetCopy</function> creates a new FcLangSet object and 462c393a42Smrgpopulates it with the contents of <parameter>ls</parameter>. 472c393a42Smrg@@ 482c393a42Smrg 491cc69409Smrg@RET@ FcBool 501cc69409Smrg@FUNC@ FcLangSetAdd 511cc69409Smrg@TYPE1@ FcLangSet * @ARG1@ ls 521cc69409Smrg@TYPE2@ const FcChar8 * @ARG2@ lang 531cc69409Smrg@PURPOSE@ add a language to a langset 542c393a42Smrg@DESC@ 552c393a42Smrg<parameter>lang</parameter> is added to <parameter>ls</parameter>. 562c393a42Smrg<parameter>lang</parameter> should be of the form Ll-Tt where Ll is a 572c393a42Smrgtwo or three letter language from ISO 639 and Tt is a territory from ISO 582c393a42Smrg3166. 592c393a42Smrg@@ 602c393a42Smrg 611cc69409Smrg@RET@ FcBool 621cc69409Smrg@FUNC@ FcLangSetDel 631cc69409Smrg@TYPE1@ FcLangSet * @ARG1@ ls 641cc69409Smrg@TYPE2@ const FcChar8 * @ARG2@ lang 651cc69409Smrg@PURPOSE@ delete a language from a langset 66ca08ab68Smrg@DESC@ 67ca08ab68Smrg<parameter>lang</parameter> is removed from <parameter>ls</parameter>. 68ca08ab68Smrg<parameter>lang</parameter> should be of the form Ll-Tt where Ll is a 69ca08ab68Smrgtwo or three letter language from ISO 639 and Tt is a territory from ISO 70ca08ab68Smrg3166. 711cc69409Smrg@SINCE@ 2.9.0 72ca08ab68Smrg@@ 73ca08ab68Smrg 741cc69409Smrg@RET@ FcLangSet * 751cc69409Smrg@FUNC@ FcLangSetUnion 761cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls_a 771cc69409Smrg@TYPE2@ const FcLangSet * @ARG2@ ls_b 781cc69409Smrg@PURPOSE@ Add langsets 79ca08ab68Smrg@DESC@ 80ca08ab68SmrgReturns a set including only those languages found in either <parameter>ls_a</parameter> or <parameter>ls_b</parameter>. 811cc69409Smrg@SINCE@ 2.9.0 82ca08ab68Smrg@@ 83ca08ab68Smrg 841cc69409Smrg@RET@ FcLangSet * 851cc69409Smrg@FUNC@ FcLangSetSubtract 861cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls_a 871cc69409Smrg@TYPE2@ const FcLangSet * @ARG2@ ls_b 881cc69409Smrg@PURPOSE@ Subtract langsets 89ca08ab68Smrg@DESC@ 90ca08ab68SmrgReturns a set including only those languages found in <parameter>ls_a</parameter> but not in <parameter>ls_b</parameter>. 911cc69409Smrg@SINCE@ 2.9.0 92ca08ab68Smrg@@ 93ca08ab68Smrg 941cc69409Smrg@RET@ FcLangResult 951cc69409Smrg@FUNC@ FcLangSetCompare 961cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls_a 971cc69409Smrg@TYPE2@ const FcLangSet * @ARG2@ ls_b 981cc69409Smrg@PURPOSE@ compare language sets 992c393a42Smrg@DESC@ 1002c393a42Smrg<function>FcLangSetCompare</function> compares language coverage for 1012c393a42Smrg<parameter>ls_a</parameter> and <parameter>ls_b</parameter>. If they share 1022c393a42Smrgany language and territory pair, this function returns FcLangEqual. If they 1032c393a42Smrgshare a language but differ in which territory that language is for, this 104ca08ab68Smrgfunction returns FcLangDifferentTerritory. If they share no languages in 1052c393a42Smrgcommon, this function returns FcLangDifferentLang. 1062c393a42Smrg@@ 1072c393a42Smrg 1081cc69409Smrg@RET@ FcBool 1091cc69409Smrg@FUNC@ FcLangSetContains 1101cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls_a 1111cc69409Smrg@TYPE2@ const FcLangSet * @ARG2@ ls_b 1121cc69409Smrg@PURPOSE@ check langset subset relation 1132c393a42Smrg@DESC@ 1142c393a42Smrg<function>FcLangSetContains</function> returns FcTrue if 1152c393a42Smrg<parameter>ls_a</parameter> contains every language in 1162c393a42Smrg<parameter>ls_b</parameter>. <parameter>ls_a</parameter> will 'contain' a 1172c393a42Smrglanguage from <parameter>ls_b</parameter> if <parameter>ls_a</parameter> 1182c393a42Smrghas exactly the language, or either the language or 1192c393a42Smrg<parameter>ls_a</parameter> has no territory. 1202c393a42Smrg@@ 1212c393a42Smrg 1221cc69409Smrg@RET@ FcBool 1231cc69409Smrg@FUNC@ FcLangSetEqual 1241cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls_a 1251cc69409Smrg@TYPE2@ const FcLangSet * @ARG2@ ls_b 1261cc69409Smrg@PURPOSE@ test for matching langsets 1272c393a42Smrg@DESC@ 1282c393a42SmrgReturns FcTrue if and only if <parameter>ls_a</parameter> supports precisely 1292c393a42Smrgthe same language and territory combinations as <parameter>ls_b</parameter>. 1302c393a42Smrg@@ 1312c393a42Smrg 1321cc69409Smrg@RET@ FcChar32 1331cc69409Smrg@FUNC@ FcLangSetHash 1341cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls 1351cc69409Smrg@PURPOSE@ return a hash value for a langset 1362c393a42Smrg@DESC@ 1372c393a42SmrgThis function returns a value which depends solely on the languages 1382c393a42Smrgsupported by <parameter>ls</parameter>. Any language which equals 1392c393a42Smrg<parameter>ls</parameter> will have the same result from 1402c393a42Smrg<function>FcLangSetHash</function>. However, two langsets with the same hash 1412c393a42Smrgvalue may not be equal. 1422c393a42Smrg@@ 1432c393a42Smrg 1441cc69409Smrg@RET@ FcLangResult 1451cc69409Smrg@FUNC@ FcLangSetHasLang 1461cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls 1471cc69409Smrg@TYPE2@ const FcChar8 * @ARG2@ lang 1481cc69409Smrg@PURPOSE@ test langset for language support 1492c393a42Smrg@DESC@ 1502c393a42Smrg<function>FcLangSetHasLang</function> checks whether 1511cc69409Smrg<parameter>ls</parameter> supports <parameter>lang</parameter>. If 1522c393a42Smrg<parameter>ls</parameter> has a matching language and territory pair, 1532c393a42Smrgthis function returns FcLangEqual. If <parameter>ls</parameter> has 1542c393a42Smrga matching language but differs in which territory that language is for, this 1551cc69409Smrgfunction returns FcLangDifferentTerritory. If <parameter>ls</parameter> 1562c393a42Smrghas no matching language, this function returns FcLangDifferentLang. 1572c393a42Smrg@@ 1582c393a42Smrg 1591cc69409Smrg@RET@ FcStrSet * 1601cc69409Smrg@FUNC@ FcGetDefaultLangs 1611cc69409Smrg@TYPE1@ void 1621cc69409Smrg@PURPOSE@ Get the default languages list 163ca08ab68Smrg@DESC@ 164ca08ab68SmrgReturns a string set of the default languages according to the environment variables on the system. 165ca08ab68SmrgThis function looks for them in order of FC_LANG, LC_ALL, LC_CTYPE and LANG then. 166ca08ab68SmrgIf there are no valid values in those environment variables, "en" will be set as fallback. 1671cc69409Smrg@SINCE@ 2.9.91 168b09479dcSmrg@@ 169ca08ab68Smrg 1701cc69409Smrg@RET@ FcStrSet * 1711cc69409Smrg@FUNC@ FcLangSetGetLangs 1721cc69409Smrg@TYPE1@ const FcLangSet * @ARG1@ ls 1731cc69409Smrg@PURPOSE@ get the list of languages in the langset 174a6844aabSmrg@DESC@ 175a6844aabSmrgReturns a string set of all languages in <parameter>langset</parameter>. 176a6844aabSmrg@@ 177a6844aabSmrg 1781cc69409Smrg@RET@ FcStrSet * 1791cc69409Smrg@FUNC@ FcGetLangs 1801cc69409Smrg@TYPE1@ void 1811cc69409Smrg@PURPOSE@ Get list of languages 1822c393a42Smrg@DESC@ 1832c393a42SmrgReturns a string set of all known languages. 1842c393a42Smrg@@ 1852c393a42Smrg 1861cc69409Smrg@RET@ FcChar8 * 1871cc69409Smrg@FUNC@ FcLangNormalize 1881cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ lang 1891cc69409Smrg@PURPOSE@ Normalize the language string 190c9710b42Smrg@DESC@ 191c9710b42SmrgReturns a string to make <parameter>lang</parameter> suitable on fontconfig. 1921cc69409Smrg@SINCE@ 2.10.91 193c9710b42Smrg@@ 194c9710b42Smrg 1951cc69409Smrg@RET@ const FcCharSet * 1961cc69409Smrg@FUNC@ FcLangGetCharSet 1971cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ lang 1981cc69409Smrg@PURPOSE@ Get character map for a language 1992c393a42Smrg@DESC@ 2002c393a42SmrgReturns the FcCharMap for a language. 2012c393a42Smrg@@ 202