PangoOT.Info¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class PangoOT.Info(**kwargs)¶
- Bases:
- Abstract:
No
- classmethod get(face)¶
- Parameters:
face (
freetype2.Face
) – aFT_Face
- Returns:
the
PangoOTInfo
for face. This object will have the same lifetime as face.- Return type:
Returns the
PangoOTInfo
structure for the given FreeType font face.New in version 1.2.
- find_feature(table_type, feature_tag, script_index, language_index)¶
- Parameters:
table_type (
PangoOT.TableType
) – the table type to obtain information aboutfeature_tag (
int
) – the tag of the feature to findscript_index (
int
) – the index of the scriptlanguage_index (
int
) – the index of the language whose features are searched, orPangoOT.DEFAULT_LANGUAGE
to use the default language of the script
- Returns:
True
if the feature was found- feature_index:
location to store the index of the feature
- Return type:
Finds the index of a feature.
If the feature is not found, sets feature_index to
PangoOT.NO_FEATURE
, which is safe to pass to [method`PangoOT`.Ruleset.add_feature] and similar functions.In the future, this may set feature_index to an special value that if used in [method`PangoOT`.Ruleset.add_feature] will ask Pango to synthesize the requested feature based on Unicode properties and data. However, this function will still return
False
in those cases. So, users may want to ignore the return value of this function in certain cases.
- find_language(table_type, script_index, language_tag)¶
- Parameters:
table_type (
PangoOT.TableType
) – the table type to obtain information aboutscript_index (
int
) – the index of the script whose languages are searchedlanguage_tag (
int
) – the tag of the language to find
- Returns:
True
if the language was found- language_index:
location to store the index of the language
- required_feature_index:
location to store the required feature index of the language
- Return type:
Finds the index of a language and its required feature index.
If the language is not found, sets language_index to
PangoOT.DEFAULT_LANGUAGE
and the required feature of the default language system is returned in required_feature_index. For best compatibility with some fonts, also searches the language system tag ‘dflt’ before falling back to the default language system, but that is transparent to the user. The user can simply ignore the return value of this function to automatically fall back to the default language system.
- find_script(table_type, script_tag)¶
- Parameters:
table_type (
PangoOT.TableType
) – the table type to obtain information aboutscript_tag (
int
) – the tag of the script to find
- Returns:
True
if the script was found- script_index:
location to store the index of the script
- Return type:
Finds the index of a script.
If not found, tries to find the ‘DFLT’ and then ‘dflt’ scripts and return the index of that in script_index. If none of those is found either,
PangoOT.NO_SCRIPT
is placed in script_index.All other functions taking an input script_index parameter know how to handle
PangoOT.NO_SCRIPT
, so one can ignore the return value of this function completely and proceed, to enjoy the automatic fallback to the ‘DFLT’/’dflt’ script.
- list_features(table_type, tag, script_index, language_index)¶
- Parameters:
table_type (
PangoOT.TableType
) – the table type to obtain information abouttag (
int
) – unused parameterscript_index (
int
) – the index of the script to obtain information aboutlanguage_index (
int
) – the index of the language to list features for, orPangoOT.DEFAULT_LANGUAGE
, to list features for the default language of the script
- Returns:
a newly-allocated zero-terminated array containing the tags of the available features
- Return type:
Obtains the list of features for the given language of the given script.
- list_languages(table_type, script_index, language_tag)¶
- Parameters:
table_type (
PangoOT.TableType
) – the table type to obtain information aboutscript_index (
int
) – the index of the script to list languages forlanguage_tag (
int
) – unused parameter
- Returns:
a newly-allocated zero-terminated array containing the tags of the available languages
- Return type:
Obtains the list of available languages for a given script.
- list_scripts(table_type)¶
- Parameters:
table_type (
PangoOT.TableType
) – the table type to obtain information about- Returns:
a newly-allocated zero-terminated array containing the tags of the available scripts
- Return type:
Obtains the list of available scripts.