diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-05-14 07:09:45 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-05-14 07:09:45 +0000 |
commit | a1133c77d1e299609f1a0d1bd040a6818ea9edfd (patch) | |
tree | 20ce17182c4383db9d5c3acdad4b0d43a6644e2c /pango/pango-ot.h | |
parent | ece3741c8051acffafd5250189730389f70474e9 (diff) | |
download | pango-a1133c77d1e299609f1a0d1bd040a6818ea9edfd.tar.gz |
Part of Bug 325714 – Pango should respect $LANGUAGE
2007-05-14 Behdad Esfahbod <behdad@gnome.org>
Part of Bug 325714 – Pango should respect $LANGUAGE
* pango/pango-ot.h:
* pango/pango-ot-ruleset.c (pango_ot_ruleset_get_for),
(pango_ot_ruleset_description_hash),
(pango_ot_ruleset_description_equal),
(pango_ot_ruleset_description_copy),
(pango_ot_ruleset_description_free):
Add new engine API:
PangoOTRulesetDescription
pango_ot_ruleset_get_for()
pango_ot_ruleset_description_hash()
pango_ot_ruleset_description_equal()
pango_ot_ruleset_description_copy()
pango_ot_ruleset_description_free()
The main addition is pango_ot_ruleset_get_for() that
takes a ruleset description, ie. script/language and list
of GSUB/GPOS features to apply, and returns a ruleset.
It manages all the work to cache rulesets, so modules
don't have to do that anymore. Given that modules do not
deal with just one ruleset anymore (because we want to
respect language, and allow user-selected features), this
makes their life way easier.
* docs/pango-sections.txt:
* docs/tmpl/opentype.sgml:
Update.
svn path=/trunk/; revision=2290
Diffstat (limited to 'pango/pango-ot.h')
-rw-r--r-- | pango/pango-ot.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/pango/pango-ot.h b/pango/pango-ot.h index 7959c6d6..1be9d2c3 100644 --- a/pango/pango-ot.h +++ b/pango/pango-ot.h @@ -39,6 +39,7 @@ typedef struct _PangoOTBuffer PangoOTBuffer; typedef struct _PangoOTGlyph PangoOTGlyph; typedef struct _PangoOTRuleset PangoOTRuleset; typedef struct _PangoOTFeatureMap PangoOTFeatureMap; +typedef struct _PangoOTRulesetDescription PangoOTRulesetDescription; typedef enum { @@ -72,6 +73,18 @@ struct _PangoOTFeatureMap gulong property_bit; }; +struct _PangoOTRulesetDescription { + PangoScript script; + PangoLanguage *language; + const PangoOTFeatureMap *static_gsub_features; + guint n_static_gsub_features; + const PangoOTFeatureMap *static_gpos_features; + guint n_static_gpos_features; + const PangoOTFeatureMap *other_features; + guint n_other_features; +}; + + PangoOTInfo *pango_ot_info_get (FT_Face face); gboolean pango_ot_info_find_script (PangoOTInfo *info, @@ -121,6 +134,8 @@ void pango_ot_buffer_output (const PangoOTBuffer *buffer, void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer, gboolean zero_width_marks); +const PangoOTRuleset *pango_ot_ruleset_get_for (PangoOTInfo *info, + const PangoOTRulesetDescription *desc); PangoOTRuleset *pango_ot_ruleset_new (PangoOTInfo *info); PangoOTRuleset *pango_ot_ruleset_new_for (PangoOTInfo *info, PangoScript script, @@ -133,10 +148,10 @@ gboolean pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, PangoOTTag feature_tag, gulong property_bit); -int pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, +guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, PangoOTTableType table_type, const PangoOTFeatureMap *features, - int n_features); + guint n_features); void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer); void pango_ot_ruleset_position (const PangoOTRuleset *ruleset, @@ -146,6 +161,13 @@ PangoOTTag pango_ot_tag_from_script (PangoScript script); PangoLanguage* pango_ot_tag_to_language (PangoOTTag language_tag); PangoOTTag pango_ot_tag_from_language (PangoLanguage *language); +guint pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc); +gboolean pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1, + const PangoOTRulesetDescription *desc2); +PangoOTRulesetDescription *pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc); +void pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc); + + #endif /* PANGO_ENABLE_ENGINE */ G_END_DECLS |