ReactOS  0.4.15-dev-2701-g34593d9
gxvmort1.c File Reference
#include "gxvmort.h"
Include dependency graph for gxvmort1.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GXV_mort_subtable_type1_StateOptRec_
 

Macros

#define FT_COMPONENT   trace_gxvmort
 
#define GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE   ( GXV_STATETABLE_HEADER_SIZE + 2 )
 

Typedefs

typedef struct GXV_mort_subtable_type1_StateOptRec_ GXV_mort_subtable_type1_StateOptRec
 
typedef struct GXV_mort_subtable_type1_StateOptRec_GXV_mort_subtable_type1_StateOptRecData
 

Functions

static void gxv_mort_subtable_type1_substitutionTable_load (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
static void gxv_mort_subtable_type1_subtable_setup (FT_UShort table_size, FT_UShort classTable, FT_UShort stateArray, FT_UShort entryTable, FT_UShort *classTable_length_p, FT_UShort *stateArray_length_p, FT_UShort *entryTable_length_p, GXV_Validator gxvalid)
 
static void gxv_mort_subtable_type1_offset_to_subst_validate (FT_Short wordOffset, const FT_String *tag, FT_Byte state, GXV_Validator gxvalid)
 
static void gxv_mort_subtable_type1_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_mort_subtable_type1_substTable_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 
 gxv_mort_subtable_type1_validate (FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   trace_gxvmort

Definition at line 39 of file gxvmort1.c.

◆ GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE

#define GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE   ( GXV_STATETABLE_HEADER_SIZE + 2 )

Definition at line 50 of file gxvmort1.c.

Typedef Documentation

◆ GXV_mort_subtable_type1_StateOptRec

◆ GXV_mort_subtable_type1_StateOptRecData

Function Documentation

◆ gxv_mort_subtable_type1_entry_validate()

static void gxv_mort_subtable_type1_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 135 of file gxvmort1.c.

142  {
143 #ifdef GXV_LOAD_UNUSED_VARS
144  FT_UShort setMark;
145  FT_UShort dontAdvance;
146 #endif
148  FT_Short markOffset;
149  FT_Short currentOffset;
150 
151  FT_UNUSED( table );
152  FT_UNUSED( limit );
153 
154 
155 #ifdef GXV_LOAD_UNUSED_VARS
156  setMark = (FT_UShort)( flags >> 15 );
157  dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
158 #endif
159  reserved = (FT_UShort)( flags & 0x3FFF );
160 
161  markOffset = (FT_Short)( glyphOffset_p->ul >> 16 );
162  currentOffset = (FT_Short)( glyphOffset_p->ul );
163 
164  if ( 0 < reserved )
165  {
166  GXV_TRACE(( " non-zero bits found in reserved range\n" ));
168  }
169 
171  "markOffset",
172  state,
173  gxvalid );
174 
176  "currentOffset",
177  state,
178  gxvalid );
179  }
#define GXV_TRACE(s)
Definition: gxvcommn.h:304
GLint limit
Definition: glext.h:10326
#define GXV_SET_ERR_IF_PARANOID(err)
Definition: gxvcommn.h:66
r reserved
Definition: btrfs.c:2940
GLbitfield flags
Definition: glext.h:7161
signed short FT_Short
Definition: fttypes.h:198
static int state
Definition: maze.c:121
static void gxv_mort_subtable_type1_offset_to_subst_validate(FT_Short wordOffset, const FT_String *tag, FT_Byte state, GXV_Validator gxvalid)
Definition: gxvmort1.c:102
#define FT_INVALID_DATA
Definition: ftvalid.h:150
unsigned short FT_UShort
Definition: fttypes.h:209
#define FT_UNUSED(arg)
Definition: ftconfig.h:101

Referenced by gxv_mort_subtable_type1_validate().

◆ gxv_mort_subtable_type1_offset_to_subst_validate()

static void gxv_mort_subtable_type1_offset_to_subst_validate ( FT_Short  wordOffset,
const FT_String tag,
FT_Byte  state,
GXV_Validator  gxvalid 
)
static

