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 Pango.Language, or None
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 Pango.Script
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 Pango.Script 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:Pango.Language best matching language_tag or Pango.Language corresponding to the string “xx” if none found.
Return type:Pango.Language

Finds a Pango.Language 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:Pango.Script corresponding to script_tag or Pango.Script.UNKNOWN if none found.
Return type:Pango.Script

Finds the Pango.Script corresponding to script_tag.

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

Note that an OpenType script tag may correspond to multiple Pango.Script values. In such cases, the Pango.Script 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.