summaryrefslogtreecommitdiff
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
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
-rw-r--r--docs/pango-sections.txt1
-rw-r--r--docs/tmpl/opentype.sgml11
-rw-r--r--pango/pango-ot-private.h2
-rw-r--r--pango/pango-ot-ruleset.c30
-rw-r--r--pango/pango-ot.h3
-rw-r--r--pango/pangoft2.def1
6 files changed, 48 insertions, 0 deletions
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index 75906ed3..fa57140a 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -970,6 +970,7 @@ pango_ot_ruleset_new_for
pango_ot_ruleset_add_feature
pango_ot_ruleset_maybe_add_feature
pango_ot_ruleset_maybe_add_features
+pango_ot_ruleset_get_feature_count
pango_ot_ruleset_substitute
pango_ot_ruleset_position
pango_ot_ruleset_description_copy
diff --git a/docs/tmpl/opentype.sgml b/docs/tmpl/opentype.sgml
index f5a61930..3b6aa4df 100644
--- a/docs/tmpl/opentype.sgml
+++ b/docs/tmpl/opentype.sgml
@@ -413,6 +413,17 @@ is not found.
@Returns:
+<!-- ##### FUNCTION pango_ot_ruleset_get_feature_count ##### -->
+<para>
+
+</para>
+
+@ruleset:
+@n_gsub_features:
+@n_gpos_features:
+@Returns:
+
+
<!-- ##### FUNCTION pango_ot_ruleset_substitute ##### -->
<para>
diff --git a/pango/pango-ot-private.h b/pango/pango-ot-private.h
index 089c57c9..3705ae8e 100644
--- a/pango/pango-ot-private.h
+++ b/pango/pango-ot-private.h
@@ -72,6 +72,8 @@ struct _PangoOTRuleset
GArray *rules;
PangoOTInfo *info;
+ /* the index into these arrays is a PangoOTTableType */
+ guint n_features[2];
guint script_index[2];
guint language_index[2];
};
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.
diff --git a/pango/pango-ot.h b/pango/pango-ot.h
index 1be9d2c3..e1ea45e1 100644
--- a/pango/pango-ot.h
+++ b/pango/pango-ot.h
@@ -152,6 +152,9 @@ guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ru
PangoOTTableType table_type,
const PangoOTFeatureMap *features,
guint n_features);
+guint pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset,
+ guint *n_gsub_features,
+ guint *n_gpos_features);
void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset,
PangoOTBuffer *buffer);
void pango_ot_ruleset_position (const PangoOTRuleset *ruleset,
diff --git a/pango/pangoft2.def b/pango/pangoft2.def
index 23aeb1ed..50e625d8 100644
--- a/pango/pangoft2.def
+++ b/pango/pangoft2.def
@@ -62,6 +62,7 @@ EXPORTS
pango_ot_ruleset_description_equal
pango_ot_ruleset_description_free
pango_ot_ruleset_description_hash
+ pango_ot_ruleset_get_feature_count
pango_ot_ruleset_get_for
pango_ot_ruleset_get_type
pango_ot_ruleset_maybe_add_feature