ReactOS 0.4.16-dev-1067-ge98bba2
gxvjust.c File Reference
#include "gxvalid.h"
#include "gxvcommn.h"
Include dependency graph for gxvjust.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GXV_just_DataRec_
 

Macros

#define FT_COMPONENT   gxvjust
 
#define GXV_JUST_DATA(a)   GXV_TABLE_DATA( just, a )
 

Typedefs

typedef struct GXV_just_DataRec_ GXV_just_DataRec
 
typedef struct GXV_just_DataRec_GXV_just_Data
 

Functions

static void gxv_just_check_max_gid (FT_UShort gid, const FT_String *msg_tag, GXV_Validator gxvalid)
 
static void gxv_just_wdp_entry_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_wdc_entry_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_widthDeltaClusters_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_actSubrecord_type0_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_actSubrecord_type1_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_actSubrecord_type2_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_actSubrecord_type4_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_actSubrecord_type5_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_actSubrecord_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_pcActionRecord_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_pcTable_LookupValue_entry_validate (FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
 
static void gxv_just_pcLookupTable_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_postcompTable_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_classTable_entry_validate (FT_Byte state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_justClassTable_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_wdcTable_LookupValue_validate (FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
 
static void gxv_just_justData_lookuptable_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_just_justData_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
 gxv_just_validate (FT_Bytes table, FT_Face face, FT_Validator ftvalid)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   gxvjust

Definition at line 41 of file gxvjust.c.

◆ GXV_JUST_DATA

#define GXV_JUST_DATA (   a)    GXV_TABLE_DATA( just, a )

Definition at line 66 of file gxvjust.c.

Typedef Documentation

◆ GXV_just_Data

◆ GXV_just_DataRec

Function Documentation

◆ gxv_just_actSubrecord_type0_validate()

static void gxv_just_actSubrecord_type0_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 180 of file gxvjust.c.

183 {
184 FT_Bytes p = table;
185
186 FT_Fixed lowerLimit;
187 FT_Fixed upperLimit;
188#ifdef GXV_LOAD_UNUSED_VARS
190#endif
191 FT_UShort decomposedCount;
192
193 FT_UInt i;
194
195
196 GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );
197 lowerLimit = FT_NEXT_LONG( p );
198 upperLimit = FT_NEXT_LONG( p );
199#ifdef GXV_LOAD_UNUSED_VARS
201#else
202 p += 2;
203#endif
204 decomposedCount = FT_NEXT_USHORT( p );
205
206 if ( lowerLimit >= upperLimit )
207 {
208 GXV_TRACE(( "just table includes invalid range spec:"
209 " lowerLimit(%d) > upperLimit(%d)\n" ));
211 }
212
213 for ( i = 0; i < decomposedCount; i++ )
214 {
216
217
218 GXV_LIMIT_CHECK( 2 );
220 gxv_just_check_max_gid( glyphs, "type0:glyphs", gxvalid );
221 }
222
223 gxvalid->subtable_length = (FT_ULong)( p - table );
224 }
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:233
#define FT_NEXT_LONG(buffer)
Definition: ftstream.h:242
unsigned long FT_ULong
Definition: fttypes.h:253
signed long FT_Fixed
Definition: fttypes.h:287
unsigned short FT_UShort
Definition: fttypes.h:209
unsigned int FT_UInt
Definition: fttypes.h:231
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define GXV_SET_ERR_IF_PARANOID(err)
Definition: gxvcommn.h:66
#define GXV_TRACE(s)
Definition: gxvcommn.h:304
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272
static void gxv_just_check_max_gid(FT_UShort gid, const FT_String *msg_tag, GXV_Validator gxvalid)
Definition: gxvjust.c:71
static UINT UINT LPWORD glyphs
Definition: font.c:44
FT_ULong subtable_length
Definition: gxvcommn.h:244

Referenced by gxv_just_actSubrecord_validate().

◆ gxv_just_actSubrecord_type1_validate()

static void gxv_just_actSubrecord_type1_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 228 of file gxvjust.c.

231 {
232 FT_Bytes p = table;
233 FT_UShort addGlyph;
234
235
236 GXV_LIMIT_CHECK( 2 );
237 addGlyph = FT_NEXT_USHORT( p );
238
239 gxv_just_check_max_gid( addGlyph, "type1:addGlyph", gxvalid );
240
241 gxvalid->subtable_length = (FT_ULong)( p - table );
242 }

Referenced by gxv_just_actSubrecord_validate().

◆ gxv_just_actSubrecord_type2_validate()

static void gxv_just_actSubrecord_type2_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 246 of file gxvjust.c.

249 {
250 FT_Bytes p = table;
251#ifdef GXV_LOAD_UNUSED_VARS
252 FT_Fixed substThreshhold; /* Apple misspelled "Threshhold" */
253#endif
254 FT_UShort addGlyph;
255 FT_UShort substGlyph;
256
257
258 GXV_LIMIT_CHECK( 4 + 2 + 2 );
259#ifdef GXV_LOAD_UNUSED_VARS
260 substThreshhold = FT_NEXT_ULONG( p );
261#else
262 p += 4;
263#endif
264 addGlyph = FT_NEXT_USHORT( p );
265 substGlyph = FT_NEXT_USHORT( p );
266
267 if ( addGlyph != 0xFFFF )
268 gxv_just_check_max_gid( addGlyph, "type2:addGlyph", gxvalid );
269
270 gxv_just_check_max_gid( substGlyph, "type2:substGlyph", gxvalid );
271
272 gxvalid->subtable_length = (FT_ULong)( p - table );
273 }
#define FT_NEXT_ULONG(buffer)
Definition: ftstream.h:245

Referenced by gxv_just_actSubrecord_validate().

◆ gxv_just_actSubrecord_type4_validate()

static void gxv_just_actSubrecord_type4_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 277 of file gxvjust.c.

280 {
281 FT_Bytes p = table;
282 FT_ULong variantsAxis;
283 FT_Fixed minimumLimit;
284 FT_Fixed noStretchValue;
285 FT_Fixed maximumLimit;
286
287
288 GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
289 variantsAxis = FT_NEXT_ULONG( p );
290 minimumLimit = FT_NEXT_LONG( p );
291 noStretchValue = FT_NEXT_LONG( p );
292 maximumLimit = FT_NEXT_LONG( p );
293
294 gxvalid->subtable_length = (FT_ULong)( p - table );
295
296 if ( variantsAxis != 0x64756374L ) /* 'duct' */
297 GXV_TRACE(( "variantsAxis 0x%08x is non default value",
298 variantsAxis ));
299
300 if ( minimumLimit > noStretchValue )
301 GXV_TRACE(( "type4:minimumLimit 0x%08x > noStretchValue 0x%08x\n",
302 minimumLimit, noStretchValue ));
303 else if ( noStretchValue > maximumLimit )
304 GXV_TRACE(( "type4:noStretchValue 0x%08x > maximumLimit 0x%08x\n",
305 noStretchValue, maximumLimit ));
306 else if ( !IS_PARANOID_VALIDATION )
307 return;
308
310 }
#define IS_PARANOID_VALIDATION
Definition: gxvcommn.h:65

Referenced by gxv_just_actSubrecord_validate().

◆ gxv_just_actSubrecord_type5_validate()

static void gxv_just_actSubrecord_type5_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 314 of file gxvjust.c.

317 {
318 FT_Bytes p = table;
320 FT_UShort glyph;
321
322
323 GXV_LIMIT_CHECK( 2 + 2 );
325 glyph = FT_NEXT_USHORT( p );
326
327 if ( flags )
328 GXV_TRACE(( "type5: nonzero value 0x%04x in unused flags\n",
329 flags ));
330 gxv_just_check_max_gid( glyph, "type5:glyph", gxvalid );
331
332 gxvalid->subtable_length = (FT_ULong)( p - table );
333 }
GLbitfield flags
Definition: glext.h:7161

Referenced by gxv_just_actSubrecord_validate().

◆ gxv_just_actSubrecord_validate()

static void gxv_just_actSubrecord_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 338 of file gxvjust.c.

341 {
342 FT_Bytes p = table;
343 FT_UShort actionClass;
344 FT_UShort actionType;
345 FT_ULong actionLength;
346
347
348 GXV_NAME_ENTER( "just actSubrecord" );
349
350 GXV_LIMIT_CHECK( 2 + 2 + 4 );
351 actionClass = FT_NEXT_USHORT( p );
352 actionType = FT_NEXT_USHORT( p );
353 actionLength = FT_NEXT_ULONG( p );
354
355 /* actionClass is related with justClass using 7bit only */
356 if ( ( actionClass & 0xFF80 ) != 0 )
358
359 if ( actionType == 0 )
361 else if ( actionType == 1 )
363 else if ( actionType == 2 )
365 else if ( actionType == 3 )
366 ; /* Stretch glyph action: no actionData */
367 else if ( actionType == 4 )
369 else if ( actionType == 5 )
371 else
373
374 gxvalid->subtable_length = actionLength;
375
376 GXV_EXIT;
377 }
GLint limit
Definition: glext.h:10326
#define GXV_NAME_ENTER(name)
Definition: gxvcommn.h:301
#define GXV_EXIT
Definition: gxvcommn.h:302
static void gxv_just_actSubrecord_type2_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:246
static void gxv_just_actSubrecord_type1_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:228
static void gxv_just_actSubrecord_type0_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:180
static void gxv_just_actSubrecord_type4_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:277
static void gxv_just_actSubrecord_type5_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:314

Referenced by gxv_just_pcActionRecord_validate().

◆ gxv_just_check_max_gid()

static void gxv_just_check_max_gid ( FT_UShort  gid,
const FT_String msg_tag,
GXV_Validator  gxvalid 
)
static

Definition at line 71 of file gxvjust.c.

74 {
75 FT_UNUSED( msg_tag );
76
77 if ( gid < gxvalid->face->num_glyphs )
78 return;
79
80 GXV_TRACE(( "just table includes too large %s"
81 " GID=%d > %d (in maxp)\n",
82 msg_tag, gid, gxvalid->face->num_glyphs ));
84 }
#define FT_UNUSED(arg)
Definition: ftconfig.h:100
#define FT_INVALID_GLYPH_ID
Definition: ftvalid.h:146
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
FT_Long num_glyphs
Definition: freetype.h:1049

Referenced by gxv_just_actSubrecord_type0_validate(), gxv_just_actSubrecord_type1_validate(), gxv_just_actSubrecord_type2_validate(), and gxv_just_actSubrecord_type5_validate().

◆ gxv_just_classTable_entry_validate()

static void gxv_just_classTable_entry_validate ( FT_Byte  state,
FT_UShort  flags,
GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,
FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 466 of file gxvjust.c.

473 {
474#ifdef GXV_LOAD_UNUSED_VARS
475 /* TODO: validate markClass & currentClass */
476 FT_UShort setMark;
477 FT_UShort dontAdvance;
478 FT_UShort markClass;
479 FT_UShort currentClass;
480#endif
481
482 FT_UNUSED( state );
483 FT_UNUSED( glyphOffset_p );
484 FT_UNUSED( table );
485 FT_UNUSED( limit );
486 FT_UNUSED( gxvalid );
487
488#ifndef GXV_LOAD_UNUSED_VARS
489 FT_UNUSED( flags );
490#else
491 setMark = (FT_UShort)( ( flags >> 15 ) & 1 );
492 dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
493 markClass = (FT_UShort)( ( flags >> 7 ) & 0x7F );
494 currentClass = (FT_UShort)( flags & 0x7F );
495#endif
496 }
static int state
Definition: maze.c:121

Referenced by gxv_just_justClassTable_validate().

◆ gxv_just_justClassTable_validate()

static void gxv_just_justClassTable_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 500 of file gxvjust.c.

503 {
504 FT_Bytes p = table;
506 FT_UShort coverage;
507 FT_ULong subFeatureFlags;
508
509
510 GXV_NAME_ENTER( "just justClassTable" );
511
512 GXV_LIMIT_CHECK( 2 + 2 + 4 );
514 coverage = FT_NEXT_USHORT( p );
515 subFeatureFlags = FT_NEXT_ULONG( p );
516
517 GXV_TRACE(( " justClassTable: coverage = 0x%04x (%s) ", coverage ));
518 if ( ( coverage & 0x4000 ) == 0 )
519 GXV_TRACE(( "ascending\n" ));
520 else
521 GXV_TRACE(( "descending\n" ));
522
523 if ( subFeatureFlags )
524 GXV_TRACE(( " justClassTable: nonzero value (0x%08x)"
525 " in unused subFeatureFlags\n", subFeatureFlags ));
526
527 gxvalid->statetable.optdata = NULL;
533
534 gxv_StateTable_validate( p, table + length, gxvalid );
535
536 /* subtable_length is set by gxv_LookupTable_validate() */
537
538 GXV_EXIT;
539 }
#define NULL
Definition: types.h:112
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
gxv_StateTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.c:1208
@ GXV_GLYPHOFFSET_NONE
Definition: gxvcommn.h:122
static void gxv_just_classTable_entry_validate(FT_Byte state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:466
GXV_StateTable_Entry_Validate_Func entry_validate_func
Definition: gxvcommn.h:185
GXV_StateTable_Subtable_Setup_Func subtable_setup_func
Definition: gxvcommn.h:184
GXV_GlyphOffset_Format entry_glyphoffset_fmt
Definition: gxvcommn.h:181
GXV_StateTable_OptData_Load_Func optdata_load_func
Definition: gxvcommn.h:186
GXV_StateTable_ValidatorRec statetable
Definition: gxvcommn.h:254

Referenced by gxv_just_justData_validate().

◆ gxv_just_justData_lookuptable_validate()

static void gxv_just_justData_lookuptable_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 557 of file gxvjust.c.

560 {
561 FT_Bytes p = table;
562
563
564 GXV_JUST_DATA( wdc_offset_max ) = 0x0000;
565 GXV_JUST_DATA( wdc_offset_min ) = 0xFFFFU;
566
569
570 gxv_LookupTable_validate( p, limit, gxvalid );
571
572 /* subtable_length is set by gxv_LookupTable_validate() */
573
574 GXV_EXIT;
575 }
gxv_LookupTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.c:755
@ GXV_LOOKUPVALUE_UNSIGNED
Definition: gxvcommn.h:100
#define GXV_JUST_DATA(a)
Definition: gxvjust.c:66
static void gxv_just_wdcTable_LookupValue_validate(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
Definition: gxvjust.c:543
GXV_Lookup_Value_Validate_Func lookupval_func
Definition: gxvcommn.h:247
GXV_LookupValue_SignSpec lookupval_sign
Definition: gxvcommn.h:246

Referenced by gxv_just_justData_validate().

◆ gxv_just_justData_validate()

static void gxv_just_justData_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 582 of file gxvjust.c.

585 {
586 /*
587 * following 3 offsets are measured from the start of `just'
588 * (which table points to), not justData
589 */
590 FT_UShort justClassTableOffset;
591 FT_UShort wdcTableOffset;
592 FT_UShort pcTableOffset;
593 FT_Bytes p = table;
594
595 GXV_ODTECT( 4, odtect );
596
597
598 GXV_NAME_ENTER( "just justData" );
599
600 GXV_ODTECT_INIT( odtect );
601 GXV_LIMIT_CHECK( 2 + 2 + 2 );
602 justClassTableOffset = FT_NEXT_USHORT( p );
603 wdcTableOffset = FT_NEXT_USHORT( p );
604 pcTableOffset = FT_NEXT_USHORT( p );
605
606 GXV_TRACE(( " (justClassTableOffset = 0x%04x)\n", justClassTableOffset ));
607 GXV_TRACE(( " (wdcTableOffset = 0x%04x)\n", wdcTableOffset ));
608 GXV_TRACE(( " (pcTableOffset = 0x%04x)\n", pcTableOffset ));
609
612 "just_LookupTable", odtect );
613
614 if ( wdcTableOffset )
615 {
617 gxvalid->root->base + wdcTableOffset, limit, gxvalid );
618 gxv_odtect_add_range( gxvalid->root->base + wdcTableOffset,
619 gxvalid->subtable_length, "just_wdcTable", odtect );
620 }
621
622 if ( pcTableOffset )
623 {
624 gxv_just_postcompTable_validate( gxvalid->root->base + pcTableOffset,
625 limit, gxvalid );
626 gxv_odtect_add_range( gxvalid->root->base + pcTableOffset,
627 gxvalid->subtable_length, "just_pcTable", odtect );
628 }
629
630 if ( justClassTableOffset )
631 {
633 gxvalid->root->base + justClassTableOffset, limit, gxvalid );
634 gxv_odtect_add_range( gxvalid->root->base + justClassTableOffset,
635 gxvalid->subtable_length, "just_justClassTable",
636 odtect );
637 }
638
639 gxv_odtect_validate( odtect, gxvalid );
640
641 GXV_EXIT;
642 }
gxv_odtect_add_range(FT_Bytes start, FT_ULong length, const FT_String *name, GXV_odtect_Range odtect)
Definition: gxvcommn.c:1702
gxv_odtect_validate(GXV_odtect_Range odtect, GXV_Validator gxvalid)
Definition: gxvcommn.c:1715
#define GXV_ODTECT(n, odtect)
Definition: gxvcommn.h:562
#define GXV_ODTECT_INIT(odtect)
Definition: gxvcommn.h:567
static void gxv_just_justData_lookuptable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:557
static void gxv_just_widthDeltaClusters_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:153
static void gxv_just_postcompTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:444
static void gxv_just_justClassTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:500
FT_Validator root
Definition: gxvcommn.h:239

Referenced by gxv_just_validate().

◆ gxv_just_pcActionRecord_validate()

static void gxv_just_pcActionRecord_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 381 of file gxvjust.c.

384 {
385 FT_Bytes p = table;
386 FT_ULong actionCount;
387 FT_ULong i;
388
389
390 GXV_LIMIT_CHECK( 4 );
391 actionCount = FT_NEXT_ULONG( p );
392 GXV_TRACE(( "actionCount = %d\n", actionCount ));
393
394 for ( i = 0; i < actionCount; i++ )
395 {
397 p += gxvalid->subtable_length;
398 }
399
400 gxvalid->subtable_length = (FT_ULong)( p - table );
401
402 GXV_EXIT;
403 }
static void gxv_just_actSubrecord_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:338

Referenced by gxv_just_postcompTable_validate().

◆ gxv_just_pcLookupTable_validate()

static void gxv_just_pcLookupTable_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 421 of file gxvjust.c.

424 {
425 FT_Bytes p = table;
426
427
428 GXV_NAME_ENTER( "just pcLookupTable" );
429 GXV_JUST_DATA( pc_offset_max ) = 0x0000;
430 GXV_JUST_DATA( pc_offset_min ) = 0xFFFFU;
431
434
435 gxv_LookupTable_validate( p, limit, gxvalid );
436
437 /* subtable_length is set by gxv_LookupTable_validate() */
438
439 GXV_EXIT;
440 }
static void gxv_just_pcTable_LookupValue_entry_validate(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
Definition: gxvjust.c:407

Referenced by gxv_just_postcompTable_validate().

◆ gxv_just_pcTable_LookupValue_entry_validate()

static void gxv_just_pcTable_LookupValue_entry_validate ( FT_UShort  glyph,
GXV_LookupValueCPtr  value_p,
GXV_Validator  gxvalid 
)
static

Definition at line 407 of file gxvjust.c.

410 {
411 FT_UNUSED( glyph );
412
413 if ( value_p->u > GXV_JUST_DATA( pc_offset_max ) )
414 GXV_JUST_DATA( pc_offset_max ) = value_p->u;
415 if ( value_p->u < GXV_JUST_DATA( pc_offset_max ) )
416 GXV_JUST_DATA( pc_offset_min ) = value_p->u;
417 }

Referenced by gxv_just_pcLookupTable_validate().

◆ gxv_just_postcompTable_validate()

static void gxv_just_postcompTable_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 444 of file gxvjust.c.

447 {
448 FT_Bytes p = table;
449
450
451 GXV_NAME_ENTER( "just postcompTable" );
452
454 p += gxvalid->subtable_length;
455
457 p += gxvalid->subtable_length;
458
459 gxvalid->subtable_length = (FT_ULong)( p - table );
460
461 GXV_EXIT;
462 }
static void gxv_just_pcLookupTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:421
static void gxv_just_pcActionRecord_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:381

Referenced by gxv_just_justData_validate().

◆ gxv_just_validate()

gxv_just_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  ftvalid 
)

Definition at line 646 of file gxvjust.c.

649 {
650 FT_Bytes p = table;
651 FT_Bytes limit = 0;
652
653 GXV_ValidatorRec gxvalidrec;
654 GXV_Validator gxvalid = &gxvalidrec;
655 GXV_just_DataRec justrec;
656 GXV_just_Data just = &justrec;
657
660 FT_UShort horizOffset;
661 FT_UShort vertOffset;
662
663 GXV_ODTECT( 3, odtect );
664
665
666 GXV_ODTECT_INIT( odtect );
667
668 gxvalid->root = ftvalid;
669 gxvalid->table_data = just;
670 gxvalid->face = face;
671
672 FT_TRACE3(( "validating `just' table\n" ));
673 GXV_INIT;
674
675 limit = gxvalid->root->limit;
676
677 GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 );
680 horizOffset = FT_NEXT_USHORT( p );
681 vertOffset = FT_NEXT_USHORT( p );
683 "just header", odtect );
684
685
686 /* Version 1.0 (always:2000) */
687 GXV_TRACE(( " (version = 0x%08x)\n", version ));
688 if ( version != 0x00010000UL )
690
691 /* format 0 (always:2000) */
692 GXV_TRACE(( " (format = 0x%04x)\n", format ));
693 if ( format != 0x0000 )
695
696 GXV_TRACE(( " (horizOffset = %d)\n", horizOffset ));
697 GXV_TRACE(( " (vertOffset = %d)\n", vertOffset ));
698
699
700 /* validate justData */
701 if ( 0 < horizOffset )
702 {
703 gxv_just_justData_validate( table + horizOffset, limit, gxvalid );
704 gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,
705 "horizJustData", odtect );
706 }
707
708 if ( 0 < vertOffset )
709 {
710 gxv_just_justData_validate( table + vertOffset, limit, gxvalid );
711 gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,
712 "vertJustData", odtect );
713 }
714
715 gxv_odtect_validate( odtect, gxvalid );
716
717 FT_TRACE4(( "\n" ));
718 }
WORD face[3]
Definition: mesh.c:4747
static const WCHAR version[]
Definition: asmname.c:66
#define FT_TRACE3(varformat)
Definition: ftdebug.h:188
#define FT_TRACE4(varformat)
Definition: ftdebug.h:189
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
#define GXV_INIT
Definition: gxvcommn.h:300
static void gxv_just_justData_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:582
void * table_data
Definition: gxvcommn.h:242
Definition: format.c:58

