From: handa Date: Fri, 22 Jan 2010 12:23:31 +0000 (+0000) Subject: (lookup_gsub): Change the meaning of the arg X-Git-Tag: REL-0-9-11~10 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45db56578d2164d4503efe1b920333dbe66bf83c;p=m17n%2Flibotf.git (lookup_gsub): Change the meaning of the arg alternate_subst. --- diff --git a/src/otfdrive.c b/src/otfdrive.c index c807e56..fc65cf3 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -440,7 +440,8 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, } if (alternate_subst - ? (lookup_type != 3 && lookup_type != 5 && lookup_type != 6) + ? (alternate_subst == 1 + && lookup_type != 3 && lookup_type != 5 && lookup_type != 6) : (lookup_type == 3)) continue; @@ -491,8 +492,12 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, OTF_GSUB_Alternate1 *alt1 = &subtable->u.alternate1; OTF_AlternateSet *altset = alt1->AlternateSet + coverage_idx; - gstring_subst (otf, gstring, gidx, gidx + 1, flag, - altset->Alternate, altset->GlyphCount); + if (alternate_subst == 1) + gstring_subst (otf, gstring, gidx, gidx + 1, flag, + altset->Alternate, altset->GlyphCount); + else + gstring_subst (otf, gstring, gidx, gidx + 1, flag, + altset->Alternate, 1); gidx += altset->GlyphCount;; } else @@ -547,7 +552,7 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, rule->LookupRecord[k].LookupListIndex, gstring, gidx + rule->LookupRecord[k].SequenceIndex, - alternate_subst); + alternate_subst ? alternate_subst : 2); gidx += rule->GlyphCount + (gstring->used - orig_used); break; } @@ -578,7 +583,7 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, rule->LookupRecord[k].LookupListIndex, gstring, gidx + rule->LookupRecord[k].SequenceIndex, - alternate_subst); + alternate_subst ? alternate_subst : 2); gidx += rule->GlyphCount + (gstring->used - orig_used); break; } @@ -599,7 +604,7 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, context3->LookupRecord[j].LookupListIndex, gstring, gidx + context3->LookupRecord[j].SequenceIndex, - alternate_subst); + alternate_subst ? alternate_subst : 2); gidx += context3->GlyphCount + (gstring->used - orig_used); } break; @@ -628,7 +633,7 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, rule->LookupRecord[k].LookupListIndex, gstring, gidx + rule->LookupRecord[k].SequenceIndex, - alternate_subst); + alternate_subst ? alternate_subst : 2); gidx += rule->InputGlyphCount + (gstring->used - orig_used); break; } @@ -664,7 +669,7 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, rule->LookupRecord[k].LookupListIndex, gstring, gidx + rule->LookupRecord[k].SequenceIndex, - alternate_subst); + alternate_subst ? alternate_subst : 2); gidx += rule->InputGlyphCount + (gstring->used - orig_used); break; } @@ -687,7 +692,7 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, context3->LookupRecord[j].LookupListIndex, gstring, gidx + context3->LookupRecord[j].SequenceIndex, - alternate_subst); + alternate_subst ? alternate_subst : 2); gidx += context3->InputGlyphCount + (gstring->used - orig_used); } break;