The Pango.Language.Pango_Language structure is used to represent a language.
Pango.Language.Pango_Language pointers can be efficiently copied and compared with each other.
function From_Object (Object : System.Address) return Pango_Language
function From_Object_Free (B : access Pango_Language'Class) return Pango_Language
function From_String (Language : UTF8_String := "") return Pango_Language
Take a RFC-3066 format language tag as a string and convert it to a Pango.Language.Pango_Language 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.Get_Default if you want to get the Pango.Language.Pango_Language for the current locale of the process.
a string representing a language tag, or null
an opaque pointer to a Pango.Language.Pango_Language structure, or null if Language was null. The returned pointer will be valid forever after, and should not be freed.
function Get_Default return Pango_Language
Returns the Pango.Language.Pango_Language 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 setlocale(LC_CTYPE, NULL), 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. On Windows, the C library does not use any such environment variables, and setting them won't affect the behavior of functions like ctime. The user sets the locale through the Regional Options in the Control Panel. The C library (in the setlocale 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. Your application should call setlocale(LC_ALL, ""); for the user settings to take effect. Gtk+ does this in its initialization functions automatically (by calling gtk_set_locale). See man setlocale for more details. Since: gtk+ 1.16
the default language as a Pango.Language.Pango_Language, must not be freed.
function Get_Sample_String (Self : Pango_Language) return UTF8_String
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 Language is null, the default language as found by Pango.Language.Get_Default is used. If Pango does not have a sample string for Language, 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:
pango_language_get_sample_string (pango_language_from_string ("xx"))
the sample string. This value is owned by Pango and should not be freed.
function Get_Scripts (Self : Pango_Language) return Pango_Script_Array
Determines the scripts used to to write Language. If nothing is known about the language tag Language, or if Language is null, then null is returned. The list of scripts returned starts with the script that the language uses most and continues to the one it uses least. The value Num_Script points at will be set to the number of scripts in the returned array (or zero if null is returned). 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 null, and it is a small number. The Pango.Language.Includes_Script function uses this function internally. Note: while the return value is declared as PangoScript, the returned values are from the GUnicodeScript enumeration, which may have more values. Callers need to handle unknown values. Since: gtk+ 1.22
function Get_Type return Glib.GType
function Includes_Script
(Self : Pango_Language;
Script : Pango_Script) return Boolean
Determines if Script is one of the scripts used to write Language. The returned value is conservative; if nothing is known about the language tag Language, True will be returned, since, as far as Pango knows, Script might be used to write Language. 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 Pango.Language.Get_Scripts internally. Since: gtk+ 1.4
a Pango.Language.Pango_Script
True if Script is one of the scripts used to write Language or if nothing is known about Language (including the case that Language is null), False otherwise.
function Matches
(Self : Pango_Language;
Range_List : UTF8_String) return Boolean
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 '-'.
a list of language ranges, separated by ';', ':', ',', or space characters. Each element must either be '*', or a RFC 3066 language range canonicalized as by Pango.Language.From_String
True if a match was found.
Null_Pango_Language : constant Pango_Language;
type Pango_Language is new Glib.C_Boxed with null record;
type Pango_Script is (
Pango_Script_Invalid_Code,
Pango_Script_Common,
Pango_Script_Inherited,
Pango_Script_Arabic,
Pango_Script_Armenian,
Pango_Script_Bengali,
Pango_Script_Bopomofo,
Pango_Script_Cherokee,
…,
Pango_Script_Signwriting);
The Pango.Language.Pango_Script enumeration identifies different writing systems. The values correspond to the names as defined in the Unicode standard. See <ulink url="http://www.unicode.org/reports/tr24/">Unicode Standard Annex 24: Script names</ulink>.
Note that this enumeration is deprecated and will not be updated to include values in newer versions of the Unicode standard. Applications should use the GUnicodeScript enumeration instead, whose values are interchangeable with PangoScript.
type Pango_Script_Array is array (Natural range <>) of Pango_Script;
package Pango_Script_Properties is
new Generic_Internal_Discrete_Property (Pango_Script);
type Property_Pango_Script is new Pango_Script_Properties.Property;
function To_String (Self : Pango_Language) return UTF8_String
Gets the RFC-3066 format string representing the given language tag.
a string representing the language tag. This is owned by Pango and should not be freed.