<refentry id="pango-Scripts-and-Languages">
<refmeta>
<refentrytitle role="top_of_page" id="pango-Scripts-and-Languages.top_of_page">Scripts and Languages</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PANGO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Scripts and Languages</refname>
<refpurpose>Identifying writing systems and languages</refpurpose>
</refnamediv>

<refsynopsisdiv id="pango-Scripts-and-Languages.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
enum                <link linkend="PangoScript">PangoScript</link>;
#define             <link linkend="PANGO-TYPE-SCRIPT--CAPS">PANGO_TYPE_SCRIPT</link>
                    <link linkend="PangoScriptIter">PangoScriptIter</link>;
<link linkend="PangoScript">PangoScript</link>         <link linkend="pango-script-for-unichar">pango_script_for_unichar</link>            (<link linkend="gunichar">gunichar</link> ch);
<link linkend="PangoLanguage">PangoLanguage</link> *     <link linkend="pango-script-get-sample-language">pango_script_get_sample_language</link>    (<link linkend="PangoScript">PangoScript</link> script);
<link linkend="PangoScriptIter">PangoScriptIter</link> *   <link linkend="pango-script-iter-new">pango_script_iter_new</link>               (const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length);
<link linkend="void">void</link>                <link linkend="pango-script-iter-get-range">pango_script_iter_get_range</link>         (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter,
                                                         G_CONST_RETURN <link linkend="char">char</link> **start,
                                                         G_CONST_RETURN <link linkend="char">char</link> **end,
                                                         <link linkend="PangoScript">PangoScript</link> *script);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-script-iter-next">pango_script_iter_next</link>              (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter);
<link linkend="void">void</link>                <link linkend="pango-script-iter-free">pango_script_iter_free</link>              (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter);
                    <link linkend="PangoLanguage">PangoLanguage</link>;
#define             <link linkend="PANGO-TYPE-LANGUAGE--CAPS">PANGO_TYPE_LANGUAGE</link>
<link linkend="PangoLanguage">PangoLanguage</link> *     <link linkend="pango-language-from-string">pango_language_from_string</link>          (const <link linkend="char">char</link> *language);
const <link linkend="char">char</link> *        <link linkend="pango-language-to-string">pango_language_to_string</link>            (<link linkend="PangoLanguage">PangoLanguage</link> *language);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-language-matches">pango_language_matches</link>              (<link linkend="PangoLanguage">PangoLanguage</link> *language,
                                                         const <link linkend="char">char</link> *range_list);
<link linkend="gboolean">gboolean</link>            <link linkend="pango-language-includes-script">pango_language_includes_script</link>      (<link linkend="PangoLanguage">PangoLanguage</link> *language,
                                                         <link linkend="PangoScript">PangoScript</link> script);
const <link linkend="PangoScript">PangoScript</link> * <link linkend="pango-language-get-scripts">pango_language_get_scripts</link>          (<link linkend="PangoLanguage">PangoLanguage</link> *language,
                                                         <link linkend="int">int</link> *num_scripts);
<link linkend="PangoLanguage">PangoLanguage</link> *     <link linkend="pango-language-get-default">pango_language_get_default</link>          (void);
const <link linkend="char">char</link> *        <link linkend="pango-language-get-sample-string">pango_language_get_sample_string</link>    (<link linkend="PangoLanguage">PangoLanguage</link> *language);
</synopsis>
</refsynopsisdiv>









<refsect1 id="pango-Scripts-and-Languages.description" role="desc">
<title role="desc.title">Description</title>
<para>
The functions in this section are used to identify the writing
system, or <firstterm>script</firstterm> of individual characters
and of ranges within a larger text string.
</para>
</refsect1>

