static void otv_JstfScript_validate( FT_Bytes table, OTV_Validator valid ) { FT_Bytes p = table; FT_UInt table_size; FT_UInt JstfLangSysCount; OTV_OPTIONAL_TABLE( ExtGlyph ); OTV_OPTIONAL_TABLE( DefJstfLangSys ); OTV_NAME_ENTER( "JstfScript" ); OTV_LIMIT_CHECK( 6 ); OTV_OPTIONAL_OFFSET( ExtGlyph ); OTV_OPTIONAL_OFFSET( DefJstfLangSys ); JstfLangSysCount = FT_NEXT_USHORT( p ); OTV_TRACE(( " (JstfLangSysCount = %d)\n", JstfLangSysCount )); table_size = JstfLangSysCount * 6 + 6; OTV_SIZE_CHECK( ExtGlyph ); if ( ExtGlyph ) { valid->extra1 = valid->glyph_count; OTV_NEST1( ExtenderGlyph ); OTV_RUN( table + ExtGlyph, valid ); } OTV_SIZE_CHECK( DefJstfLangSys ); if ( DefJstfLangSys ) { OTV_NEST2( JstfLangSys, JstfPriority ); OTV_RUN( table + DefJstfLangSys, valid ); } OTV_LIMIT_CHECK( 6 * JstfLangSysCount ); /* JstfLangSysRecord */ OTV_NEST2( JstfLangSys, JstfPriority ); for ( ; JstfLangSysCount > 0; JstfLangSysCount-- ) { p += 4; /* skip JstfLangSysTag */ OTV_RUN( table + FT_NEXT_USHORT( p ), valid ); } OTV_EXIT; }
static void otv_ChainContextSubst_validate( FT_Bytes table, OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; OTV_NAME_ENTER( "ChainContextSubst" ); OTV_LIMIT_CHECK( 2 ); SubstFormat = FT_NEXT_USHORT( p ); OTV_TRACE(( " (format %d)\n", SubstFormat )); switch ( SubstFormat ) { case 1: /* no need to check glyph indices/classes used as input for these */ /* context rules since even invalid glyph indices/classes return */ /* meaningful results */ otvalid->extra1 = otvalid->lookup_count; OTV_NEST3( ChainContextSubstFormat1, ChainSubRuleSet, ChainSubRule ); OTV_RUN( table, otvalid ); break; case 2: /* no need to check glyph indices/classes used as input for these */ /* context rules since even invalid glyph indices/classes return */ /* meaningful results */ OTV_NEST3( ChainContextSubstFormat2, ChainSubClassSet, ChainSubClassRule ); OTV_RUN( table, otvalid ); break; case 3: OTV_NEST1( ChainContextSubstFormat3 ); OTV_RUN( table, otvalid ); break; default: FT_INVALID_FORMAT; } OTV_EXIT; }