Lines Matching defs:gsub
30 #include "harfbuzz-gsub-private.h"
34 static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub,
56 HB_GSUBHeader* gsub;
66 if ( ALLOC ( gsub, sizeof( *gsub ) ) )
82 ( error = _HB_OPEN_Load_ScriptList( &gsub->ScriptList,
96 ( error = _HB_OPEN_Load_FeatureList( &gsub->FeatureList,
110 ( error = _HB_OPEN_Load_LookupList( &gsub->LookupList,
114 gsub->gdef = gdef; /* can be NULL */
117 gsub->LookupList.Lookup,
118 gsub->LookupList.LookupCount ) ) )
121 *retptr = gsub;
126 _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
129 _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
132 _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
135 FREE ( gsub );
142 HB_Error HB_Done_GSUB_Table( HB_GSUBHeader* gsub )
144 _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
145 _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
146 _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
148 FREE( gsub );
264 static HB_Error Lookup_SingleSubst( HB_GSUBHeader* gsub,
274 HB_GDEFHeader* gdef = gsub->gdef;
469 static HB_Error Lookup_MultipleSubst( HB_GSUBHeader* gsub,
480 HB_GDEFHeader* gdef = gsub->gdef;
667 static HB_Error Lookup_AlternateSubst( HB_GSUBHeader* gsub,
677 HB_GDEFHeader* gdef = gsub->gdef;
696 if ( gsub->altfunc )
697 alt_index = (gsub->altfunc)( buffer->out_pos, IN_CURGLYPH(),
699 gsub->data );
944 static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub,
956 HB_GDEFHeader* gdef = gsub->gdef;
1077 static HB_Error Do_ContextSubst( HB_GSUBHeader* gsub,
1098 error = GSUB_Do_Glyph_Lookup( gsub, subst->LookupListIndex, buffer,
1804 static HB_Error Lookup_ContextSubst1( HB_GSUBHeader* gsub,
1819 gdef = gsub->gdef;
1855 return Do_ContextSubst( gsub, sr[k].GlyphCount,
1867 static HB_Error Lookup_ContextSubst2( HB_GSUBHeader* gsub,
1886 gdef = gsub->gdef;
1958 error = Do_ContextSubst( gsub, sr->GlyphCount,
1976 static HB_Error Lookup_ContextSubst3( HB_GSUBHeader* gsub,
1990 gdef = gsub->gdef;
2020 return Do_ContextSubst( gsub, csf3->GlyphCount,
2027 static HB_Error Lookup_ContextSubst( HB_GSUBHeader* gsub,
2038 case 1: return Lookup_ContextSubst1( gsub, &cs->csf.csf1, buffer, flags, context_length, nesting_level );
2039 case 2: return Lookup_ContextSubst2( gsub, &cs->csf.csf2, buffer, flags, context_length, nesting_level );
2040 case 3: return Lookup_ContextSubst3( gsub, &cs->csf.csf3, buffer, flags, context_length, nesting_level );
2993 static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub,
3010 gdef = gsub->gdef;
3106 return Do_ContextSubst( gsub, igc,
3120 static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub,
3148 gdef = gsub->gdef;
3298 error = Do_ContextSubst( gsub, igc,
3323 static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub,
3340 gdef = gsub->gdef;
3424 return Do_ContextSubst( gsub, igc,
3432 static HB_Error Lookup_ChainContextSubst( HB_GSUBHeader* gsub,
3442 case 1: return Lookup_ChainContextSubst1( gsub, &ccs->ccsf.ccsf1, buffer, flags, context_length, nesting_level );
3443 case 2: return Lookup_ChainContextSubst2( gsub, &ccs->ccsf.ccsf2, buffer, flags, context_length, nesting_level );
3444 case 3: return Lookup_ChainContextSubst3( gsub, &ccs->ccsf.ccsf3, buffer, flags, context_length, nesting_level );
3642 static HB_Error Lookup_ReverseChainContextSubst( HB_GSUBHeader* gsub,
3661 gdef = gsub->gdef;
3733 * GSUB API
3738 HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub,
3748 if ( !gsub || !script_index )
3751 sl = &gsub->ScriptList;
3767 HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub,
3781 if ( !gsub || !language_index || !req_feature_index )
3784 sl = &gsub->ScriptList;
3810 HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub,
3829 if ( !gsub || !feature_index )
3832 sl = &gsub->ScriptList;
3835 fl = &gsub->FeatureList;
3876 HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub,
3887 if ( !gsub || !script_tag_list )
3890 sl = &gsub->ScriptList;
3907 HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub,
3921 if ( !gsub || !language_tag_list )
3924 sl = &gsub->ScriptList;
3950 HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub,
3970 if ( !gsub || !feature_tag_list )
3973 sl = &gsub->ScriptList;
3976 fl = &gsub->FeatureList;
4019 static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub,
4035 lookup_count = gsub->LookupList.LookupCount;
4039 lo = &gsub->LookupList.Lookup[lookup_index];
4045 HB_GSUB_SubTable *st = &lo->SubTable[i].st.gsub;
4049 error = Lookup_SingleSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
4051 error = Lookup_MultipleSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
4053 error = Lookup_AlternateSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
4055 error = Lookup_LigatureSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
4057 error = Lookup_ContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
4059 error = Lookup_ChainContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
4061 error = Lookup_ExtensionSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;*/
4063 error = Lookup_ReverseChainContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
4118 static HB_Error GSUB_Do_String_Lookup( HB_GSUBHeader* gsub,
4124 HB_UInt* properties = gsub->LookupList.Properties;
4125 int lookup_type = gsub->LookupList.Lookup[lookup_index].LookupType;
4147 error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level );
4181 error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level );
4207 HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub,
4220 if ( !gsub ||
4221 feature_index >= gsub->FeatureList.FeatureCount ||
4222 gsub->FeatureList.ApplyCount == gsub->FeatureList.FeatureCount )
4225 gsub->FeatureList.ApplyOrder[gsub->FeatureList.ApplyCount++] = feature_index;
4227 properties = gsub->LookupList.Properties;
4229 feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
4231 lookup_count = gsub->LookupList.LookupCount;
4245 HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub )
4252 if ( !gsub )
4255 gsub->FeatureList.ApplyCount = 0;
4257 properties = gsub->LookupList.Properties;
4259 for ( i = 0; i < gsub->LookupList.LookupCount; i++ )
4267 HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub,
4271 if ( !gsub )
4274 gsub->altfunc = altfunc;
4275 gsub->data = data;
4283 HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub,
4289 if ( !gsub ||
4296 lookup_count = gsub->LookupList.LookupCount;
4297 num_features = gsub->FeatureList.ApplyCount;
4301 HB_UShort feature_index = gsub->FeatureList.ApplyOrder[i];
4302 HB_Feature feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
4312 error = GSUB_Do_String_Lookup( gsub, lookup_index, buffer );