<refsect1 id="pango-Scripts-and-Languages.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="PangoScript" role="enum">
<title>enum PangoScript</title>
<indexterm zone="PangoScript"><primary sortas="PangoScript">PangoScript</primary></indexterm><programlisting>typedef enum {                         /* ISO 15924 code */
      PANGO_SCRIPT_INVALID_CODE = -1,
      PANGO_SCRIPT_COMMON       = 0,   /* Zyyy */
      PANGO_SCRIPT_INHERITED,          /* Qaai */
      PANGO_SCRIPT_ARABIC,             /* Arab */
      PANGO_SCRIPT_ARMENIAN,           /* Armn */
      PANGO_SCRIPT_BENGALI,            /* Beng */
      PANGO_SCRIPT_BOPOMOFO,           /* Bopo */
      PANGO_SCRIPT_CHEROKEE,           /* Cher */
      PANGO_SCRIPT_COPTIC,             /* Qaac */
      PANGO_SCRIPT_CYRILLIC,           /* Cyrl (Cyrs) */
      PANGO_SCRIPT_DESERET,            /* Dsrt */
      PANGO_SCRIPT_DEVANAGARI,         /* Deva */
      PANGO_SCRIPT_ETHIOPIC,           /* Ethi */
      PANGO_SCRIPT_GEORGIAN,           /* Geor (Geon, Geoa) */
      PANGO_SCRIPT_GOTHIC,             /* Goth */
      PANGO_SCRIPT_GREEK,              /* Grek */
      PANGO_SCRIPT_GUJARATI,           /* Gujr */
      PANGO_SCRIPT_GURMUKHI,           /* Guru */
      PANGO_SCRIPT_HAN,                /* Hani */
      PANGO_SCRIPT_HANGUL,             /* Hang */
      PANGO_SCRIPT_HEBREW,             /* Hebr */
      PANGO_SCRIPT_HIRAGANA,           /* Hira */
      PANGO_SCRIPT_KANNADA,            /* Knda */
      PANGO_SCRIPT_KATAKANA,           /* Kana */
      PANGO_SCRIPT_KHMER,              /* Khmr */
      PANGO_SCRIPT_LAO,                /* Laoo */
      PANGO_SCRIPT_LATIN,              /* Latn (Latf, Latg) */
      PANGO_SCRIPT_MALAYALAM,          /* Mlym */
      PANGO_SCRIPT_MONGOLIAN,          /* Mong */
      PANGO_SCRIPT_MYANMAR,            /* Mymr */
      PANGO_SCRIPT_OGHAM,              /* Ogam */
      PANGO_SCRIPT_OLD_ITALIC,         /* Ital */
      PANGO_SCRIPT_ORIYA,              /* Orya */
      PANGO_SCRIPT_RUNIC,              /* Runr */
      PANGO_SCRIPT_SINHALA,            /* Sinh */
      PANGO_SCRIPT_SYRIAC,             /* Syrc (Syrj, Syrn, Syre) */
      PANGO_SCRIPT_TAMIL,              /* Taml */
      PANGO_SCRIPT_TELUGU,             /* Telu */
      PANGO_SCRIPT_THAANA,             /* Thaa */
      PANGO_SCRIPT_THAI,               /* Thai */
      PANGO_SCRIPT_TIBETAN,            /* Tibt */
      PANGO_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
      PANGO_SCRIPT_YI,                 /* Yiii */
      PANGO_SCRIPT_TAGALOG,            /* Tglg */
      PANGO_SCRIPT_HANUNOO,            /* Hano */
      PANGO_SCRIPT_BUHID,              /* Buhd */
      PANGO_SCRIPT_TAGBANWA,           /* Tagb */

      /* Unicode-4.0 additions */
      PANGO_SCRIPT_BRAILLE,            /* Brai */
      PANGO_SCRIPT_CYPRIOT,            /* Cprt */
      PANGO_SCRIPT_LIMBU,              /* Limb */
      PANGO_SCRIPT_OSMANYA,            /* Osma */
      PANGO_SCRIPT_SHAVIAN,            /* Shaw */
      PANGO_SCRIPT_LINEAR_B,           /* Linb */
      PANGO_SCRIPT_TAI_LE,             /* Tale */
      PANGO_SCRIPT_UGARITIC,           /* Ugar */

      /* Unicode-4.1 additions */
      PANGO_SCRIPT_NEW_TAI_LUE,        /* Talu */
      PANGO_SCRIPT_BUGINESE,           /* Bugi */
      PANGO_SCRIPT_GLAGOLITIC,         /* Glag */
      PANGO_SCRIPT_TIFINAGH,           /* Tfng */
      PANGO_SCRIPT_SYLOTI_NAGRI,       /* Sylo */
      PANGO_SCRIPT_OLD_PERSIAN,        /* Xpeo */
      PANGO_SCRIPT_KHAROSHTHI,         /* Khar */

      /* Unicode-5.0 additions */
      PANGO_SCRIPT_UNKNOWN,            /* Zzzz */
      PANGO_SCRIPT_BALINESE,           /* Bali */
      PANGO_SCRIPT_CUNEIFORM,          /* Xsux */
      PANGO_SCRIPT_PHOENICIAN,         /* Phnx */
      PANGO_SCRIPT_PHAGS_PA,           /* Phag */
      PANGO_SCRIPT_NKO,                /* Nkoo */

      /* Unicode-5.1 additions */
      PANGO_SCRIPT_KAYAH_LI,           /* Kali */
      PANGO_SCRIPT_LEPCHA,             /* Lepc */
      PANGO_SCRIPT_REJANG,             /* Rjng */
      PANGO_SCRIPT_SUNDANESE,          /* Sund */
      PANGO_SCRIPT_SAURASHTRA,         /* Saur */
      PANGO_SCRIPT_CHAM,               /* Cham */
      PANGO_SCRIPT_OL_CHIKI,           /* Olck */
      PANGO_SCRIPT_VAI,                /* Vaii */
      PANGO_SCRIPT_CARIAN,             /* Cari */
      PANGO_SCRIPT_LYCIAN,             /* Lyci */
      PANGO_SCRIPT_LYDIAN              /* Lydi */
} PangoScript;
</programlisting>
<para>
The <link linkend="PangoScript"><type>PangoScript</type></link> enumeration identifies different writing
systems. The values correspond to the names as defined in the
Unicode standard.
Note that new types may be added in the future. Applications should be ready
to handle unknown values.  This enumeration is interchangeable with
<link linkend="GUnicodeScript"><type>GUnicodeScript</type></link>.  See <ulink
url="http://www.unicode.org/reports/tr24/">Unicode Standard Annex
#24: Script names</ulink>.
</para><variablelist role="enum">
<varlistentry id="PANGO-SCRIPT-INVALID-CODE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_INVALID_CODE</literal></term>
<listitem><simpara>a value never returned from <link linkend="pango-script-for-unichar"><function>pango_script_for_unichar()</function></link>
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-COMMON--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_COMMON</literal></term>
<listitem><simpara>a character used by multiple different scripts
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-INHERITED--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_INHERITED</literal></term>
<listitem><simpara>a mark glyph that takes its script from the
  base glyph to which it is attached
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-ARABIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_ARABIC</literal></term>
<listitem><simpara>	Arabic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-ARMENIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_ARMENIAN</literal></term>
<listitem><simpara>Armenian
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-BENGALI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_BENGALI</literal></term>
<listitem><simpara>	Bengali
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-BOPOMOFO--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_BOPOMOFO</literal></term>
<listitem><simpara>Bopomofo
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-CHEROKEE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_CHEROKEE</literal></term>
<listitem><simpara>	Cherokee
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-COPTIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_COPTIC</literal></term>
<listitem><simpara>	Coptic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-CYRILLIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_CYRILLIC</literal></term>
<listitem><simpara>	Cyrillic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-DESERET--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_DESERET</literal></term>
<listitem><simpara>	Deseret
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-DEVANAGARI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_DEVANAGARI</literal></term>
<listitem><simpara>	Devanagari
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-ETHIOPIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_ETHIOPIC</literal></term>
<listitem><simpara>	Ethiopic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-GEORGIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_GEORGIAN</literal></term>
<listitem><simpara>	Georgian
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-GOTHIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_GOTHIC</literal></term>
<listitem><simpara>	Gothic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-GREEK--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_GREEK</literal></term>
<listitem><simpara>	Greek
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-GUJARATI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_GUJARATI</literal></term>
<listitem><simpara>	Gujarati
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-GURMUKHI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_GURMUKHI</literal></term>
<listitem><simpara>	Gurmukhi
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-HAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_HAN</literal></term>
<listitem><simpara>	Han
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-HANGUL--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_HANGUL</literal></term>
<listitem><simpara>	Hangul
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-HEBREW--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_HEBREW</literal></term>
<listitem><simpara>	Hebrew
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-HIRAGANA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_HIRAGANA</literal></term>
<listitem><simpara>	Hiragana
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-KANNADA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_KANNADA</literal></term>
<listitem><simpara>	Kannada
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-KATAKANA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_KATAKANA</literal></term>
<listitem><simpara>	Katakana
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-KHMER--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_KHMER</literal></term>
<listitem><simpara>	Khmer
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-LAO--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_LAO</literal></term>
<listitem><simpara>	Lao
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-LATIN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_LATIN</literal></term>
<listitem><simpara>	Latin
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-MALAYALAM--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_MALAYALAM</literal></term>
<listitem><simpara>	Malayalam
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-MONGOLIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_MONGOLIAN</literal></term>
<listitem><simpara>	Mongolian
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-MYANMAR--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_MYANMAR</literal></term>
<listitem><simpara>	Myanmar
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-OGHAM--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_OGHAM</literal></term>
<listitem><simpara>	Ogham
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-OLD-ITALIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_OLD_ITALIC</literal></term>
<listitem><simpara>	Old Italic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-ORIYA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_ORIYA</literal></term>
<listitem><simpara>	Oriya
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-RUNIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_RUNIC</literal></term>
<listitem><simpara>	Runic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-SINHALA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_SINHALA</literal></term>
<listitem><simpara>	Sinhala
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-SYRIAC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_SYRIAC</literal></term>
<listitem><simpara>	Syriac
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-TAMIL--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_TAMIL</literal></term>
<listitem><simpara>	Tamil
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-TELUGU--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_TELUGU</literal></term>
<listitem><simpara>	Telugu
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-THAANA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_THAANA</literal></term>
<listitem><simpara>	Thaana
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-THAI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_THAI</literal></term>
<listitem><simpara>	Thai
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-TIBETAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_TIBETAN</literal></term>
<listitem><simpara>	Tibetan
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-CANADIAN-ABORIGINAL--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_CANADIAN_ABORIGINAL</literal></term>
<listitem><simpara>	Canadian Aboriginal
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-YI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_YI</literal></term>
<listitem><simpara>	Yi
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-TAGALOG--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_TAGALOG</literal></term>
<listitem><simpara>	Tagalog
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-HANUNOO--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_HANUNOO</literal></term>
<listitem><simpara>	Hanunoo
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-BUHID--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_BUHID</literal></term>
<listitem><simpara>	Buhid
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-TAGBANWA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_TAGBANWA</literal></term>
<listitem><simpara>	Tagbanwa
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-BRAILLE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_BRAILLE</literal></term>
<listitem><simpara>	Braille
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-CYPRIOT--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_CYPRIOT</literal></term>
<listitem><simpara>	Cypriot
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-LIMBU--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_LIMBU</literal></term>
<listitem><simpara>	Limbu
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-OSMANYA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_OSMANYA</literal></term>
<listitem><simpara>	Osmanya
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-SHAVIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_SHAVIAN</literal></term>
<listitem><simpara>	Shavian
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-LINEAR-B--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_LINEAR_B</literal></term>
<listitem><simpara>	Linear B
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-TAI-LE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_TAI_LE</literal></term>
<listitem><simpara>	Tai Le
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-UGARITIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_UGARITIC</literal></term>
<listitem><simpara>	Ugaritic
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-NEW-TAI-LUE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_NEW_TAI_LUE</literal></term>
<listitem><simpara>	New Tai Lue. Since 1.10
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-BUGINESE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_BUGINESE</literal></term>
<listitem><simpara>	Buginese. Since 1.10
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-GLAGOLITIC--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_GLAGOLITIC</literal></term>
<listitem><simpara>	Glagolitic. Since 1.10
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-TIFINAGH--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_TIFINAGH</literal></term>
<listitem><simpara>	Tifinagh. Since 1.10
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-SYLOTI-NAGRI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_SYLOTI_NAGRI</literal></term>
<listitem><simpara>	Syloti Nagri. Since 1.10
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-OLD-PERSIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_OLD_PERSIAN</literal></term>
<listitem><simpara>	Old Persian. Since 1.10
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-KHAROSHTHI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_KHAROSHTHI</literal></term>
<listitem><simpara>	Kharoshthi. Since 1.10
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-UNKNOWN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_UNKNOWN</literal></term>
<listitem><simpara>		an unassigned code point. Since 1.14
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-BALINESE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_BALINESE</literal></term>
<listitem><simpara>		Balinese. Since 1.14
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-CUNEIFORM--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_CUNEIFORM</literal></term>
<listitem><simpara>	Cuneiform. Since 1.14
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-PHOENICIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_PHOENICIAN</literal></term>
<listitem><simpara>	Phoenician. Since 1.14
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-PHAGS-PA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_PHAGS_PA</literal></term>
<listitem><simpara>		Phags-pa. Since 1.14
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-NKO--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_NKO</literal></term>
<listitem><simpara>		N'Ko. Since 1.14
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-KAYAH-LI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_KAYAH_LI</literal></term>
<listitem><simpara>  Kayah Li. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-LEPCHA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_LEPCHA</literal></term>
<listitem><simpara>    Lepcha. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-REJANG--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_REJANG</literal></term>
<listitem><simpara>    Rejang. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-SUNDANESE--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_SUNDANESE</literal></term>
<listitem><simpara> Sundanese. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-SAURASHTRA--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_SAURASHTRA</literal></term>
<listitem><simpara>Saurashtra. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-CHAM--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_CHAM</literal></term>
<listitem><simpara>      Cham. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-OL-CHIKI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_OL_CHIKI</literal></term>
<listitem><simpara>  Ol Chiki. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-VAI--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_VAI</literal></term>
<listitem><simpara>       Vai. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-CARIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_CARIAN</literal></term>
<listitem><simpara>    Carian. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-LYCIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_LYCIAN</literal></term>
<listitem><simpara>    Lycian. Since 1.20.1
</simpara></listitem>
</varlistentry>
<varlistentry id="PANGO-SCRIPT-LYDIAN--CAPS" role="constant">
<term><literal>PANGO_SCRIPT_LYDIAN</literal></term>
<listitem><simpara>    Lydian. Since 1.20.1
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="PANGO-TYPE-SCRIPT--CAPS" role="macro">
<title>PANGO_TYPE_SCRIPT</title>
<indexterm zone="PANGO-TYPE-SCRIPT--CAPS"><primary sortas="PANGO_TYPE_SCRIPT">PANGO_TYPE_SCRIPT</primary></indexterm><programlisting>#define PANGO_TYPE_SCRIPT (pango_script_get_type())
</programlisting>
<para>
The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoScript"><type>PangoScript</type></link>
</para></refsect2>
<refsect2 id="PangoScriptIter" role="struct">
<title>PangoScriptIter</title>
<indexterm zone="PangoScriptIter"><primary sortas="PangoScriptIter">PangoScriptIter</primary></indexterm><programlisting>typedef struct _PangoScriptIter PangoScriptIter;</programlisting>
<para>
A <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link> is used to iterate through a string
and identify ranges in different scripts.</para>
<para>
</para></refsect2>
<refsect2 id="pango-script-for-unichar" role="function" condition="since:1.4">
<title>pango_script_for_unichar ()</title>
<indexterm zone="pango-script-for-unichar" role="1.4"><primary sortas="pango_script_for_unichar">pango_script_for_unichar</primary></indexterm><programlisting><link linkend="PangoScript">PangoScript</link>         pango_script_for_unichar            (<link linkend="gunichar">gunichar</link> ch);</programlisting>
<para>
Looks up the <link linkend="PangoScript"><type>PangoScript</type></link> for a particular character (as defined by
Unicode Standard Annex <link linkend="24--CAPS"><type>24</type></link>). No check is made for <parameter>ch</parameter> being a
valid Unicode character; if you pass in invalid character, the
result is undefined.
</para>
<para>
As of Pango 1.18, this function simply returns the return value of
<link linkend="g-unichar-get-script"><function>g_unichar_get_script()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>ch</parameter>&#160;:</term>
<listitem><simpara> a Unicode character
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="PangoScript"><type>PangoScript</type></link> for the character.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="pango-script-get-sample-language" role="function" condition="since:1.4">
<title>pango_script_get_sample_language ()</title>
<indexterm zone="pango-script-get-sample-language" role="1.4"><primary sortas="pango_script_get_sample_language">pango_script_get_sample_language</primary></indexterm><programlisting><link linkend="PangoLanguage">PangoLanguage</link> *     pango_script_get_sample_language    (<link linkend="PangoScript">PangoScript</link> script);</programlisting>
<para>
Given a script, finds a language tag that is reasonably
representative of that script. This will usually be the
most widely spoken or used language written in that script:
for instance, the sample language for <link linkend="PANGO-SCRIPT-CYRILLIC--CAPS"><literal>PANGO_SCRIPT_CYRILLIC</literal></link>
is <literal>ru</literal> (Russian), the sample language
for <link linkend="PANGO-SCRIPT-ARABIC--CAPS"><literal>PANGO_SCRIPT_ARABIC</literal></link> is <literal>ar</literal>.
</para>
<para>
For some
scripts, no sample language will be returned because there
is no language that is sufficiently representative. The best
example of this is <link linkend="PANGO-SCRIPT-HAN--CAPS"><literal>PANGO_SCRIPT_HAN</literal></link>, where various different
variants of written Chinese, Japanese, and Korean all use
significantly different sets of Han characters and forms
of shared characters. No sample language can be provided
for many historical scripts as well.
</para>
<para>
As of 1.18, this function checks the environment variables
PANGO_LANGUAGE and LANGUAGE (checked in that order) first.
If one of them is set, it is parsed as a list of language tags
separated by colons or other separators.  This function
will return the first language in the parsed list that Pango
believes may use <parameter>script</parameter> for writing.  This last predicate
is tested using <link linkend="pango-language-includes-script"><function>pango_language_includes_script()</function></link>.  This can
be used to control Pango's font selection for non-primary
languages.  For example, a PANGO_LANGUAGE enviroment variable
set to "en:fa" makes Pango choose fonts suitable for Persian (fa) 
instead of Arabic (ar) when a segment of Arabic text is found
in an otherwise non-Arabic text.  The same trick can be used to
choose a default language for <link linkend="PANGO-SCRIPT-HAN--CAPS"><literal>PANGO_SCRIPT_HAN</literal></link> when setting
context language is not feasible.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>script</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoScript"><type>PangoScript</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="PangoLanguage"><type>PangoLanguage</type></link> that is representative
of the script, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no such language exists.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="pango-script-iter-new" role="function" condition="since:1.4">
<title>pango_script_iter_new ()</title>
<indexterm zone="pango-script-iter-new" role="1.4"><primary sortas="pango_script_iter_new">pango_script_iter_new</primary></indexterm><programlisting><link linkend="PangoScriptIter">PangoScriptIter</link> *   pango_script_iter_new               (const <link linkend="char">char</link> *text,
                                                         <link linkend="int">int</link> length);</programlisting>
