31 #define FT_COMPONENT trace_otvgpos 51 #define BaseArrayFunc otv_x_sxy 52 #define LigatureAttachFunc otv_x_sxy 53 #define Mark2ArrayFunc otv_x_sxy 63 FT_UInt Count, count1, table_size;
76 table_size = Count * valid->extra1 * 2 + 2;
78 for ( ; Count > 0; Count-- )
79 for ( count1 = valid->extra1; count1 > 0; count1-- )
90 otv_Anchor_validate( table + anchor_offset, valid );
93 otv_Anchor_validate( table + anchor_offset, valid );
100 #define MarkBasePosFormat1Func otv_u_O_O_u_O_O 101 #define MarkLigPosFormat1Func otv_u_O_O_u_O_O 102 #define MarkMarkPosFormat1Func otv_u_O_O_u_O_O 111 FT_UInt Coverage1, Coverage2, ClassCount;
130 otv_MarkArray_validate( table + Array1, valid );
132 valid->nesting_level++;
133 func = valid->func[valid->nesting_level];
134 valid->extra1 = ClassCount;
136 func( table + Array2, valid );
138 valid->nesting_level--;
158 count = ( ( format & 0xAA ) >> 1 ) + ( format & 0x55 );
159 count = ( ( count & 0xCC ) >> 2 ) + ( count & 0x33 );
160 count = ( ( count & 0xF0 ) >> 4 ) + ( count & 0x0F );
176 #ifdef FT_DEBUG_LEVEL_TRACE 184 for ( loop = 7; loop >= 0; loop-- )
187 res += (
format >> loop ) & 1;
190 OTV_TRACE((
" (format 0b%08lx)\n", res ));
196 for ( count = 4; count > 0; count-- )
208 for ( count = 4; count > 0; count-- )
225 table_size = p - valid->extra3;
259 OTV_TRACE((
" (format %d)\n", AnchorFormat ));
263 switch ( AnchorFormat )
325 OTV_TRACE((
" (MarkCount = %d)\n", MarkCount ));
330 for ( ; MarkCount > 0; MarkCount-- )
364 OTV_TRACE((
" (format %d)\n", PosFormat ));
366 valid->extra3 =
table;
380 otv_ValueRecord_validate( p, ValueFormat, valid );
386 FT_UInt Coverage, ValueFormat, ValueCount, len_value;
394 OTV_TRACE((
" (ValueCount = %d)\n", ValueCount ));
396 len_value = otv_value_length( ValueFormat );
403 for ( ; ValueCount > 0; ValueCount-- )
405 otv_ValueRecord_validate( p, ValueFormat, valid );
434 FT_UInt value_len1, value_len2, PairValueCount;
442 OTV_TRACE((
" (PairValueCount = %d)\n", PairValueCount ));
444 value_len1 = otv_value_length( format1 );
445 value_len2 = otv_value_length( format2 );
450 for ( ; PairValueCount > 0; PairValueCount-- )
455 otv_ValueRecord_validate( p, format1, valid );
459 otv_ValueRecord_validate( p, format2, valid );
482 OTV_TRACE((
" (format %d)\n", PosFormat ));
484 valid->extra3 =
table;
490 FT_UInt Coverage, ValueFormat1, ValueFormat2, PairSetCount;
499 OTV_TRACE((
" (PairSetCount = %d)\n", PairSetCount ));
506 for ( ; PairSetCount > 0; PairSetCount-- )
508 ValueFormat1, ValueFormat2, valid );
514 FT_UInt Coverage, ValueFormat1, ValueFormat2, ClassDef1, ClassDef2;
515 FT_UInt ClassCount1, ClassCount2, len_value1, len_value2,
count;
527 OTV_TRACE((
" (ClassCount1 = %d)\n", ClassCount1 ));
528 OTV_TRACE((
" (ClassCount2 = %d)\n", ClassCount2 ));
530 len_value1 = otv_value_length( ValueFormat1 );
531 len_value2 = otv_value_length( ValueFormat2 );
538 ( len_value1 + len_value2 ) );
541 for ( ; ClassCount1 > 0; ClassCount1-- )
544 for ( count = ClassCount2; count > 0; count-- )
548 otv_ValueRecord_validate( p, ValueFormat1, valid );
553 otv_ValueRecord_validate( p, ValueFormat2, valid );
589 OTV_TRACE((
" (format %d)\n", PosFormat ));
596 FT_UInt Coverage, EntryExitCount;
606 OTV_TRACE((
" (EntryExitCount = %d)\n", EntryExitCount ));
612 table_size = EntryExitCount * 4 + 4;
615 for ( ; EntryExitCount > 0; EntryExitCount-- )
622 otv_Anchor_validate(
table + EntryAnchor, valid );
626 otv_Anchor_validate(
table + ExitAnchor, valid );
665 OTV_TRACE((
" (format %d)\n", PosFormat ));
671 OTV_NEST2( MarkBasePosFormat1, BaseArray );
706 OTV_TRACE((
" (format %d)\n", PosFormat ));
712 OTV_NEST3( MarkLigPosFormat1, LigatureArray, LigatureAttach );
747 OTV_TRACE((
" (format %d)\n", PosFormat ));
753 OTV_NEST2( MarkMarkPosFormat1, Mark2Array );
788 OTV_TRACE((
" (format %d)\n", PosFormat ));
797 valid->extra1 = valid->lookup_count;
798 OTV_NEST3( ContextPosFormat1, PosRuleSet, PosRule );
807 OTV_NEST3( ContextPosFormat2, PosClassSet, PosClassRule );
847 OTV_TRACE((
" (format %d)\n", PosFormat ));
856 valid->extra1 = valid->lookup_count;
858 ChainPosRuleSet, ChainPosRule );
868 ChainPosClassSet, ChainPosClassRule );
908 OTV_TRACE((
" (format %d)\n", PosFormat ));
923 if ( ExtensionLookupType == 0 || ExtensionLookupType >= 9 )
926 validate = valid->type_funcs[ExtensionLookupType - 1];
927 validate(
table + ExtensionOffset, valid );
941 otv_SinglePos_validate,
942 otv_PairPos_validate,
943 otv_CursivePos_validate,
944 otv_MarkBasePos_validate,
945 otv_MarkLigPos_validate,
946 otv_MarkMarkPos_validate,
947 otv_ContextPos_validate,
948 otv_ChainContextPos_validate,
949 otv_ExtensionPos_validate
960 valid->type_count = 9;
985 FT_UInt ScriptList, FeatureList, LookupList;
988 valid->root = ftvalid;
990 FT_TRACE3((
"validating GPOS table\n" ));
1002 valid->type_count = 9;
1004 valid->glyph_count = glyph_count;
otv_ScriptList_validate(FT_Bytes table, FT_Bytes features, OTV_Validator valid)
#define OTV_OPTIONAL_TABLE(_table)
#define FT_INVALID_FORMAT
void(* OTV_Validate_Func)(FT_Bytes table, OTV_Validator valid)
otv_GPOS_validate(FT_Bytes table, FT_UInt glyph_count, FT_Validator ftvalid)
#define FT_TRACE4(varformat)
otv_ClassDef_validate(FT_Bytes table, OTV_Validator valid)
otv_Lookup_validate(FT_Bytes table, OTV_Validator valid)
otv_GPOS_subtable_validate(FT_Bytes table, OTV_Validator valid)
#define OTV_NAME_ENTER(name)
typedefFT_BEGIN_HEADER struct FT_ValidatorRec_ volatile * FT_Validator
#define OTV_LIMIT_CHECK(_count)
#define FT_NEXT_USHORT(buffer)
#define FT_TRACE3(varformat)
otv_Coverage_validate(FT_Bytes table, OTV_Validator valid, FT_Int expected_count)
typedefFT_BEGIN_HEADER struct OTV_ValidatorRec_ * OTV_Validator
#define FT_NEXT_ULONG(buffer)
GLuint GLuint GLsizei count
#define OTV_SIZE_CHECK(_size)
otv_Device_validate(FT_Bytes table, OTV_Validator valid)
#define OTV_NEST3(x, y, z)
GLenum GLsizei GLenum GLenum const GLvoid * table
#define OTV_OPTIONAL_OFFSET(_offset)
otv_FeatureList_validate(FT_Bytes table, FT_Bytes lookups, OTV_Validator valid)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
otv_LookupList_validate(FT_Bytes table, OTV_Validator valid)