:right-sidebar: True
Script
===================================================================
.. currentmodule:: gi.repository.Pango
.. class:: Script
:no-contents-entry:
The ``PangoScript`` enumeration identifies different writing
systems.
The values correspond to the names as defined in the Unicode standard. See
`Unicode Standard Annex 24: Script names `__
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
:obj:`~gi.repository.GLib.UnicodeScript` enumeration instead,
whose values are interchangeable with ``PangoScript``\.
Methods
-------
.. rst-class:: interim-class
.. class:: Script
:no-index:
.. method:: for_unichar() -> ~gi.repository.Pango.Script
Looks up the script for a particular character.
The script of a character is defined by
`Unicode Standard Annex 24: Script names `__\.
No check is made for ``ch`` being a valid Unicode character; if you pass
in invalid character, the result is undefined.
Note that while the return type of this function is declared
as ``PangoScript``\, as of Pango 1.18, this function simply returns
the return value of :obj:`~gi.repository.GLib.unichar_get_script`\. Callers must be
prepared to handle unknown values.
.. versionadded:: 1.4
.. deprecated:: 1.44.
Use :func:`~gi.repository.GLib.unichar_get_script`
.. method:: get_sample_language() -> ~gi.repository.Pango.Language | None
Finds a language tag that is reasonably representative of ``script``\.
The language will usually be the most widely spoken or used language
written in that script: for instance, the sample language for
:const:`~gi.repository.Pango.Script.CYRILLIC` is ru (Russian), the sample language for
:const:`~gi.repository.Pango.Script.ARABIC` is ar.
For some scripts, no sample language will be returned because
there is no language that is sufficiently representative. The
best example of this is :const:`~gi.repository.Pango.Script.HAN`, where various different
variants of written Chinese, Japanese, and Korean all use
significantly different sets of Han characters and forms
of shared characters. No sample language can be provided
for many historical scripts as well.
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 ``script`` for writing. This last predicate
is tested using :obj:`~gi.repository.Pango.Language.includes_script`\. This can
be used to control Pango's font selection for non-primary
languages. For example, a ``PANGO_LANGUAGE`` enviroment variable
set to "en:fa" makes Pango choose fonts suitable for Persian (fa)
instead of Arabic (ar) when a segment of Arabic text is found
in an otherwise non-Arabic text. The same trick can be used to
choose a default language for :const:`~gi.repository.Pango.Script.HAN` when setting
context language is not feasible.
.. versionadded:: 1.4
Fields
------
.. rst-class:: interim-class
.. class:: Script
:no-index:
.. attribute:: AHOM
The type of the None singleton.
.. attribute:: ANATOLIAN_HIEROGLYPHS
The type of the None singleton.
.. attribute:: ARABIC
The type of the None singleton.
.. attribute:: ARMENIAN
The type of the None singleton.
.. attribute:: BALINESE
The type of the None singleton.
.. attribute:: BASSA_VAH
The type of the None singleton.
.. attribute:: BATAK
The type of the None singleton.
.. attribute:: BENGALI
The type of the None singleton.
.. attribute:: BOPOMOFO
The type of the None singleton.
.. attribute:: BRAHMI
The type of the None singleton.
.. attribute:: BRAILLE
The type of the None singleton.
.. attribute:: BUGINESE
The type of the None singleton.
.. attribute:: BUHID
The type of the None singleton.
.. attribute:: CANADIAN_ABORIGINAL
The type of the None singleton.
.. attribute:: CARIAN
The type of the None singleton.
.. attribute:: CAUCASIAN_ALBANIAN
The type of the None singleton.
.. attribute:: CHAKMA
The type of the None singleton.
.. attribute:: CHAM
The type of the None singleton.
.. attribute:: CHEROKEE
The type of the None singleton.
.. attribute:: COMMON
The type of the None singleton.
.. attribute:: COPTIC
The type of the None singleton.
.. attribute:: CUNEIFORM
The type of the None singleton.
.. attribute:: CYPRIOT
The type of the None singleton.
.. attribute:: CYRILLIC
The type of the None singleton.
.. attribute:: DESERET
The type of the None singleton.
.. attribute:: DEVANAGARI
The type of the None singleton.
.. attribute:: DUPLOYAN
The type of the None singleton.
.. attribute:: ELBASAN
The type of the None singleton.
.. attribute:: ETHIOPIC
The type of the None singleton.
.. attribute:: GEORGIAN
The type of the None singleton.
.. attribute:: GLAGOLITIC
The type of the None singleton.
.. attribute:: GOTHIC
The type of the None singleton.
.. attribute:: GRANTHA
The type of the None singleton.
.. attribute:: GREEK
The type of the None singleton.
.. attribute:: GUJARATI
The type of the None singleton.
.. attribute:: GURMUKHI
The type of the None singleton.
.. attribute:: HAN
The type of the None singleton.
.. attribute:: HANGUL
The type of the None singleton.
.. attribute:: HANUNOO
The type of the None singleton.
.. attribute:: HATRAN
The type of the None singleton.
.. attribute:: HEBREW
The type of the None singleton.
.. attribute:: HIRAGANA
The type of the None singleton.
.. attribute:: INHERITED
The type of the None singleton.
.. attribute:: INVALID_CODE
The type of the None singleton.
.. attribute:: KANNADA
The type of the None singleton.
.. attribute:: KATAKANA
The type of the None singleton.
.. attribute:: KAYAH_LI
The type of the None singleton.
.. attribute:: KHAROSHTHI
The type of the None singleton.
.. attribute:: KHMER
The type of the None singleton.
.. attribute:: KHOJKI
The type of the None singleton.
.. attribute:: KHUDAWADI
The type of the None singleton.
.. attribute:: LAO
The type of the None singleton.
.. attribute:: LATIN
The type of the None singleton.
.. attribute:: LEPCHA
The type of the None singleton.
.. attribute:: LIMBU
The type of the None singleton.
.. attribute:: LINEAR_A
The type of the None singleton.
.. attribute:: LINEAR_B
The type of the None singleton.
.. attribute:: LYCIAN
The type of the None singleton.
.. attribute:: LYDIAN
The type of the None singleton.
.. attribute:: MAHAJANI
The type of the None singleton.
.. attribute:: MALAYALAM
The type of the None singleton.
.. attribute:: MANDAIC
The type of the None singleton.
.. attribute:: MANICHAEAN
The type of the None singleton.
.. attribute:: MENDE_KIKAKUI
The type of the None singleton.
.. attribute:: MEROITIC_CURSIVE
The type of the None singleton.
.. attribute:: MEROITIC_HIEROGLYPHS
The type of the None singleton.
.. attribute:: MIAO
The type of the None singleton.
.. attribute:: MODI
The type of the None singleton.
.. attribute:: MONGOLIAN
The type of the None singleton.
.. attribute:: MRO
Return a type's method resolution order.
.. attribute:: MULTANI
The type of the None singleton.
.. attribute:: MYANMAR
The type of the None singleton.
.. attribute:: NABATAEAN
The type of the None singleton.
.. attribute:: NEW_TAI_LUE
The type of the None singleton.
.. attribute:: NKO
The type of the None singleton.
.. attribute:: OGHAM
The type of the None singleton.
.. attribute:: OLD_HUNGARIAN
The type of the None singleton.
.. attribute:: OLD_ITALIC
The type of the None singleton.
.. attribute:: OLD_NORTH_ARABIAN
The type of the None singleton.
.. attribute:: OLD_PERMIC
The type of the None singleton.
.. attribute:: OLD_PERSIAN
The type of the None singleton.
.. attribute:: OL_CHIKI
The type of the None singleton.
.. attribute:: ORIYA
The type of the None singleton.
.. attribute:: OSMANYA
The type of the None singleton.
.. attribute:: PAHAWH_HMONG
The type of the None singleton.
.. attribute:: PALMYRENE
The type of the None singleton.
.. attribute:: PAU_CIN_HAU
The type of the None singleton.
.. attribute:: PHAGS_PA
The type of the None singleton.
.. attribute:: PHOENICIAN
The type of the None singleton.
.. attribute:: PSALTER_PAHLAVI
The type of the None singleton.
.. attribute:: REJANG
The type of the None singleton.
.. attribute:: RUNIC
The type of the None singleton.
.. attribute:: SAURASHTRA
The type of the None singleton.
.. attribute:: SHARADA
The type of the None singleton.
.. attribute:: SHAVIAN
The type of the None singleton.
.. attribute:: SIDDHAM
The type of the None singleton.
.. attribute:: SIGNWRITING
The type of the None singleton.
.. attribute:: SINHALA
The type of the None singleton.
.. attribute:: SORA_SOMPENG
The type of the None singleton.
.. attribute:: SUNDANESE
The type of the None singleton.
.. attribute:: SYLOTI_NAGRI
The type of the None singleton.
.. attribute:: SYRIAC
The type of the None singleton.
.. attribute:: TAGALOG
The type of the None singleton.
.. attribute:: TAGBANWA
The type of the None singleton.
.. attribute:: TAI_LE
The type of the None singleton.
.. attribute:: TAKRI
The type of the None singleton.
.. attribute:: TAMIL
The type of the None singleton.
.. attribute:: TELUGU
The type of the None singleton.
.. attribute:: THAANA
The type of the None singleton.
.. attribute:: THAI
The type of the None singleton.
.. attribute:: TIBETAN
The type of the None singleton.
.. attribute:: TIFINAGH
The type of the None singleton.
.. attribute:: TIRHUTA
The type of the None singleton.
.. attribute:: UGARITIC
The type of the None singleton.
.. attribute:: UNKNOWN
The type of the None singleton.
.. attribute:: VAI
The type of the None singleton.
.. attribute:: WARANG_CITI
The type of the None singleton.
.. attribute:: YI
The type of the None singleton.