Info#
Superclasses: Object
- Constructors:
Info(**properties)
Methods#
- class Info
- find_feature(table_type: TableType, feature_tag: int, script_index: int, language_index: int) tuple[bool, int] #
Finds the index of a feature.
If the feature is not found, sets
feature_index
to PANGO_OT_NO_FEATURE, which is safe to pass toadd_feature
and similar functions.In the future, this may set
feature_index
to an special value that if used inadd_feature
will ask Pango to synthesize the requested feature based on Unicode properties and data. However, this function will still returnFalse
in those cases. So, users may want to ignore the return value of this function in certain cases.- Parameters:
table_type – the table type to obtain information about
feature_tag – the tag of the feature to find
script_index – the index of the script
language_index – the index of the language whose features are searched, or
DEFAULT_LANGUAGE
to use the default language of the script
- find_language(table_type: TableType, script_index: int, language_tag: int) tuple[bool, int, int] #
Finds the index of a language and its required feature index.
If the language is not found, sets
language_index
toDEFAULT_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.- Parameters:
table_type – the table type to obtain information about
script_index – the index of the script whose languages are searched
language_tag – the tag of the language to find
- find_script(table_type: TableType, script_tag: int) tuple[bool, int] #
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,NO_SCRIPT
is placed inscript_index
.All other functions taking an input script_index parameter know how to handle
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.- Parameters:
table_type – the table type to obtain information about
script_tag – the tag of the script to find
- get(face: Face) Info #
Returns the
PangoOTInfo
structure for the given FreeType font face.Added in version 1.2.
- Parameters:
face – a
FT_Face
- list_features(table_type: TableType, tag: int, script_index: int, language_index: int) int #
Obtains the list of features for the given language of the given script.
- Parameters:
table_type – the table type to obtain information about
tag – unused parameter
script_index – the index of the script to obtain information about
language_index – the index of the language to list features for, or
DEFAULT_LANGUAGE
, to list features for the default language of the script
- list_languages(table_type: TableType, script_index: int, language_tag: int) int #
Obtains the list of available languages for a given script.
- Parameters:
table_type – the table type to obtain information about
script_index – the index of the script to list languages for
language_tag – unused parameter