date: 2001/08/23 22:17:31; author: werner; state: Exp; lines: +21 -7 Apply ligature substitutions only if the component values of glyphs are identical. Index: ftxgsub.c =================================================================== RCS file: /cvs/freetype/freetype/lib/extend/ftxgsub.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -p -r1.42 -r1.43 --- ftxgsub.c 2001/08/22 18:27:35 1.42 +++ ftxgsub.c 2001/08/23 22:17:31 1.43 @@ -1178,8 +1178,9 @@ { UShort index, property; TT_Error error; - UShort numlig, i, j, is_mark, first_ligID, first_is_mark = FALSE; - UShort *s_in, *lig_in; + UShort numlig, i, j, is_mark, first_is_mark = FALSE; + UShort first_ligID, first_comp; + UShort *s_in, *lig_in, *comp_in; UShort* c; TTO_Ligature* lig; @@ -1209,7 +1210,9 @@ s_in = &in->string[in->pos]; lig_in = &in->ligIDs[in->pos]; + comp_in = &in->components[in->pos]; first_ligID = *lig_in; + first_comp = *comp_in; c = lig->Component; is_mark = first_is_mark; @@ -1230,13 +1233,24 @@ break; } - /* don't apply a ligature lookup if the ligature IDs are not - identical. Example: - ' - ^' ' ^ - f ^ l ' -> fl ^ ' -> fl but not fl ^ -> fl */ + /* don't apply a ligature lookup to glyphs with different + ligature IDs. Example: + ' + ^' ' ^ + f ^ l ' -> fl ^ ' -> fl but not fl ^ -> fl */ + if ( first_ligID != lig_in[j] ) + break; + + /* don't apply a ligature lookup to glyphs with different + component values. Example: + + ' + ^' ' ^ + f ^ f ' l -> ffl ^ ' -> ffl but not ffl ^ -> ffl */ + + if ( first_comp != comp_in[j] ) break; if ( !( property == TTO_MARK || property & IGNORE_SPECIAL_MARKS ) )