◆ gxv_just_wdc_entry_validate()

static void gxv_just_wdc_entry_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 131 of file gxvjust.c.

134 {
135 FT_Bytes p = table;
137
138
139 GXV_LIMIT_CHECK( 4 );
140 count = FT_NEXT_ULONG( p );
141 for ( i = 0; i < count; i++ )
142 {
143 GXV_TRACE(( "validating wdc pair %d/%d\n", i + 1, count ));
145 p += gxvalid->subtable_length;
146 }
147
148 gxvalid->subtable_length = (FT_ULong)( p - table );
149 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
static void gxv_just_wdp_entry_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:88

Referenced by gxv_just_widthDeltaClusters_validate().

◆ gxv_just_wdcTable_LookupValue_validate()

static void gxv_just_wdcTable_LookupValue_validate ( FT_UShort  glyph,
GXV_LookupValueCPtr  value_p,
GXV_Validator  gxvalid 
)
static

Definition at line 543 of file gxvjust.c.

546 {
547 FT_UNUSED( glyph );
548
549 if ( value_p->u > GXV_JUST_DATA( wdc_offset_max ) )
550 GXV_JUST_DATA( wdc_offset_max ) = value_p->u;
551 if ( value_p->u < GXV_JUST_DATA( wdc_offset_min ) )
552 GXV_JUST_DATA( wdc_offset_min ) = value_p->u;
553 }

Referenced by gxv_just_justData_lookuptable_validate().

◆ gxv_just_wdp_entry_validate()

static void gxv_just_wdp_entry_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 88 of file gxvjust.c.

91 {
93 FT_ULong justClass;
94#ifdef GXV_LOAD_UNUSED_VARS
95 FT_Fixed beforeGrowLimit;
96 FT_Fixed beforeShrinkGrowLimit;
97 FT_Fixed afterGrowLimit;
98 FT_Fixed afterShrinkGrowLimit;
99 FT_UShort growFlags;
100 FT_UShort shrinkFlags;
101#endif
102
103
104 GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 + 4 + 2 + 2 );
105 justClass = FT_NEXT_ULONG( p );
106#ifndef GXV_LOAD_UNUSED_VARS
107 p += 4 + 4 + 4 + 4 + 2 + 2;
108#else
109 beforeGrowLimit = FT_NEXT_ULONG( p );
110 beforeShrinkGrowLimit = FT_NEXT_ULONG( p );
111 afterGrowLimit = FT_NEXT_ULONG( p );
112 afterShrinkGrowLimit = FT_NEXT_ULONG( p );
113 growFlags = FT_NEXT_USHORT( p );
114 shrinkFlags = FT_NEXT_USHORT( p );
115#endif
116
117 /* According to Apple spec, only 7bits in justClass is used */
118 if ( ( justClass & 0xFFFFFF80UL ) != 0 )
119 {
120 GXV_TRACE(( "just table includes non-zero value"
121 " in unused justClass higher bits"
122 " of WidthDeltaPair" ));
124 }
125
126 gxvalid->subtable_length = (FT_ULong)( p - table );
127 }

Referenced by gxv_just_wdc_entry_validate().

◆ gxv_just_widthDeltaClusters_validate()

static void gxv_just_widthDeltaClusters_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)
static

Definition at line 153 of file gxvjust.c.

156 {
157 FT_Bytes p = table;
158 FT_Bytes wdc_end = table + GXV_JUST_DATA( wdc_offset_max );
159 FT_UInt i;
160
161
162 GXV_NAME_ENTER( "just justDeltaClusters" );
163
164 if ( limit <= wdc_end )
166
167 for ( i = 0; p <= wdc_end; i++ )
168 {
170 p += gxvalid->subtable_length;
171 }
172
173 gxvalid->subtable_length = (FT_ULong)( p - table );
174
175 GXV_EXIT;
176 }
#define FT_INVALID_OFFSET
Definition: ftvalid.h:138
static void gxv_just_wdc_entry_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:131

Referenced by gxv_just_justData_validate().