Functions

tag_from_language (language)

tag_from_script (script)

tag_to_language (language_tag)

tag_to_script (script_tag)

Details

PangoOT.tag_from_language(language)
Parameters:

language (Pango.Language or None) – A PangoLanguage

Returns:

PangoOTTag best matching language or %PANGO_OT_TAG_DEFAULT_LANGUAGE if none found or if language is None.

Return type:

int

Finds the OpenType language-system tag best describing language.

New in version 1.18.

PangoOT.tag_from_script(script)
Parameters:

script (Pango.Script) – A PangoScript

Returns:

PangoOTTag corresponding to script or %PANGO_OT_TAG_DEFAULT_SCRIPT if none found.

Return type:

int

Finds the OpenType script tag corresponding to script.

The Pango.Script.COMMON, Pango.Script.INHERITED, and Pango.Script.UNKNOWN scripts are mapped to the OpenType ‘DFLT’ script tag that is also defined as %PANGO_OT_TAG_DEFAULT_SCRIPT.

Note that multiple PangoScript values may map to the same OpenType script tag. In particular, Pango.Script.HIRAGANA and Pango.Script.KATAKANA both map to the OT tag ‘kana’.

New in version 1.18.

PangoOT.tag_to_language(language_tag)
Parameters:

language_tag (int) – A PangoOTTag OpenType language-system tag

Returns:

PangoLanguage best matching language_tag or PangoLanguage corresponding to the string “xx” if none found.

Return type:

Pango.Language

Finds a PangoLanguage corresponding to language_tag.

New in version 1.18.

PangoOT.tag_to_script(script_tag)
Parameters:

script_tag (int) – A PangoOTTag OpenType script tag

Returns:

PangoScript corresponding to script_tag or Pango.Script.UNKNOWN if none found.

Return type:

Pango.Script

Finds the PangoScript corresponding to script_tag.

The ‘DFLT’ script tag is mapped to Pango.Script.COMMON.

Note that an OpenType script tag may correspond to multiple PangoScript values. In such cases, the PangoScript value with the smallest value is returned. In particular, Pango.Script.HIRAGANA and Pango.Script.KATAKANA both map to the OT tag ‘kana’. This function will return Pango.Script.HIRAGANA for ‘kana’.

New in version 1.18.