Constructor

PangoOT.Ruleset.new_for

Declaration [src]

PangoOTRuleset*
pango_ot_ruleset_new_for (
  PangoOTInfo* info,
  PangoScript script,
  PangoLanguage* language
)

Description [src]

Creates a new PangoOTRuleset for the given OpenType info, script, and language.

This function is part of a convenience scheme that highly simplifies using a PangoOTRuleset to represent features for a specific pair of script and language. So one can use this function passing in the script and language of interest, and later try to add features to the ruleset by just specifying the feature name or tag, without having to deal with finding script, language, or feature indices manually.

In excess to what pango_ot_ruleset_new() does, this function will:

  • Find the PangoOTTag script and language tags associated with script and language using pango_ot_tag_from_script() and pango_ot_tag_from_language(),

  • For each of table types PANGO_OT_TABLE_GSUB and PANGO_OT_TABLE_GPOS, find the script index of the script tag found and the language system index of the language tag found in that script system, using pango_ot_info_find_script() and pango_ot_info_find_language(),

  • For found language-systems, if they have required feature index, add that feature to the ruleset using pango_ot_ruleset_add_feature(),

  • Remember found script and language indices for both table types, and use them in future pango_ot_ruleset_maybe_add_feature() and pango_ot_ruleset_maybe_add_features().

Because of the way return values of pango_ot_info_find_script() and pango_ot_info_find_language() are ignored, this function automatically finds and uses the ‘DFLT’ script and the default language-system.

Parameters

info PangoOTInfo
 

a PangoOTInfo.

 Ownership is not transferred to the callee
script PangoScript
 

a PangoScript.

language PangoLanguage*
 

a PangoLanguage.

 Ownership is not transferred to the callee

Return value

Returns: PangoOTRuleset

the newly allocated PangoOTRuleset, which should be freed with g_object_unref().

Ownership of the data is transferred to the caller