RulesetDescription#

Added in version 1.18.

class RulesetDescription(*args, **kwargs)#

The PangoOTRuleset structure holds all the information needed to build a complete PangoOTRuleset from an OpenType font. The main use of this struct is to act as the key for a per-font hash of rulesets. The user populates a ruleset description and gets the ruleset using get_for_description() or create a new one using new_from_description().

Methods#

class RulesetDescription
equal(desc2: RulesetDescription) bool#

Compares two ruleset descriptions for equality.

Two ruleset descriptions are considered equal if the rulesets they describe are provably identical. This means that their script, language, and all feature sets should be equal.

For static feature sets, the array addresses are compared directly, while for other features, the list of features is compared one by one.(Two ruleset descriptions may result in identical rulesets being created, but still compare False.)

Added in version 1.18.

Parameters:

desc2 – a ruleset description

free() None#

Frees a ruleset description allocated by copy().

Added in version 1.18.

hash() int#

Computes a hash of a PangoOTRulesetDescription structure suitable to be used, for example, as an argument to new().

Added in version 1.18.

Fields#

class RulesetDescription
language#

A PangoLanguage

n_other_features#

Length of other_features, or 0.

n_static_gpos_features#

Length of static_gpos_features, or 0.

n_static_gsub_features#

Length of static_gsub_features, or 0.

other_features#

Map of extra features to add to both GSUB and GPOS. Unlike the static maps, this pointer need not live beyond the life of function calls taking this struct.

script#

A PangoScript

static_gpos_features#

Static map of GPOS features

static_gsub_features#

Static map of GSUB features