PangoOT.Info

g GObject.Object GObject.Object PangoOT.Info PangoOT.Info GObject.Object->PangoOT.Info

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get (face)

find_feature (table_type, feature_tag, script_index, language_index)

find_language (table_type, script_index, language_tag)

find_script (table_type, script_tag)

list_features (table_type, tag, script_index, language_index)

list_languages (table_type, script_index, language_tag)

list_scripts (table_type)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class PangoOT.Info(**kwargs)
Bases:

GObject.Object

Abstract:

No

classmethod get(face)
Parameters:

face (freetype2.Face) – a FT_Face

Returns:

the PangoOTInfo for face. This object will have the same lifetime as face.

Return type:

PangoOT.Info

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 about

  • feature_tag (int) – the tag of the feature to find

  • script_index (int) – the index of the script

  • language_index (int) – the index of the language whose features are searched, or PangoOT.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:

(bool, feature_index: int)

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 about

  • script_index (int) – the index of the script whose languages are searched

  • language_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:

(bool, language_index: int, required_feature_index: int)

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 about

  • script_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:

(bool, script_index: 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, 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 about

  • tag (int) – unused parameter

  • script_index (int) – the index of the script to obtain information about

  • language_index (int) – the index of the language to list features for, or PangoOT.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:

int

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 about

  • script_index (int) – the index of the script to list languages for

  • language_tag (int) – unused parameter

Returns:

a newly-allocated zero-terminated array containing the tags of the available languages

Return type:

int

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:

int

Obtains the list of available scripts.