39#define FT_COMPONENT gxvopbd
53 FT_UShort valueOffset_min;
55 } GXV_opbd_DataRec, *GXV_opbd_Data;
58#define GXV_OPBD_DATA( FIELD ) GXV_TABLE_DATA( opbd, FIELD )
70 gxv_opbd_LookupValue_validate( FT_UShort glyph,
71 GXV_LookupValueCPtr value_p,
72 GXV_Validator gxvalid )
75 FT_Bytes p = gxvalid->root->base + value_p->u;
76 FT_Bytes limit = gxvalid->root->limit;
81 if ( value_p->u < GXV_OPBD_DATA( valueOffset_min ) )
82 GXV_OPBD_DATA( valueOffset_min ) = value_p->u;
84 for ( i = 0; i < 4; i++ )
87 delta_value = FT_NEXT_SHORT( p );
89 if ( GXV_OPBD_DATA( format ) )
91 if ( delta_value == -1 )
94 gxv_ctlPoint_validate( glyph, (FT_UShort)delta_value, gxvalid );
134 static GXV_LookupValueDesc
135 gxv_opbd_LookupFmt4_transit( FT_UShort relative_gindex,
136 GXV_LookupValueCPtr base_value_p,
137 FT_Bytes lookuptbl_limit,
138 GXV_Validator gxvalid )
140 GXV_LookupValueDesc value;
142 FT_UNUSED( lookuptbl_limit );
143 FT_UNUSED( gxvalid );
146 value.u = (FT_UShort)( base_value_p->u +
147 relative_gindex * 4 * sizeof ( FT_Short ) );
162 gxv_opbd_validate( FT_Bytes table,
164 FT_Validator ftvalid )
166 GXV_ValidatorRec gxvalidrec;
167 GXV_Validator gxvalid = &gxvalidrec;
168 GXV_opbd_DataRec opbdrec;
169 GXV_opbd_Data opbd = &opbdrec;
176 gxvalid->root = ftvalid;
177 gxvalid->table_data = opbd;
178 gxvalid->face = face;
180 FT_TRACE3((
"validating `opbd' table\n" ));
182 GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU;
185 GXV_LIMIT_CHECK( 4 + 2 );
186 version = FT_NEXT_ULONG( p );
187 GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p );
191 GXV_TRACE((
"(version=0x%08lx)\n", version ));
192 if ( 0x00010000UL != version )
196 GXV_TRACE((
"(format=0x%04x)\n", GXV_OPBD_DATA( format ) ));
197 if ( 0x0001 < GXV_OPBD_DATA( format ) )
200 gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
201 gxvalid->lookupval_func = gxv_opbd_LookupValue_validate;
202 gxvalid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
204 gxv_LookupTable_validate( p, limit, gxvalid );
205 p += gxvalid->subtable_length;
207 if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )
210 "found overlap between LookupTable and opbd_value array\n" ));