Constructor
PangoOTRulesetnew_for
since: 1.18
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 addition to what pango_ot_ruleset_new()
does, this function will:
-
Find the
PangoOTTag
script and language tags associated withscript
andlanguage
usingpango_ot_tag_from_script()
andpango_ot_tag_from_language()
, -
For each of table types
PANGO_OT_TABLE_GSUB
andPANGO_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, usingpango_ot_info_find_script()
andpango_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()
andpango_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.
Available since: 1.18
Parameters
info
-
Type:
PangoOTInfo
A
PangoOTInfo
The data is owned by the caller of the function. script
-
Type:
PangoScript
A
PangoScript
language
-
Type:
PangoLanguage
A
PangoLanguage
The data is owned by the caller of the function.
Return value
Type: PangoOTRuleset
The newly allocated PangoOTRuleset
The caller of the function takes ownership of the data, and is responsible for freeing it. |