ReactOS 0.4.15-dev-8434-g155a7c7
gxvmorx.c File Reference
#include "gxvmorx.h"
Include dependency graph for gxvmorx.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FT_COMPONENT   trace_gxvmorx
 

Functions

static void gxv_morx_subtables_validate (FT_Bytes table, FT_Bytes limit, FT_UShort nSubtables, GXV_Validator gxvalid)
 
static void gxv_morx_chain_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
 gxv_morx_validate (FT_Bytes table, FT_Face face, FT_Validator ftvalid)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   trace_gxvmorx

Definition at line 38 of file gxvmorx.c.

Function Documentation

◆ gxv_morx_chain_validate()

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

Definition at line 117 of file gxvmorx.c.

120 {
121 FT_Bytes p = table;
122#ifdef GXV_LOAD_UNUSED_VARS
123 FT_ULong defaultFlags;
124#endif
125 FT_ULong chainLength;
126 FT_ULong nFeatureFlags;
127 FT_ULong nSubtables;
128
129
130 GXV_NAME_ENTER( "morx chain header" );
131
132 GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
133#ifdef GXV_LOAD_UNUSED_VARS
134 defaultFlags = FT_NEXT_ULONG( p );
135#else
136 p += 4;
137#endif
138 chainLength = FT_NEXT_ULONG( p );
139 nFeatureFlags = FT_NEXT_ULONG( p );
140 nSubtables = FT_NEXT_ULONG( p );
141
142 /* feature-array of morx is same with that of mort */
143 gxv_mort_featurearray_validate( p, limit, nFeatureFlags, gxvalid );
144 p += gxvalid->subtable_length;
145
146 if ( nSubtables >= 0x10000L )
148
149 gxv_morx_subtables_validate( p, table + chainLength,
150 (FT_UShort)nSubtables, gxvalid );
151
152 gxvalid->subtable_length = chainLength;
153
154 /* TODO: defaultFlags should be compared with the flags in tables */
155
156 GXV_EXIT;
157 }
#define FT_NEXT_ULONG(buffer)
Definition: ftstream.h:238
unsigned long FT_ULong
Definition: fttypes.h:253
unsigned short FT_UShort
Definition: fttypes.h:209
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLint limit
Definition: glext.h:10326
GLfloat GLfloat p
Definition: glext.h:8902
#define GXV_NAME_ENTER(name)
Definition: gxvcommn.h:301
#define GXV_EXIT
Definition: gxvcommn.h:302
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272
gxv_mort_featurearray_validate(FT_Bytes table, FT_Bytes limit, FT_ULong nFeatureFlags, GXV_Validator gxvalid)
Definition: gxvmort.c:90
static void gxv_morx_subtables_validate(FT_Bytes table, FT_Bytes limit, FT_UShort nSubtables, GXV_Validator gxvalid)
Definition: gxvmorx.c:42
FT_ULong subtable_length
Definition: gxvcommn.h:244

Referenced by gxv_morx_validate().

◆ gxv_morx_subtables_validate()

static void gxv_morx_subtables_validate ( FT_Bytes  table,
FT_Bytes  limit,
FT_UShort  nSubtables,
GXV_Validator  gxvalid 
)
static

Definition at line 42 of file gxvmorx.c.

46 {
48
49 GXV_Validate_Func fmt_funcs_table[] =
50 {
54 NULL, /* 3 */
57
58 };
59
61
62
63 GXV_NAME_ENTER( "subtables in a chain" );
64
65 for ( i = 0; i < nSubtables; i++ )
66 {
68
70 FT_ULong coverage;
71#ifdef GXV_LOAD_UNUSED_VARS
72 FT_ULong subFeatureFlags;
73#endif
75 FT_ULong rest;
76
77
78 GXV_LIMIT_CHECK( 4 + 4 + 4 );
80 coverage = FT_NEXT_ULONG( p );
81#ifdef GXV_LOAD_UNUSED_VARS
82 subFeatureFlags = FT_NEXT_ULONG( p );
83#else
84 p += 4;
85#endif
86
87 GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
88 i + 1, nSubtables, length ));
89
90 type = coverage & 0x0007;
91 rest = length - ( 4 + 4 + 4 );
92 GXV_LIMIT_CHECK( rest );
93
94 /* morx coverage consists of mort_coverage & 16bit padding */
95 gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ),
96 gxvalid );
97 if ( type > 5 )
99
100 func = fmt_funcs_table[type];
101 if ( !func )
102 GXV_TRACE(( "morx type %d is reserved\n", type ));
103
104 func( p, p + rest, gxvalid );
105
106 /* TODO: subFeatureFlags should be unique in a table? */
107 p += rest;
108 }
109
110 gxvalid->subtable_length = (FT_ULong)( p - table );
111
112 GXV_EXIT;
113 }
#define NULL
Definition: types.h:112
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum func
Definition: glext.h:6028
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
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
void(* GXV_Validate_Func)(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.h:82
#define GXV_TRACE(s)
Definition: gxvcommn.h:304
gxv_mort_coverage_validate(FT_UShort coverage, GXV_Validator gxvalid)
Definition: gxvmort.c:122
gxv_morx_subtable_type0_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmorx0.c:87
gxv_morx_subtable_type2_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmorx2.c:296
gxv_morx_subtable_type4_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmorx4.c:43
gxv_morx_subtable_type5_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmorx5.c:195
gxv_morx_subtable_type1_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmorx1.c:241

Referenced by gxv_morx_chain_validate().

◆ gxv_morx_validate()

gxv_morx_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  ftvalid 
)

Definition at line 161 of file gxvmorx.c.

164 {
165 GXV_ValidatorRec gxvalidrec;
166 GXV_Validator gxvalid = &gxvalidrec;
167 FT_Bytes p = table;
168 FT_Bytes limit = 0;
170 FT_ULong nChains;
171 FT_ULong i;
172
173
174 gxvalid->root = ftvalid;
175 gxvalid->face = face;
176
177 FT_TRACE3(( "validating `morx' table\n" ));
178 GXV_INIT;
179
180 GXV_LIMIT_CHECK( 4 + 4 );
182 nChains = FT_NEXT_ULONG( p );
183
184 if ( version != 0x00020000UL )
186
187 for ( i = 0; i < nChains; i++ )
188 {
189 GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
191 gxv_morx_chain_validate( p, limit, gxvalid );
192 p += gxvalid->subtable_length;
193 }
194
195 FT_TRACE4(( "\n" ));
196 }
WORD face[3]
Definition: mesh.c:4747
static const WCHAR version[]
Definition: asmname.c:66
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
#define GXV_32BIT_ALIGNMENT_VALIDATE(a)
Definition: gxvcommn.h:317
#define GXV_INIT
Definition: gxvcommn.h:300
static void gxv_morx_chain_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmorx.c:117
FT_Validator root
Definition: gxvcommn.h:239