<para>
Create a new <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link>, used to break a string of
Unicode into runs by text. No copy is made of <parameter>text</parameter>, so
the caller needs to make sure it remains valid until
the iterator is freed with <link linkend="pango-script-iter-free"><function>pango_script_iter_free()</function></link>.x</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> a UTF-8 string
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&#160;:</term>
<listitem><simpara> length of <parameter>text</parameter>, or -1 if <parameter>text</parameter> is nul-terminated.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new script iterator, initialized
 to point at the first range in the text, which should be
 freed with <link linkend="pango-script-iter-free"><function>pango_script_iter_free()</function></link>. If the string is
 empty, it will point at an empty range.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="pango-script-iter-get-range" role="function" condition="since:1.4">
<title>pango_script_iter_get_range ()</title>
<indexterm zone="pango-script-iter-get-range" role="1.4"><primary sortas="pango_script_iter_get_range">pango_script_iter_get_range</primary></indexterm><programlisting><link linkend="void">void</link>                pango_script_iter_get_range         (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter,
                                                         G_CONST_RETURN <link linkend="char">char</link> **start,
                                                         G_CONST_RETURN <link linkend="char">char</link> **end,
                                                         <link linkend="PangoScript">PangoScript</link> *script);</programlisting>
<para>
Gets information about the range to which <parameter>iter</parameter> currently points.
The range is the set of locations p where *start &lt;= p &lt; *end.
(That is, it doesn't include the character stored at *end)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara> location to store start position of the range, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara> location to store end position of the range, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>script</parameter>&#160;:</term>
<listitem><simpara> location to store script for range, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="pango-script-iter-next" role="function" condition="since:1.4">
<title>pango_script_iter_next ()</title>
<indexterm zone="pango-script-iter-next" role="1.4"><primary sortas="pango_script_iter_next">pango_script_iter_next</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_script_iter_next              (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter);</programlisting>
<para>
Advances a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link> to the next range. If <parameter>iter</parameter>
is already at the end, it is left unchanged and <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
is returned.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>iter</parameter> was successfully advanced.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="pango-script-iter-free" role="function" condition="since:1.4">
<title>pango_script_iter_free ()</title>
<indexterm zone="pango-script-iter-free" role="1.4"><primary sortas="pango_script_iter_free">pango_script_iter_free</primary></indexterm><programlisting><link linkend="void">void</link>                pango_script_iter_free              (<link linkend="PangoScriptIter">PangoScriptIter</link> *iter);</programlisting>
<para>
Frees a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link> created with <link linkend="pango-script-iter-new"><function>pango_script_iter_new()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoScriptIter"><type>PangoScriptIter</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="PangoLanguage" role="struct">
<title>PangoLanguage</title>
<indexterm zone="PangoLanguage"><primary sortas="PangoLanguage">PangoLanguage</primary></indexterm><programlisting>typedef struct _PangoLanguage PangoLanguage;</programlisting>
<para>
The <link linkend="PangoLanguage"><type>PangoLanguage</type></link> structure is used to
represent a language.
</para>
<para>
<link linkend="PangoLanguage"><type>PangoLanguage</type></link> pointers can be efficiently
copied and compared with each other.
</para></refsect2>
<refsect2 id="PANGO-TYPE-LANGUAGE--CAPS" role="macro">
<title>PANGO_TYPE_LANGUAGE</title>
<indexterm zone="PANGO-TYPE-LANGUAGE--CAPS"><primary sortas="PANGO_TYPE_LANGUAGE">PANGO_TYPE_LANGUAGE</primary></indexterm><programlisting>#define PANGO_TYPE_LANGUAGE (pango_language_get_type ())
</programlisting>
<para>
The <link linkend="GObject"><type>GObject</type></link> type for <link linkend="PangoLanguage"><type>PangoLanguage</type></link>.
</para></refsect2>
<refsect2 id="pango-language-from-string" role="function">
<title>pango_language_from_string ()</title>
<indexterm zone="pango-language-from-string"><primary sortas="pango_language_from_string">pango_language_from_string</primary></indexterm><programlisting><link linkend="PangoLanguage">PangoLanguage</link> *     pango_language_from_string          (const <link linkend="char">char</link> *language);</programlisting>
<para>
Take a RFC-3066 format language tag as a string and convert it to a
<link linkend="PangoLanguage"><type>PangoLanguage</type></link> pointer that can be efficiently copied (copy the
pointer) and compared with other language tags (compare the
pointer.)
</para>
<para>
This function first canonicalizes the string by converting it to
lowercase, mapping '_' to '-', and stripping all characters other
than letters and '-'.
</para>
<para>
Use <link linkend="pango-language-get-default"><function>pango_language_get_default()</function></link> if you want to get the <link linkend="PangoLanguage"><type>PangoLanguage</type></link> for
the current locale of the process.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a string representing a language tag, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an opaque pointer to a <link linkend="PangoLanguage"><type>PangoLanguage</type></link> structure, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
              if <parameter>language</parameter> was <link linkend="NULL--CAPS"><literal>NULL</literal></link>.  The returned pointer will be valid
              forever after, and should not be freed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pango-language-to-string" role="function">
<title>pango_language_to_string ()</title>
<indexterm zone="pango-language-to-string"><primary sortas="pango_language_to_string">pango_language_to_string</primary></indexterm><programlisting>const <link linkend="char">char</link> *        pango_language_to_string            (<link linkend="PangoLanguage">PangoLanguage</link> *language);</programlisting>
<para>
Gets the RFC-3066 format string representing the given language tag.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a language tag.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string representing the language tag.  This is owned by
         Pango and should not be freed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pango-language-matches" role="function">
<title>pango_language_matches ()</title>
<indexterm zone="pango-language-matches"><primary sortas="pango_language_matches">pango_language_matches</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_language_matches              (<link linkend="PangoLanguage">PangoLanguage</link> *language,
                                                         const <link linkend="char">char</link> *range_list);</programlisting>
<para>
Checks if a language tag matches one of the elements in a list of
language ranges. A language tag is considered to match a range
in the list if the range is '*', the range is exactly the tag,
or the range is a prefix of the tag, and the character after it
in the tag is '-'.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a language tag (see <link linkend="pango-language-from-string"><function>pango_language_from_string()</function></link>),
           <link linkend="NULL--CAPS"><literal>NULL</literal></link> is allowed and matches nothing but '*'
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>range_list</parameter>&#160;:</term>
<listitem><simpara> a list of language ranges, separated by ';', ':',
  ',', or space characters.
  Each element must either be '*', or a RFC 3066 language range
  canonicalized as by <link linkend="pango-language-from-string"><function>pango_language_from_string()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if a match was found.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pango-language-includes-script" role="function" condition="since:1.4">
<title>pango_language_includes_script ()</title>
<indexterm zone="pango-language-includes-script" role="1.4"><primary sortas="pango_language_includes_script">pango_language_includes_script</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pango_language_includes_script      (<link linkend="PangoLanguage">PangoLanguage</link> *language,
                                                         <link linkend="PangoScript">PangoScript</link> script);</programlisting>
<para>
Determines if <parameter>script</parameter> is one of the scripts used to
write <parameter>language</parameter>. The returned value is conservative;
if nothing is known about the language tag <parameter>language</parameter>,
<link linkend="TRUE--CAPS"><literal>TRUE</literal></link> will be returned, since, as far as Pango knows,
<parameter>script</parameter> might be used to write <parameter>language</parameter>.
</para>
<para>
This routine is used in Pango's itemization process when
determining if a supplied language tag is relevant to
a particular section of text. It probably is not useful for
applications in most circumstances.
</para>
<para>
This function uses <link linkend="pango-language-get-scripts"><function>pango_language_get_scripts()</function></link> internally.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoLanguage"><type>PangoLanguage</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>script</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoScript"><type>PangoScript</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>script</parameter> is one of the scripts used
to write <parameter>language</parameter> or if nothing is known about <parameter>language</parameter>
(including the case that <parameter>language</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>),
<link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
 
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.4</para></refsect2>
<refsect2 id="pango-language-get-scripts" role="function" condition="since:1.22">
<title>pango_language_get_scripts ()</title>
<indexterm zone="pango-language-get-scripts" role="1.22"><primary sortas="pango_language_get_scripts">pango_language_get_scripts</primary></indexterm><programlisting>const <link linkend="PangoScript">PangoScript</link> * pango_language_get_scripts          (<link linkend="PangoLanguage">PangoLanguage</link> *language,
                                                         <link linkend="int">int</link> *num_scripts);</programlisting>
<para>
Determines the scripts used to to write <parameter>language</parameter>.
If nothing is known about the language tag <parameter>language</parameter>,
or if <parameter>language</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, then <link linkend="NULL--CAPS"><literal>NULL</literal></link> is returned.
The list of scripts returned starts with the script that the
language uses most and continues to the one it uses least.
</para>
<para>
The value <parameter>num_script</parameter> points at will be set to the number
of scripts in the returned array (or zero if <link linkend="NULL--CAPS"><literal>NULL</literal></link> is returned).
</para>
<para>
Most languages use only one script for writing, but there are
some that use two (Latin and Cyrillic for example), and a few
use three (Japanese for example).  Applications should not make
any assumptions on the maximum number of scripts returned
though, except that it is positive if the return value is not
<link linkend="NULL--CAPS"><literal>NULL</literal></link>, and it is a small number.
</para>
<para>
The <link linkend="pango-language-includes-script"><function>pango_language_includes_script()</function></link> function uses this function
internally.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoLanguage"><type>PangoLanguage</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>num_scripts</parameter>&#160;:</term>
<listitem><simpara> location to return number of scripts, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> An array of <link linkend="PangoScript"><type>PangoScript</type></link> values, with the
number of entries in the array stored in <parameter>num_scripts</parameter>, or
<link linkend="NULL--CAPS"><literal>NULL</literal></link> if Pango does not have any information about this
particular language tag (also the case if <parameter>language</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>).
The returned array is owned by Pango and should not be modified
or freed.
 
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.22</para></refsect2>
<refsect2 id="pango-language-get-default" role="function" condition="since:1.16">
<title>pango_language_get_default ()</title>
<indexterm zone="pango-language-get-default" role="1.16"><primary sortas="pango_language_get_default">pango_language_get_default</primary></indexterm><programlisting><link linkend="PangoLanguage">PangoLanguage</link> *     pango_language_get_default          (void);</programlisting>
<para>
Returns the <link linkend="PangoLanguage"><type>PangoLanguage</type></link> for the current locale of the process.
Note that this can change over the life of an application.
</para>
<para>
On Unix systems, this is the return value is derived from
<literal>setlocale(LC_CTYPE, NULL)</literal>, and the user can
affect this through the environment variables LC_ALL, LC_CTYPE or
LANG (checked in that order). The locale string typically is in
the form lang_COUNTRY, where lang is an ISO-639 language code, and
COUNTRY is an ISO-3166 country code. For instance, sv_FI for
Swedish as written in Finland or pt_BR for Portuguese as written in
Brazil.
</para>
<para>
On Windows, the C library does not use any such environment
variables, and setting them won't affect the behavior of functions
like <link linkend="ctime"><function>ctime()</function></link>. The user sets the locale through the Regional Options
in the Control Panel. The C library (in the <link linkend="setlocale"><function>setlocale()</function></link> function)
does not use country and language codes, but country and language
names spelled out in English.
However, this function does check the above environment
variables, and does return a Unix-style locale string based on
either said environment variables or the thread's current locale.
</para>
<para>
Your application should call <literal>setlocale(LC_ALL, "");</literal>
for the user settings to take effect.  Gtk+ does this in its initialization
functions automatically (by calling <link linkend="gtk-set-locale"><function>gtk_set_locale()</function></link>).
See <literal>man setlocale</literal> for more details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the default language as a <link linkend="PangoLanguage"><type>PangoLanguage</type></link>, must not be
              freed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.16</para></refsect2>
<refsect2 id="pango-language-get-sample-string" role="function">
<title>pango_language_get_sample_string ()</title>
<indexterm zone="pango-language-get-sample-string"><primary sortas="pango_language_get_sample_string">pango_language_get_sample_string</primary></indexterm><programlisting>const <link linkend="char">char</link> *        pango_language_get_sample_string    (<link linkend="PangoLanguage">PangoLanguage</link> *language);</programlisting>
<para>
Get a string that is representative of the characters needed to
render a particular language.
</para>
<para>
The sample text may be a pangram, but is not necessarily.  It is chosen to
be demonstrative of normal text in the language, as well as exposing font
feature requirements unique to the language.  It is suitable for use
as sample text in a font selection dialog.
</para>
<para>
If <parameter>language</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, the default language as found by
<link linkend="pango-language-get-default"><function>pango_language_get_default()</function></link> is used.
</para>
<para>
If Pango does not have a sample string for <parameter>language</parameter>, the classic
"The quick brown fox..." is returned.  This can be detected by
comparing the returned pointer value to that returned for (non-existent)
language code "xx".  That is, compare to:
<informalexample><programlisting>
pango_language_get_sample_string (pango_language_from_string ("xx"))
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>language</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="PangoLanguage"><type>PangoLanguage</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the sample string. This value is owned by Pango
  and should not be freed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