Definition at line 102 of file gxvmort1.c.

107  {
108  FT_UShort substTable;
109  FT_UShort substTable_limit;
110 
111  FT_UNUSED( tag );
112  FT_UNUSED( state );
113 
114 
115  substTable =
117  (gxvalid->statetable.optdata))->substitutionTable;
118  substTable_limit =
119  (FT_UShort)( substTable +
121  (gxvalid->statetable.optdata))->substitutionTable_length );
122 
123  gxvalid->min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 );
124  gxvalid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
125  gxvalid->max_gid = (FT_UShort)( FT_MAX( gxvalid->max_gid,
126  gxvalid->face->num_glyphs ) );
127 
128  /* XXX: check range? */
129 
130  /* TODO: min_gid & max_gid comparison with ClassTable contents */
131  }
FT_Long num_glyphs
Definition: freetype.h:1076
Definition: ecma_167.h:138
FT_UShort min_gid
Definition: gxvcommn.h:251
FT_UShort max_gid
Definition: gxvcommn.h:252
#define FT_MAX(a, b)
Definition: ftobjs.h:72
GXV_StateTable_ValidatorRec statetable
Definition: gxvcommn.h:254
static int state
Definition: maze.c:121
unsigned short FT_UShort
Definition: fttypes.h:209
#define FT_UNUSED(arg)
Definition: ftconfig.h:101

Referenced by gxv_mort_subtable_type1_entry_validate().

◆ gxv_mort_subtable_type1_substitutionTable_load()

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

Definition at line 55 of file gxvmort1.c.

58  {
59  FT_Bytes p = table;
60 
63 
64 
65  GXV_LIMIT_CHECK( 2 );
66  optdata->substitutionTable = FT_NEXT_USHORT( p );
67  }
struct GXV_mort_subtable_type1_StateOptRec_ * GXV_mort_subtable_type1_StateOptRecData
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
GXV_StateTable_ValidatorRec statetable
Definition: gxvcommn.h:254
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
GLfloat GLfloat p
Definition: glext.h:8902
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272

Referenced by gxv_mort_subtable_type1_validate().

◆ gxv_mort_subtable_type1_substTable_validate()

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

Definition at line 183 of file gxvmort1.c.

186  {
187  FT_Bytes p = table;
188  FT_UShort num_gids = (FT_UShort)(
190  (gxvalid->statetable.optdata))->substitutionTable_length / 2 );
191  FT_UShort i;
192 
193 
194  GXV_NAME_ENTER( "validating contents of substitutionTable" );
195  for ( i = 0; i < num_gids; i++ )
196  {
197  FT_UShort dst_gid;
198 
199 
200  GXV_LIMIT_CHECK( 2 );
201  dst_gid = FT_NEXT_USHORT( p );
202 
203  if ( dst_gid >= 0xFFFFU )
204  continue;
205 
206  if ( dst_gid < gxvalid->min_gid || gxvalid->max_gid < dst_gid )
207  {
208  GXV_TRACE(( "substTable include a strange gid[%d]=%d >"
209  " out of define range (%d..%d)\n",
210  i, dst_gid, gxvalid->min_gid, gxvalid->max_gid ));
212  }
213  }
214 
215  GXV_EXIT;
216  }
#define GXV_NAME_ENTER(name)
Definition: gxvcommn.h:301
#define GXV_TRACE(s)
Definition: gxvcommn.h:304
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define GXV_SET_ERR_IF_PARANOID(err)
Definition: gxvcommn.h:66
FT_UShort min_gid
Definition: gxvcommn.h:251
FT_UShort max_gid
Definition: gxvcommn.h:252
#define GXV_EXIT
Definition: gxvcommn.h:302
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
GXV_StateTable_ValidatorRec statetable
Definition: gxvcommn.h:254
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
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 FT_INVALID_GLYPH_ID
Definition: ftvalid.h:146
GLfloat GLfloat p
Definition: glext.h:8902
unsigned short FT_UShort
Definition: fttypes.h:209
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272

