Synopsisenum PangoScript; #define PANGO_TYPE_SCRIPT PangoScriptIter; PangoScript pango_script_for_unichar (gunichar ch); PangoLanguage* pango_script_get_sample_language (PangoScript script); PangoScriptIter* pango_script_iter_new (const char *text, int length); void pango_script_iter_get_range (PangoScriptIter *iter, G_CONST_RETURN char **start, G_CONST_RETURN char **end, PangoScript *script); gboolean pango_script_iter_next (PangoScriptIter *iter); void pango_script_iter_free (PangoScriptIter *iter); PangoLanguage; #define PANGO_TYPE_LANGUAGE PangoLanguage* pango_language_from_string (const char *language); const char* pango_language_to_string (PangoLanguage *language); gboolean pango_language_matches (PangoLanguage *language, const char *range_list); gboolean pango_language_includes_script (PangoLanguage *language, PangoScript script); const PangoScript* pango_language_get_scripts (PangoLanguage *language, int *num_scripts); PangoLanguage* pango_language_get_default (void); const char* pango_language_get_sample_string (PangoLanguage *language); DescriptionThe functions in this section are used to identify the writing system, or script of individual characters and of ranges within a larger text string. Detailsenum PangoScripttypedef 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; The PangoScript 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 GUnicodeScript. See Unicode Standard Annex "" Script names.
PANGO_TYPE_SCRIPT#define PANGO_TYPE_SCRIPT (pango_script_get_type()) The GObject type for PangoScript PangoScriptItertypedef struct _PangoScriptIter PangoScriptIter; A PangoScriptIter is used to iterate through a string and identify ranges in different scripts.
pango_script_for_unichar ()PangoScript pango_script_for_unichar (gunichar ch);
Looks up the PangoScript for a particular character (as defined by
Unicode Standard Annex 24). No check is made for
As of Pango 1.18, this function simply returns the return value of
Since 1.4 pango_script_get_sample_language ()PangoLanguage* pango_script_get_sample_language (PangoScript script);
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
For some
scripts, no sample language will be returned because there
is no language that is sufficiently representative. The best
example of this is
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
Since 1.4 pango_script_iter_new ()PangoScriptIter* pango_script_iter_new (const char *text, int length);
Create a new PangoScriptIter, used to break a string of
Unicode into runs by text. No copy is made of
Since 1.4 pango_script_iter_get_range ()void pango_script_iter_get_range (PangoScriptIter *iter, G_CONST_RETURN char **start, G_CONST_RETURN char **end, PangoScript *script);
Gets information about the range to which
Since 1.4 pango_script_iter_next ()gboolean pango_script_iter_next (PangoScriptIter *iter);
Advances a PangoScriptIter to the next range. If
Since 1.4 pango_script_iter_free ()void pango_script_iter_free (PangoScriptIter *iter);
Frees a PangoScriptIter created with
Since 1.4 PangoLanguagetypedef struct _PangoLanguage PangoLanguage; The PangoLanguage structure is used to represent a language. PangoLanguage pointers can be efficiently copied and compared with each other. PANGO_TYPE_LANGUAGE#define PANGO_TYPE_LANGUAGE (pango_language_get_type ()) The GObject type for PangoLanguage. pango_language_from_string ()PangoLanguage* pango_language_from_string (const char *language); Take a RFC-3066 format language tag as a string and convert it to a PangoLanguage pointer that can be efficiently copied (copy the pointer) and compared with other language tags (compare the pointer.) This function first canonicalizes the string by converting it to lowercase, mapping '_' to '-', and stripping all characters other than letters and '-'.
Use
pango_language_to_string ()const char* pango_language_to_string (PangoLanguage *language); Gets the RFC-3066 format string representing the given language tag.
pango_language_matches ()gboolean pango_language_matches (PangoLanguage *language, const char *range_list); 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 '-'.
pango_language_includes_script ()gboolean pango_language_includes_script (PangoLanguage *language, PangoScript script);
Determines if 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.
This function uses
Since 1.4 pango_language_get_scripts ()const PangoScript* pango_language_get_scripts (PangoLanguage *language, int *num_scripts);
Determines the scripts used to to write
The value
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
The
Since 1.22 pango_language_get_default ()PangoLanguage* pango_language_get_default (void); Returns the PangoLanguage for the current locale of the process. Note that this can change over the life of an application.
On Unix systems, this is the return value is derived from
On Windows, the C library does not use any such environment
variables, and setting them won't affect the behavior of functions
like
Your application should call
Since 1.16 pango_language_get_sample_string ()const char* pango_language_get_sample_string (PangoLanguage *language); Get a string that is representative of the characters needed to render a particular language. 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.
If
If Pango does not have a sample string for pango_language_get_sample_string (pango_language_from_string ("xx"))
|