zenilib: zenilib/jni/external/freetype2/src/gxvalid/gxvmorx0.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
gxvmorx0.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* gxvmorx0.c */
4 /* */
5 /* TrueTypeGX/AAT morx table validation */
6 /* body for type0 (Indic Script Rearrangement) subtable. */
7 /* */
8 /* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* */
11 /* This file is part of the FreeType project, and may only be used, */
12 /* modified, and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
16 /* */
17 /***************************************************************************/
18
19 /***************************************************************************/
20 /* */
21 /* gxvalid is derived from both gxlayout module and otvalid module. */
22 /* Development of gxlayout is supported by the Information-technology */
23 /* Promotion Agency(IPA), Japan. */
24 /* */
25 /***************************************************************************/
26
27
28 #include "gxvmorx.h"
29
30
31 /*************************************************************************/
32 /* */
33 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
34 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
35 /* messages during execution. */
36 /* */
37 #undef FT_COMPONENT
38 #define FT_COMPONENT trace_gxvmorx
39
40
41 static void
42 gxv_morx_subtable_type0_entry_validate(
43 FT_UShort state,
44 FT_UShort flags,
45 GXV_XStateTable_GlyphOffsetCPtr glyphOffset_p,
46 FT_Bytes table,
47 FT_Bytes limit,
48 GXV_Validator valid )
49 {
50 #ifdef GXV_LOAD_UNUSED_VARS
51 FT_UShort markFirst;
52 FT_UShort dontAdvance;
53 FT_UShort markLast;
54 #endif
55 FT_UShort reserved;
56 #ifdef GXV_LOAD_UNUSED_VARS
57 FT_UShort verb;
58 #endif
59
60 FT_UNUSED( state );
61 FT_UNUSED( glyphOffset_p );
62 FT_UNUSED( table );
63 FT_UNUSED( limit );
64
65
66 #ifdef GXV_LOAD_UNUSED_VARS
67 markFirst = (FT_UShort)( ( flags >> 15 ) & 1 );
68 dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
69 markLast = (FT_UShort)( ( flags >> 13 ) & 1 );
70 #endif
71
72 reserved = (FT_UShort)( flags & 0x1FF0 );
73 #ifdef GXV_LOAD_UNUSED_VARS
74 verb = (FT_UShort)( flags & 0x000F );
75 #endif
76
77 if ( 0 < reserved )
78 {
79 GXV_TRACE(( " non-zero bits found in reserved range\n" ));
80 FT_INVALID_DATA;
81 }
82 }
83
84
85 FT_LOCAL_DEF( void )
86 gxv_morx_subtable_type0_validate( FT_Bytes table,
87 FT_Bytes limit,
88 GXV_Validator valid )
89 {
90 FT_Bytes p = table;
91
92
93 GXV_NAME_ENTER(
94 "morx chain subtable type0 (Indic-Script Rearrangement)" );
95
96 GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );
97
98 valid->xstatetable.optdata = NULL;
99 valid->xstatetable.optdata_load_func = NULL;
100 valid->xstatetable.subtable_setup_func = NULL;
101 valid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
102 valid->xstatetable.entry_validate_func =
103 gxv_morx_subtable_type0_entry_validate;
104
105 gxv_XStateTable_validate( p, limit, valid );
106
107 GXV_EXIT;
108 }
109
110
111 /* END */
table
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glew.h:4422
NULL
#define NULL
Definition: ftobjs.h:61
GXV_NAME_ENTER
#define GXV_NAME_ENTER(name)
Definition: gxvcommn.h:301
GXV_TRACE
#define GXV_TRACE(s)
Definition: gxvcommn.h:304
gxv_XStateTable_validate
gxv_XStateTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
Definition: gxvcommn.c:1558
GXV_StateTable_GlyphOffsetDesc_
Definition: gxvcommn.h:142
GXV_GLYPHOFFSET_NONE
Definition: gxvcommn.h:122
GXV_EXIT
#define GXV_EXIT
Definition: gxvcommn.h:302
FT_LOCAL_DEF
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:467
p
GLfloat GLfloat p
Definition: glew.h:14938
gxvmorx.h
limit
GLint limit
Definition: glew.h:11829
FT_Bytes
const FT_Byte * FT_Bytes
Definition: fttypes.h:161
gxv_morx_subtable_type0_validate
gxv_morx_subtable_type0_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
Definition: gxvmorx0.c:86
GXV_STATETABLE_HEADER_SIZE
#define GXV_STATETABLE_HEADER_SIZE
Definition: gxvcommn.h:520
flags
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2767
FT_INVALID_DATA
#define FT_INVALID_DATA
Definition: ftvalid.h:141
gxv_morx_subtable_type0_entry_validate
static void gxv_morx_subtable_type0_entry_validate(FT_UShort state, FT_UShort flags, GXV_XStateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, GXV_Validator valid)
Definition: gxvmorx0.c:42
FT_UShort
unsigned short FT_UShort
Definition: fttypes.h:205
FT_UNUSED
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
GXV_ValidatorRec_
Definition: gxvcommn.h:237
GXV_LIMIT_CHECK
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272