summaryrefslogtreecommitdiff
path: root/pango/pango-ot-ruleset.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-05-16 01:39:19 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-05-16 01:39:19 +0000
commit36429ada49dafad868619e3508cda83c59f3533f (patch)
tree26b5a03f9aaa27155c7c4e11ce32d522be69088e /pango/pango-ot-ruleset.c
parent18e700760e42c18aa4a2f752f184ce1454d4cd82 (diff)
downloadpango-36429ada49dafad868619e3508cda83c59f3533f.tar.gz
Add new engine API:
2007-05-15 Behdad Esfahbod <behdad@gnome.org> * pango/pango-ot.h: * pango/pango-ot-private.h: * pango/pango-ot-ruleset.c (pango_ot_ruleset_add_feature), (pango_ot_ruleset_get_feature_count): Add new engine API: pango_ot_ruleset_get_feature_count() * docs/pango-sections.txt: * docs/tmpl/opentype.sgml: * pango/pangoft2.def: Updated. svn path=/trunk/; revision=2304
Diffstat (limited to 'pango/pango-ot-ruleset.c')
-rw-r--r--pango/pango-ot-ruleset.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/pango/pango-ot-ruleset.c b/pango/pango-ot-ruleset.c
index 7296fa90..6dd60377 100644
--- a/pango/pango-ot-ruleset.c
+++ b/pango/pango-ot-ruleset.c
@@ -317,6 +317,8 @@ pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset,
tmp_rule.property_bit = property_bit;
g_array_append_val (ruleset->rules, tmp_rule);
+
+ ruleset->n_features[table_type]++;
}
/**
@@ -413,6 +415,34 @@ pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset,
}
/**
+ * pango_ot_ruleset_get_feature_count:
+ * @ruleset: a #PangoOTRuleset.
+ * @n_gsub_features: location to store number of GSUB features, or %NULL.
+ * @n_gpos_features: location to store number of GPOS features, or %NULL.
+ *
+ * Gets the number of GSUB and GPOS features in the ruleset.
+ *
+ * Return value: Total number of features in the @ruleset.
+ *
+ * Since: 1.18
+ **/
+guint
+pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset,
+ guint *n_gsub_features,
+ guint *n_gpos_features)
+{
+ g_return_val_if_fail (PANGO_IS_OT_RULESET (ruleset), 0);
+
+ if (n_gsub_features)
+ *n_gsub_features = ruleset->n_features[PANGO_OT_TABLE_GSUB];
+
+ if (n_gpos_features)
+ *n_gpos_features = ruleset->n_features[PANGO_OT_TABLE_GPOS];
+
+ return ruleset->n_features[PANGO_OT_TABLE_GSUB] + ruleset->n_features[PANGO_OT_TABLE_GPOS];
+}
+
+/**
* pango_ot_ruleset_substitute:
* @ruleset: a #PangoOTRuleset.
* @buffer: a #PangoOTBuffer.