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
Pango.Script.CYRILLIC is ru (Russian), the sample language for
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 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 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 Pango.Script.HAN when setting
context language is not feasible.
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 Pango.Script.CYRILLIC is ru (Russian), the sample language for 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 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_LANGUAGEandLANGUAGE(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 usescriptfor writing. This last predicate is tested using Pango.Language.includes_script. This can be used to control Pango's font selection for non-primary languages. For example, aPANGO_LANGUAGEenviroment 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 Pango.Script.HAN when setting context language is not feasible.