Class: PangoOT::Ruleset
- Inherits:
-
Object
- Object
- PangoOT::Ruleset
- Defined in:
- (unknown)
Overview
The PangoOTRuleset structure holds a set of features selected
from the tables in an OpenType font.
A feature is an operation such as adjusting glyph positioning that should be applied to a text feature such as a certain type of accent.
A PangoOTRuleset is created with [ctorPangoOT.Ruleset.new],
features are added to it with [methodPangoOT.Ruleset.add_feature],
then it is applied to a PangoGlyphString with
[methodPangoOT.Ruleset.position].
Class Method Summary collapse
-
.get_for_description(info, desc) ⇒ PangoOT::Ruleset
Returns a ruleset for the given OpenType info and ruleset description.
Instance Method Summary collapse
-
#add_feature(table_type, feature_index, property_bit) ⇒ nil
Adds a feature to the ruleset.
-
#get_feature_count(n_gsub_features, n_gpos_features) ⇒ Integer
Gets the number of GSUB and GPOS features in the ruleset.
-
#initialize(info, desc) ⇒ PangoOT::Ruleset
constructor
Creates a new
PangoOTRulesetfor the given OpenType info and matching the given ruleset description. -
#maybe_add_feature(table_type, feature_tag, property_bit) ⇒ Boolean
This is a convenience function that first tries to find the feature using [methodPangoOT.Info.find_feature] and the ruleset script and language passed to [ctorPangoOT.Ruleset.new_for] and if the feature is found, adds it to the ruleset.
-
#maybe_add_features(table_type, features, n_features) ⇒ Integer
This is a convenience function that for each feature in the feature map array features converts the feature name to a
PangoOTTagfeature tag using PANGO_OT_TAG_MAKE() and calls [methodPangoOT.Ruleset.maybe_add_feature] on it. -
#position(buffer) ⇒ nil
Performs the OpenType GPOS positioning on buffer using the features in ruleset.
-
#substitute(buffer) ⇒ nil
Performs the OpenType GSUB substitution on buffer using the features in ruleset.
Constructor Details
#initialize(info, desc) ⇒ PangoOT::Ruleset
Creates a new PangoOTRuleset for the given OpenType info and
matching the given ruleset description.
This is a convenience function that calls [ctorPangoOT.Ruleset.new_for] and adds the static GSUB/GPOS features to the resulting ruleset, followed by adding other features to both GSUB and GPOS.
The static feature map members of desc should be alive as long as info is.
Class Method Details
.get_for_description(info, desc) ⇒ PangoOT::Ruleset
Returns a ruleset for the given OpenType info and ruleset description.
Rulesets are created on demand using [ctorPangoOT.Ruleset.new_from_description]. The returned ruleset should not be modified or destroyed.
The static feature map members of desc should be alive as long as info is.
Instance Method Details
#add_feature(table_type, feature_index, property_bit) ⇒ nil
Adds a feature to the ruleset.
#get_feature_count(n_gsub_features, n_gpos_features) ⇒ Integer
Gets the number of GSUB and GPOS features in the ruleset.
#maybe_add_feature(table_type, feature_tag, property_bit) ⇒ Boolean
This is a convenience function that first tries to find the feature using [methodPangoOT.Info.find_feature] and the ruleset script and language passed to [ctorPangoOT.Ruleset.new_for] and if the feature is found, adds it to the ruleset.
If ruleset was not created using [ctorPangoOT.Ruleset.new_for], this function does nothing.
#maybe_add_features(table_type, features, n_features) ⇒ Integer
This is a convenience function that for each feature in the feature map
array features converts the feature name to a PangoOTTag feature tag
using PANGO_OT_TAG_MAKE() and calls [methodPangoOT.Ruleset.maybe_add_feature]
on it.
#position(buffer) ⇒ nil
Performs the OpenType GPOS positioning on buffer using the features in ruleset.
#substitute(buffer) ⇒ nil
Performs the OpenType GSUB substitution on buffer using the features in ruleset.