diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 11 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 11 | ||||
-rw-r--r-- | docs/pango-sections.txt | 1 | ||||
-rw-r--r-- | docs/tmpl/opentype.sgml | 4 | ||||
-rw-r--r-- | modules/arabic/arabic-fc.c | 1 | ||||
-rw-r--r-- | pango/opentype/pango-ot-buffer.c | 22 | ||||
-rw-r--r-- | pango/opentype/pango-ot-private.h | 5 | ||||
-rw-r--r-- | pango/pango-ot.h | 5 |
10 files changed, 75 insertions, 7 deletions
@@ -1,3 +1,14 @@ +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. + Tue Jun 22 14:10:41 2004 Owen Taylor <otaylor@redhat.com> * pango/break.c: Handle new Unicode-4.0 WORD_JOINER diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 7d0e7d97..0e021cc6 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,14 @@ +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. + Tue Jun 22 14:10:41 2004 Owen Taylor <otaylor@redhat.com> * pango/break.c: Handle new Unicode-4.0 WORD_JOINER diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 7d0e7d97..0e021cc6 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,14 @@ +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. + Tue Jun 22 14:10:41 2004 Owen Taylor <otaylor@redhat.com> * pango/break.c: Handle new Unicode-4.0 WORD_JOINER diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 7d0e7d97..0e021cc6 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,14 @@ +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. + Tue Jun 22 14:10:41 2004 Owen Taylor <otaylor@redhat.com> * pango/break.c: Handle new Unicode-4.0 WORD_JOINER diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt index f70f2e58..5d8f89da 100644 --- a/docs/pango-sections.txt +++ b/docs/pango-sections.txt @@ -737,6 +737,7 @@ pango_ot_buffer_destroy pango_ot_buffer_clear pango_ot_buffer_add_glyph pango_ot_buffer_set_rtl +pango_ot_buffer_set_zero_width_marks pango_ot_buffer_get_glyphs pango_ot_buffer_output pango_ot_ruleset_new diff --git a/docs/tmpl/opentype.sgml b/docs/tmpl/opentype.sgml index 87deb9e3..f77eb3b4 100644 --- a/docs/tmpl/opentype.sgml +++ b/docs/tmpl/opentype.sgml @@ -195,13 +195,13 @@ identify the various OpenType tables in the @cluster: -<!-- ##### FUNCTION pango_ot_buffer_set_rtl ##### --> +<!-- ##### FUNCTION pango_ot_buffer_set_zero_width_marks ##### --> <para> </para> @buffer: -@rtl: +@zero_width_marks: <!-- ##### FUNCTION pango_ot_buffer_get_glyphs ##### --> diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c index b7be54d0..01841c33 100644 --- a/modules/arabic/arabic-fc.c +++ b/modules/arabic/arabic-fc.c @@ -277,6 +277,7 @@ arabic_engine_shape (PangoEngineShape *engine, buffer = pango_ot_buffer_new (fc_font); pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); + pango_ot_buffer_set_zero_width_marks (buffer, TRUE); wcs = g_utf8_to_ucs4_fast (text, length, &n_chars); properties = g_new0 (gulong, n_chars); 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, |