@ -57,7 +57,7 @@
static void
otv_x_sxy ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt Count , count1 , table_size ;
@ -71,26 +71,26 @@
OTV_TRACE ( ( " (Count = %d) \n " , Count ) ) ;
OTV_LIMIT_CHECK ( Count * valid - > extra1 * 2 ) ;
OTV_LIMIT_CHECK ( Count * ot valid- > extra1 * 2 ) ;
table_size = Count * valid - > extra1 * 2 + 2 ;
table_size = Count * ot valid- > extra1 * 2 + 2 ;
for ( ; Count > 0 ; Count - - )
for ( count1 = valid - > extra1 ; count1 > 0 ; count1 - - )
for ( count1 = ot valid- > extra1 ; count1 > 0 ; count1 - - )
{
OTV_OPTIONAL_TABLE ( anchor_offset ) ;
OTV_OPTIONAL_OFFSET ( anchor_offset ) ;
if ( valid - > extra2 )
if ( ot valid- > extra2 )
{
OTV_SIZE_CHECK ( anchor_offset ) ;
if ( anchor_offset )
otv_Anchor_validate ( table + anchor_offset , valid ) ;
otv_Anchor_validate ( table + anchor_offset , ot valid ) ;
}
else
otv_Anchor_validate ( table + anchor_offset , valid ) ;
otv_Anchor_validate ( table + anchor_offset , ot valid ) ;
}
OTV_EXIT ;
@ -101,11 +101,11 @@
# define MarkLigPosFormat1Func otv_u_O_O_u_O_O
# define MarkMarkPosFormat1Func otv_u_O_O_u_O_O
/* sets valid->extra1 (class count) */
/* sets ot valid->extra1 (class count) */
static void
otv_u_O_O_u_O_O ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt Coverage1 , Coverage2 , ClassCount ;
@ -124,18 +124,18 @@
Array1 = FT_NEXT_USHORT ( p ) ;
Array2 = FT_NEXT_USHORT ( p ) ;
otv_Coverage_validate ( table + Coverage1 , valid , - 1 ) ;
otv_Coverage_validate ( table + Coverage2 , valid , - 1 ) ;
otv_Coverage_validate ( table + Coverage1 , ot valid, - 1 ) ;
otv_Coverage_validate ( table + Coverage2 , ot valid, - 1 ) ;
otv_MarkArray_validate ( table + Array1 , valid ) ;
otv_MarkArray_validate ( table + Array1 , ot valid ) ;
valid - > nesting_level + + ;
func = valid - > func [ valid - > nesting_level ] ;
valid - > extra1 = ClassCount ;
ot valid- > nesting_level + + ;
func = ot valid- > func [ ot valid- > nesting_level ] ;
ot valid- > extra1 = ClassCount ;
func ( table + Array2 , valid ) ;
func ( table + Array2 , ot valid ) ;
valid - > nesting_level - - ;
ot valid- > nesting_level - - ;
OTV_EXIT ;
}
@ -163,12 +163,12 @@
}
/* uses valid->extra3 (pointer to base table) */
/* uses ot valid->extra3 (pointer to base table) */
static void
otv_ValueRecord_validate ( FT_Bytes table ,
FT_UInt format ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt count ;
@ -222,11 +222,11 @@
/* ValueRecord is part of an array -- getting the correct table */
/* size is probably not worth the trouble */
table_size = p - valid - > extra3 ;
table_size = p - ot valid- > extra3 ;
OTV_SIZE_CHECK ( device ) ;
if ( device )
otv_Device_validate ( valid - > extra3 + device , valid ) ;
otv_Device_validate ( ot valid- > extra3 + device , ot valid ) ;
}
format > > = 1 ;
}
@ -245,7 +245,7 @@
static void
otv_Anchor_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt AnchorFormat ;
@ -285,11 +285,11 @@
OTV_SIZE_CHECK ( XDeviceTable ) ;
if ( XDeviceTable )
otv_Device_validate ( table + XDeviceTable , valid ) ;
otv_Device_validate ( table + XDeviceTable , ot valid ) ;
OTV_SIZE_CHECK ( YDeviceTable ) ;
if ( YDeviceTable )
otv_Device_validate ( table + YDeviceTable , valid ) ;
otv_Device_validate ( table + YDeviceTable , ot valid ) ;
}
break ;
@ -311,7 +311,7 @@
static void
otv_MarkArray_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt MarkCount ;
@ -331,7 +331,7 @@
{
p + = 2 ; /* skip Class */
/* MarkAnchor */
otv_Anchor_validate ( table + FT_NEXT_USHORT ( p ) , valid ) ;
otv_Anchor_validate ( table + FT_NEXT_USHORT ( p ) , ot valid ) ;
}
OTV_EXIT ;
@ -346,11 +346,11 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->extra3 (pointer to base table) */
/* sets ot valid->extra3 (pointer to base table) */
static void
otv_SinglePos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -363,7 +363,7 @@
OTV_TRACE ( ( " (format %d) \n " , PosFormat ) ) ;
valid - > extra3 = table ;
ot valid- > extra3 = table ;
switch ( PosFormat )
{
@ -376,8 +376,8 @@
Coverage = FT_NEXT_USHORT ( p ) ;
ValueFormat = FT_NEXT_USHORT ( p ) ;
otv_Coverage_validate ( table + Coverage , valid , - 1 ) ;
otv_ValueRecord_validate ( p , ValueFormat , valid ) ; /* Value */
otv_Coverage_validate ( table + Coverage , ot valid, - 1 ) ;
otv_ValueRecord_validate ( p , ValueFormat , ot valid ) ; /* Value */
}
break ;
@ -395,14 +395,14 @@
len_value = otv_value_length ( ValueFormat ) ;
otv_Coverage_validate ( table + Coverage , valid , ValueCount ) ;
otv_Coverage_validate ( table + Coverage , ot valid, ValueCount ) ;
OTV_LIMIT_CHECK ( ValueCount * len_value ) ;
/* Value */
for ( ; ValueCount > 0 ; ValueCount - - )
{
otv_ValueRecord_validate ( p , ValueFormat , valid ) ;
otv_ValueRecord_validate ( p , ValueFormat , ot valid ) ;
p + = len_value ;
}
}
@ -428,7 +428,7 @@
otv_PairSet_validate ( FT_Bytes table ,
FT_UInt format1 ,
FT_UInt format2 ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt value_len1 , value_len2 , PairValueCount ;
@ -452,11 +452,11 @@
p + = 2 ; /* skip SecondGlyph */
if ( format1 )
otv_ValueRecord_validate ( p , format1 , valid ) ; /* Value1 */
otv_ValueRecord_validate ( p , format1 , ot valid ) ; /* Value1 */
p + = value_len1 ;
if ( format2 )
otv_ValueRecord_validate ( p , format2 , valid ) ; /* Value2 */
otv_ValueRecord_validate ( p , format2 , ot valid ) ; /* Value2 */
p + = value_len2 ;
}
@ -464,11 +464,11 @@
}
/* sets valid->extra3 (pointer to base table) */
/* sets ot valid->extra3 (pointer to base table) */
static void
otv_PairPos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -481,7 +481,7 @@
OTV_TRACE ( ( " (format %d) \n " , PosFormat ) ) ;
valid - > extra3 = table ;
ot valid- > extra3 = table ;
switch ( PosFormat )
{
@ -498,14 +498,14 @@
OTV_TRACE ( ( " (PairSetCount = %d) \n " , PairSetCount ) ) ;
otv_Coverage_validate ( table + Coverage , valid , - 1 ) ;
otv_Coverage_validate ( table + Coverage , ot valid, - 1 ) ;
OTV_LIMIT_CHECK ( PairSetCount * 2 ) ;
/* PairSetOffset */
for ( ; PairSetCount > 0 ; PairSetCount - - )
otv_PairSet_validate ( table + FT_NEXT_USHORT ( p ) ,
ValueFormat1 , ValueFormat2 , valid ) ;
ValueFormat1 , ValueFormat2 , ot valid ) ;
}
break ;
@ -530,9 +530,9 @@
len_value1 = otv_value_length ( ValueFormat1 ) ;
len_value2 = otv_value_length ( ValueFormat2 ) ;
otv_Coverage_validate ( table + Coverage , valid , - 1 ) ;
otv_ClassDef_validate ( table + ClassDef1 , valid ) ;
otv_ClassDef_validate ( table + ClassDef2 , valid ) ;
otv_Coverage_validate ( table + Coverage , ot valid, - 1 ) ;
otv_ClassDef_validate ( table + ClassDef1 , ot valid ) ;
otv_ClassDef_validate ( table + ClassDef2 , ot valid ) ;
OTV_LIMIT_CHECK ( ClassCount1 * ClassCount2 *
( len_value1 + len_value2 ) ) ;
@ -545,12 +545,12 @@
{
if ( ValueFormat1 )
/* Value1 */
otv_ValueRecord_validate ( p , ValueFormat1 , valid ) ;
otv_ValueRecord_validate ( p , ValueFormat1 , ot valid ) ;
p + = len_value1 ;
if ( ValueFormat2 )
/* Value2 */
otv_ValueRecord_validate ( p , ValueFormat2 , valid ) ;
otv_ValueRecord_validate ( p , ValueFormat2 , ot valid ) ;
p + = len_value2 ;
}
}
@ -575,7 +575,7 @@
static void
otv_CursivePos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -605,7 +605,7 @@
OTV_TRACE ( ( " (EntryExitCount = %d) \n " , EntryExitCount ) ) ;
otv_Coverage_validate ( table + Coverage , valid , EntryExitCount ) ;
otv_Coverage_validate ( table + Coverage , ot valid, EntryExitCount ) ;
OTV_LIMIT_CHECK ( EntryExitCount * 4 ) ;
@ -619,11 +619,11 @@
OTV_SIZE_CHECK ( EntryAnchor ) ;
if ( EntryAnchor )
otv_Anchor_validate ( table + EntryAnchor , valid ) ;
otv_Anchor_validate ( table + EntryAnchor , ot valid ) ;
OTV_SIZE_CHECK ( ExitAnchor ) ;
if ( ExitAnchor )
otv_Anchor_validate ( table + ExitAnchor , valid ) ;
otv_Anchor_validate ( table + ExitAnchor , ot valid ) ;
}
}
break ;
@ -647,11 +647,11 @@
/* UNDOCUMENTED (in OpenType 1.5): */
/* BaseRecord tables can contain NULL pointers. */
/* sets valid->extra2 (1) */
/* sets ot valid->extra2 (1) */
static void
otv_MarkBasePos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -667,9 +667,9 @@
switch ( PosFormat )
{
case 1 :
valid - > extra2 = 1 ;
ot valid- > extra2 = 1 ;
OTV_NEST2 ( MarkBasePosFormat1 , BaseArray ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
default :
@ -688,11 +688,11 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->extra2 (1) */
/* sets ot valid->extra2 (1) */
static void
otv_MarkLigPos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -708,9 +708,9 @@
switch ( PosFormat )
{
case 1 :
valid - > extra2 = 1 ;
ot valid- > extra2 = 1 ;
OTV_NEST3 ( MarkLigPosFormat1 , LigatureArray , LigatureAttach ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
default :
@ -729,11 +729,11 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->extra2 (0) */
/* sets ot valid->extra2 (0) */
static void
otv_MarkMarkPos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -749,9 +749,9 @@
switch ( PosFormat )
{
case 1 :
valid - > extra2 = 0 ;
ot valid- > extra2 = 0 ;
OTV_NEST2 ( MarkMarkPosFormat1 , Mark2Array ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
default :
@ -770,11 +770,11 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->extra1 (lookup count) */
/* sets ot valid->extra1 (lookup count) */
static void
otv_ContextPos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -794,9 +794,9 @@
/* context rules since even invalid glyph indices/classes return */
/* meaningful results */
valid - > extra1 = valid - > lookup_count ;
ot valid- > extra1 = ot valid- > lookup_count ;
OTV_NEST3 ( ContextPosFormat1 , PosRuleSet , PosRule ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
case 2 :
@ -805,12 +805,12 @@
/* meaningful results */
OTV_NEST3 ( ContextPosFormat2 , PosClassSet , PosClassRule ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
case 3 :
OTV_NEST1 ( ContextPosFormat3 ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
default :
@ -829,11 +829,11 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->extra1 (lookup count) */
/* sets ot valid->extra1 (lookup count) */
static void
otv_ChainContextPos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -853,10 +853,10 @@
/* context rules since even invalid glyph indices/classes return */
/* meaningful results */
valid - > extra1 = valid - > lookup_count ;
ot valid- > extra1 = ot valid- > lookup_count ;
OTV_NEST3 ( ChainContextPosFormat1 ,
ChainPosRuleSet , ChainPosRule ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
case 2 :
@ -866,12 +866,12 @@
OTV_NEST3 ( ChainContextPosFormat2 ,
ChainPosClassSet , ChainPosClassRule ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
case 3 :
OTV_NEST1 ( ChainContextPosFormat3 ) ;
OTV_RUN ( table , valid ) ;
OTV_RUN ( table , ot valid ) ;
break ;
default :
@ -890,11 +890,11 @@
/*************************************************************************/
/*************************************************************************/
/* uses valid->type_funcs */
/* uses ot valid->type_funcs */
static void
otv_ExtensionPos_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
FT_Bytes p = table ;
FT_UInt PosFormat ;
@ -923,8 +923,8 @@
if ( ExtensionLookupType = = 0 | | ExtensionLookupType > = 9 )
FT_INVALID_DATA ;
validate = valid - > type_funcs [ ExtensionLookupType - 1 ] ;
validate ( table + ExtensionOffset , valid ) ;
validate = ot valid- > type_funcs [ ExtensionLookupType - 1 ] ;
validate ( table + ExtensionOffset , ot valid ) ;
}
break ;
@ -950,17 +950,17 @@
} ;
/* sets valid->type_count */
/* sets valid->type_funcs */
/* sets ot valid->type_count */
/* sets ot valid->type_funcs */
FT_LOCAL_DEF ( void )
otv_GPOS_subtable_validate ( FT_Bytes table ,
OTV_Validator valid )
OTV_Validator ot valid )
{
valid - > type_count = 9 ;
valid - > type_funcs = ( OTV_Validate_Func * ) otv_gpos_validate_funcs ;
ot valid- > type_count = 9 ;
ot valid- > type_funcs = ( OTV_Validate_Func * ) otv_gpos_validate_funcs ;
otv_Lookup_validate ( table , valid ) ;
otv_Lookup_validate ( table , ot valid ) ;
}
@ -972,7 +972,7 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->glyph_count */
/* sets ot valid->glyph_count */
FT_LOCAL_DEF ( void )
otv_GPOS_validate ( FT_Bytes table ,
@ -980,12 +980,12 @@
FT_Validator ftvalid )
{
OTV_ValidatorRec validrec ;
OTV_Validator valid = & validrec ;
OTV_Validator ot valid = & validrec ;
FT_Bytes p = table ;
FT_UInt ScriptList , FeatureList , LookupList ;
valid - > root = ftvalid ;
ot valid- > root = ftvalid ;
FT_TRACE3 ( ( " validating GPOS table \n " ) ) ;
OTV_INIT ;
@ -999,16 +999,16 @@
FeatureList = FT_NEXT_USHORT ( p ) ;
LookupList = FT_NEXT_USHORT ( p ) ;
valid - > type_count = 9 ;
valid - > type_funcs = ( OTV_Validate_Func * ) otv_gpos_validate_funcs ;
valid - > glyph_count = glyph_count ;
ot valid- > type_count = 9 ;
ot valid- > type_funcs = ( OTV_Validate_Func * ) otv_gpos_validate_funcs ;
ot valid- > glyph_count = glyph_count ;
otv_LookupList_validate ( table + LookupList ,
valid ) ;
ot valid ) ;
otv_FeatureList_validate ( table + FeatureList , table + LookupList ,
valid ) ;
ot valid ) ;
otv_ScriptList_validate ( table + ScriptList , table + FeatureList ,
valid ) ;
ot valid ) ;
FT_TRACE4 ( ( " \n " ) ) ;
}