Referenced by gxv_mort_subtable_type1_validate().

◆ gxv_mort_subtable_type1_subtable_setup()

static void gxv_mort_subtable_type1_subtable_setup ( FT_UShort  table_size,
FT_UShort  classTable,
FT_UShort  stateArray,
FT_UShort  entryTable,
FT_UShort classTable_length_p,
FT_UShort stateArray_length_p,
FT_UShort entryTable_length_p,
GXV_Validator  gxvalid 
)
static

Definition at line 71 of file gxvmort1.c.

79  {
80  FT_UShort o[4];
81  FT_UShort *l[4];
82  FT_UShort buff[5];
83 
86 
87 
88  o[0] = classTable;
89  o[1] = stateArray;
90  o[2] = entryTable;
91  o[3] = optdata->substitutionTable;
92  l[0] = classTable_length_p;
93  l[1] = stateArray_length_p;
94  l[2] = entryTable_length_p;
95  l[3] = &( optdata->substitutionTable_length );
96 
98  }
struct GXV_mort_subtable_type1_StateOptRec_ * GXV_mort_subtable_type1_StateOptRecData
gxv_set_length_by_ushort_offset(FT_UShort *offset, FT_UShort **length, FT_UShort *buff, FT_UInt nmemb, FT_UShort limit, GXV_Validator gxvalid)
Definition: gxvcommn.c:63
r l[0]
Definition: byte_order.h:167
GXV_StateTable_ValidatorRec statetable
Definition: gxvcommn.h:254
unsigned short FT_UShort
Definition: fttypes.h:209
static unsigned char buff[32768]
Definition: fatten.c:17
LOCAL int table_size
Definition: write.c:65

Referenced by gxv_mort_subtable_type1_validate().

◆ gxv_mort_subtable_type1_validate()

gxv_mort_subtable_type1_validate ( FT_Bytes  table,
FT_Bytes  limit,
GXV_Validator  gxvalid 
)

Definition at line 225 of file gxvmort1.c.

228  {
229  FT_Bytes p = table;
230 
232 
233 
234  GXV_NAME_ENTER( "mort chain subtable type1 (Contextual Glyph Subst)" );
235 
237 
238  gxvalid->statetable.optdata =
239  &st_rec;
240  gxvalid->statetable.optdata_load_func =
247 
249  gxv_StateTable_validate( p, limit, gxvalid );
250 
252  table + st_rec.substitutionTable,
254  gxvalid );
255 
256  GXV_EXIT;
257  }
gxv_StateTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.c:1208
#define GXV_NAME_ENTER(name)
Definition: gxvcommn.h:301
GXV_StateTable_Entry_Validate_Func entry_validate_func
Definition: gxvcommn.h:185
GXV_StateTable_OptData_Load_Func optdata_load_func
Definition: gxvcommn.h:186
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE
Definition: gxvmort1.c:50
GLint limit
Definition: glext.h:10326
GXV_StateTable_Subtable_Setup_Func subtable_setup_func
Definition: gxvcommn.h:184
#define GXV_EXIT
Definition: gxvcommn.h:302
static void gxv_mort_subtable_type1_substitutionTable_load(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmort1.c:55
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
GXV_StateTable_ValidatorRec statetable
Definition: gxvcommn.h:254
static void gxv_mort_subtable_type1_subtable_setup(FT_UShort table_size, FT_UShort classTable, FT_UShort stateArray, FT_UShort entryTable, FT_UShort *classTable_length_p, FT_UShort *stateArray_length_p, FT_UShort *entryTable_length_p, GXV_Validator gxvalid)
Definition: gxvmort1.c:71
static void gxv_mort_subtable_type1_entry_validate(FT_Byte state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmort1.c:135
GXV_GlyphOffset_Format entry_glyphoffset_fmt
Definition: gxvcommn.h:181
static void gxv_mort_subtable_type1_substTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmort1.c:183
GLfloat GLfloat p
Definition: glext.h:8902
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272

Referenced by gxv_mort_subtables_validate().