Functions
- tag_from_language(language: Language | None = None) int
Finds the OpenType language-system tag best describing
language
.Added in version 1.18.
- Parameters:
language – A
PangoLanguage
- Returns:
PangoOTTag
best matchinglanguage
or%PANGO_OT_TAG_DEFAULT_LANGUAGE
if none found or iflanguage
isNone
.
- tag_from_script(script: Script) 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’.Added in version 1.18.
- Parameters:
script – A
PangoScript
- Returns:
PangoOTTag
corresponding toscript
or%PANGO_OT_TAG_DEFAULT_SCRIPT
if none found.
- tag_to_language(language_tag: int) Language
Finds a
PangoLanguage
corresponding tolanguage_tag
.Added in version 1.18.
- Parameters:
language_tag – A
PangoOTTag
OpenType language-system tag- Returns:
PangoLanguage
best matchinglanguage_tag
orPangoLanguage
corresponding to the string “xx” if none found.
- tag_to_script(script_tag: int) Script
Finds the
PangoScript
corresponding toscript_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, thePangoScript
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’.Added in version 1.18.
- Parameters:
script_tag – A
PangoOTTag
OpenType script tag- Returns:
PangoScript
corresponding toscript_tag
or%PANGO_SCRIPT_UNKNOWN
if none found.