From 609b20078ee911d6cedc02009fc4703a6ee19a60 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 31 May 2006 07:26:19 +0000 Subject: =?UTF-8?q?Bug=20336153=20=E2=80=93=20Mark=20to=20mark=20positioni?= =?UTF-8?q?ng=20(Lookup=20Type=206)=20isn't=20correct=20when?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-05-31 Behdad Esfahbod Bug 336153 – Mark to mark positioning (Lookup Type 6) isn't correct when using MarkAttchmentType Patch from Tin Myo Htet. * pango/opentype/ftxgpos.c (Lookup_MarkMarkPos): Ignore marks of non-matchin attachment type. --- ChangeLog | 9 +++++++++ pango/opentype/ftxgpos.c | 38 ++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7e45270c..40568a90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-05-31 Behdad Esfahbod + + Bug 336153 – Mark to mark positioning (Lookup Type 6) isn't correct + when using MarkAttchmentType + Patch from Tin Myo Htet. + + * pango/opentype/ftxgpos.c (Lookup_MarkMarkPos): Ignore marks + of non-matchin attachment type. + 2006-05-30 Behdad Esfahbod Bug 125378 – Better underline thickness handling diff --git a/pango/opentype/ftxgpos.c b/pango/opentype/ftxgpos.c index a7b933ba..0970a505 100644 --- a/pango/opentype/ftxgpos.c +++ b/pango/opentype/ftxgpos.c @@ -3001,7 +3001,7 @@ FT_UShort context_length, int nesting_level ) { - FT_UShort j, mark1_index, mark2_index, property, class; + FT_UShort i, j, mark1_index, mark2_index, property, class; FT_Pos x_mark1_value, y_mark1_value, x_mark2_value, y_mark2_value; FT_Error error; @@ -3032,27 +3032,37 @@ if ( error ) return error; - /* now we check the preceding glyph whether it is a suitable - mark glyph */ + /* now we search backwards for a suitable mark glyph until a non-mark + glyph */ if ( buffer->in_pos == 0 ) return TTO_Err_Not_Covered; + i = 1; j = buffer->in_pos - 1; - error = TT_GDEF_Get_Glyph_Property( gpos->gdef, IN_GLYPH( j ), - &property ); - if ( error ) - return error; - if ( flags & IGNORE_SPECIAL_MARKS ) - { - if ( property != (flags & 0xFF00) ) - return TTO_Err_Not_Covered; - } - else + while ( i <= buffer->in_pos ) { - if ( property != TTO_MARK ) + error = TT_GDEF_Get_Glyph_Property( gpos->gdef, IN_GLYPH( j ), + &property ); + if ( error ) + return error; + + if ( !( property == TTO_MARK || property & IGNORE_SPECIAL_MARKS ) ) return TTO_Err_Not_Covered; + else + { + if ( flags & IGNORE_SPECIAL_MARKS ) + { + if ( property == (flags & 0xFF00) ) + break; + } + else + break; + } + + i++; + j--; } error = Coverage_Index( &mmp->Mark2Coverage, IN_GLYPH( j ), -- cgit v1.2.1