date: 2001/08/22 18:27:35; author: werner; state: Exp; lines: +15 -4 Fix ligature subst lookup: Don't make a ligature for glyphs with different ligature IDs. Index: ftxgsub.c =================================================================== RCS file: /cvs/freetype/freetype/lib/extend/ftxgsub.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -p -r1.41 -r1.42 --- ftxgsub.c 2001/08/06 19:25:51 1.41 +++ ftxgsub.c 2001/08/22 18:27:35 1.42 @@ -1178,8 +1178,8 @@ { UShort index, property; TT_Error error; - UShort numlig, i, j, is_mark, first_is_mark = FALSE; - UShort* s_in; + UShort numlig, i, j, is_mark, first_ligID, first_is_mark = FALSE; + UShort *s_in, *lig_in; UShort* c; TTO_Ligature* lig; @@ -1207,8 +1207,10 @@ if ( in->pos + lig->ComponentCount > in->length ) continue; /* Not enough glyphs in input */ - s_in = &in->string[in->pos]; - c = lig->Component; + s_in = &in->string[in->pos]; + lig_in = &in->ligIDs[in->pos]; + first_ligID = *lig_in; + c = lig->Component; is_mark = first_is_mark; @@ -1227,6 +1229,15 @@ else break; } + + /* don't apply a ligature lookup if the ligature IDs are not + identical. Example: + ' + ^' ' ^ + f ^ l ' -> fl ^ ' -> fl but not fl ^ -> fl */ + + if ( first_ligID != lig_in[j] ) + break; if ( !( property == TTO_MARK || property & IGNORE_SPECIAL_MARKS ) ) is_mark = FALSE;