summaryrefslogtreecommitdiff
path: root/pango/pango-ot.h
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-05-14 04:02:58 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-05-14 04:02:58 +0000
commit5268099b137dee60aacc04cbeb5051242c35b256 (patch)
treec974955ad45cabb06fd7166f7507c1ba8541e547 /pango/pango-ot.h
parent9f09571a932149e77ceeb7ccec8bd7bdea6aac4a (diff)
downloadpango-5268099b137dee60aacc04cbeb5051242c35b256.tar.gz
Part of Bug 325714 – Pango should respect $LANGUAGE
2007-05-13 Behdad Esfahbod <behdad@gnome.org> Part of Bug 325714 – Pango should respect $LANGUAGE * pango/pango-ot.h: * pango/pango-ot-private.h: * pango/pango-ot-tag.c (pango_ot_tag_from_script), (pango_ot_tag_from_language): * pango/pango-ot-info.c (pango_ot_info_find_script), (pango_ot_info_find_language), (pango_ot_info_find_feature), (pango_ot_info_list_languages), (pango_ot_info_list_features): * pango/pango-ot-ruleset.c (pango_ot_ruleset_new), (pango_ot_ruleset_new_for), (pango_ot_ruleset_add_feature), (pango_ot_ruleset_maybe_add_feature), (pango_ot_ruleset_maybe_add_features): Add new engine API: PANGO_OT_NO_FEATURE PANGO_OT_NO_SCRIPT PANGO_OT_TAG_DEFAULT_SCRIPT PANGO_OT_TAG_DEFAULT_LANGUAGE pango_ot_ruleset_new_for() pango_ot_ruleset_maybe_add_feature() pango_ot_ruleset_maybe_add_features() Using pango_ot_ruleset_new_for() and pango_ot_ruleset_maybe_add_features() drastically simplifies ruleset building in modules, and does correct script and language selection too. Modules need to be updated to use it though. * docs/pango-docs.sgml: * docs/pango-sections.txt: * docs/tmpl/opentype.sgml: Update. svn path=/trunk/; revision=2284
Diffstat (limited to 'pango/pango-ot.h')
-rw-r--r--pango/pango-ot.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/pango/pango-ot.h b/pango/pango-ot.h
index ce8778f3..df049378 100644
--- a/pango/pango-ot.h
+++ b/pango/pango-ot.h
@@ -34,10 +34,11 @@ G_BEGIN_DECLS
typedef guint32 PangoOTTag;
-typedef struct _PangoOTInfo PangoOTInfo;
-typedef struct _PangoOTBuffer PangoOTBuffer;
-typedef struct _PangoOTGlyph PangoOTGlyph;
-typedef struct _PangoOTRuleset PangoOTRuleset;
+typedef struct _PangoOTInfo PangoOTInfo;
+typedef struct _PangoOTBuffer PangoOTBuffer;
+typedef struct _PangoOTGlyph PangoOTGlyph;
+typedef struct _PangoOTRuleset PangoOTRuleset;
+typedef struct _PangoOTFeatureMap PangoOTFeatureMap;
typedef enum
{
@@ -47,8 +48,12 @@ typedef enum
#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)
-#define PANGO_OT_DEFAULT_LANGUAGE ((PangoOTTag) 0xFFFF)
-#define PANGO_OT_DEFAULT_SCRIPT ((PangoOTTag) FT_MAKE_TAG ('D', 'F', 'L', 'T'))
+#define PANGO_OT_NO_FEATURE ((guint) 0xFFFF)
+#define PANGO_OT_NO_SCRIPT ((guint) 0xFFFF)
+#define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF)
+
+#define PANGO_OT_TAG_DEFAULT_SCRIPT ((PangoOTTag) (FT_MAKE_TAG ('D', 'F', 'L', 'T')))
+#define PANGO_OT_TAG_DEFAULT_LANGUAGE ((PangoOTTag) (FT_MAKE_TAG ('d', 'f', 'l', 't')))
/* Note that this must match HB_GlyphItem */
struct _PangoOTGlyph
@@ -61,6 +66,12 @@ struct _PangoOTGlyph
gushort property_cache; /* Internal */
};
+struct _PangoOTFeatureMap
+{
+ char feature_name[5];
+ gulong property_bit;
+};
+
PangoOTInfo *pango_ot_info_get (FT_Face face);
gboolean pango_ot_info_find_script (PangoOTInfo *info,
@@ -111,16 +122,25 @@ void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer,
gboolean zero_width_marks);
PangoOTRuleset *pango_ot_ruleset_new (PangoOTInfo *info);
-
+PangoOTRuleset *pango_ot_ruleset_new_for (PangoOTInfo *info,
+ PangoScript script,
+ PangoLanguage *language);
void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset,
PangoOTTableType table_type,
guint feature_index,
gulong property_bit);
+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,
+ PangoOTTableType table_type,
+ const PangoOTFeatureMap *features,
+ int n_features);
void pango_ot_ruleset_substitute (PangoOTRuleset *ruleset,
PangoOTBuffer *buffer);
void pango_ot_ruleset_position (PangoOTRuleset *ruleset,
PangoOTBuffer *buffer);
-
PangoScript pango_ot_tag_to_script (PangoOTTag script_tag);
PangoOTTag pango_ot_tag_from_script (PangoScript script);
PangoLanguage* pango_ot_tag_to_language (PangoOTTag language_tag);