summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-06-23 20:33:35 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-06-23 20:33:35 +0000
commit48eb55ba4bf53d72d8c761e1b6854d7b323405c7 (patch)
treef3c85526075039ce345d2e6024682e061fe95937 /pango
parent3aabb8d5ce0720c9a22cdcf975380d1d0213c4c8 (diff)
downloadpango-48eb55ba4bf53d72d8c761e1b6854d7b323405c7.tar.gz
#143693, Sayamindu Dasgupta
Wed Jun 23 16:13:53 2004 Owen Taylor <otaylor@redhat.com> #143693, Sayamindu Dasgupta * pango/opentype/pango-ot-buffer.c (pango_ot_buffer_set_zero_width_marks) pango/opentype/pango-ot-private.h: Allow setting for whether marks should be given zero width, defaulting to FALSE. * modules/arabic/arabic-fc.c (arabic_engine_shape): Turn on zero-width-marks setting.
Diffstat (limited to 'pango')
-rw-r--r--pango/opentype/pango-ot-buffer.c22
-rw-r--r--pango/opentype/pango-ot-private.h5
-rw-r--r--pango/pango-ot.h5
3 files changed, 27 insertions, 5 deletions
diff --git a/pango/opentype/pango-ot-buffer.c b/pango/opentype/pango-ot-buffer.c
index 35371ae8..a7b23e65 100644
--- a/pango/opentype/pango-ot-buffer.c
+++ b/pango/opentype/pango-ot-buffer.c
@@ -42,6 +42,7 @@ pango_ot_buffer_new (PangoFcFont *font)
buffer->font = g_object_ref (font);
buffer->applied_gpos = FALSE;
buffer->rtl = FALSE;
+ buffer->zero_width_marks = FALSE;
pango_fc_font_unlock_face (font);
@@ -82,6 +83,24 @@ pango_ot_buffer_set_rtl (PangoOTBuffer *buffer,
buffer->rtl = rtl;
}
+/**
+ * pango_ot_buffer_set_zero_width_marks:
+ * @buffer: a #PangoOTBuffer
+ * @zero_width_marks: %TRUE if characters with a mark class should
+ * be forced to zero width.
+ *
+ * Sets whether characters with a mark class should be forced to zero width.
+ * This setting is needed for proper positioning of Arabic accents,
+ * but will produce incorrect results with standard OpenType indic
+ * fonts.
+ **/
+void
+pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer,
+ gboolean zero_width_marks)
+{
+ buffer->zero_width_marks = zero_width_marks != FALSE;
+}
+
void
pango_ot_buffer_get_glyphs (PangoOTBuffer *buffer,
PangoOTGlyph **glyphs,
@@ -228,7 +247,8 @@ pango_ot_buffer_output (PangoOTBuffer *buffer,
FT_UShort property;
- if (gdef &&
+ if (buffer->zero_width_marks &&
+ gdef &&
TT_GDEF_Get_Glyph_Property (gdef, glyphs->glyphs[i].glyph, &property) == FT_Err_Ok &&
(property == TTO_MARK || (property & IGNORE_SPECIAL_MARKS) != 0))
{
diff --git a/pango/opentype/pango-ot-private.h b/pango/opentype/pango-ot-private.h
index 9d8f5d0e..2871cce8 100644
--- a/pango/opentype/pango-ot-private.h
+++ b/pango/opentype/pango-ot-private.h
@@ -84,8 +84,9 @@ struct _PangoOTBuffer
{
OTL_Buffer buffer;
PangoFcFont *font;
- gboolean rtl;
- gboolean applied_gpos;
+ guint rtl : 1;
+ guint zero_width_marks : 1;
+ guint applied_gpos : 1;
};
GType pango_ot_info_get_type (void);
diff --git a/pango/pango-ot.h b/pango/pango-ot.h
index 4fe693d2..47253ada 100644
--- a/pango/pango-ot.h
+++ b/pango/pango-ot.h
@@ -91,14 +91,15 @@ void pango_ot_buffer_add_glyph (PangoOTBuffer *buffer,
guint glyph_index,
guint properties,
guint cluster);
-void pango_ot_buffer_set_rtl (PangoOTBuffer *buffer,
- gboolean rtl);
void pango_ot_buffer_get_glyphs (PangoOTBuffer *buffer,
PangoOTGlyph **glyphs,
int *n_glyphs);
void pango_ot_buffer_output (PangoOTBuffer *buffer,
PangoGlyphString *glyphs);
+void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer,
+ gboolean zero_width_marks);
+
PangoOTRuleset *pango_ot_ruleset_new (PangoOTInfo *info);
void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset,