1 /***************************************************************************/
5 /* TrueTypeGX/AAT mort table validation */
6 /* body for type4 (Non-Contextual Glyph Substitution) subtable. */
8 /* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
17 /***************************************************************************/
19 /***************************************************************************/
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. */
25 /***************************************************************************/
31 /*************************************************************************/
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. */
38 #define FT_COMPONENT trace_gxvmort
42 gxv_mort_subtable_type4_lookupval_validate( FT_UShort glyph
,
43 GXV_LookupValueCPtr value_p
,
44 GXV_Validator gxvalid
)
48 gxv_glyphid_validate( value_p
->u
, gxvalid
);
52 +===============+ --------+
59 | firstGlyph[0] | | head of lookup table
61 | offset[0] | -> | offset [byte]
63 | lastGlyph[1] | | (glyphID - firstGlyph) * 2 [byte]
78 static GXV_LookupValueDesc
79 gxv_mort_subtable_type4_lookupfmt4_transit(
80 FT_UShort relative_gindex
,
81 GXV_LookupValueCPtr base_value_p
,
82 FT_Bytes lookuptbl_limit
,
83 GXV_Validator gxvalid
)
88 GXV_LookupValueDesc value
;
90 /* XXX: check range? */
91 offset
= (FT_UShort
)( base_value_p
->u
+
92 relative_gindex
* sizeof ( FT_UShort
) );
94 p
= gxvalid
->lookuptbl_head
+ offset
;
95 limit
= lookuptbl_limit
;
98 value
.u
= FT_NEXT_USHORT( p
);
105 gxv_mort_subtable_type4_validate( FT_Bytes table
,
107 GXV_Validator gxvalid
)
112 GXV_NAME_ENTER( "mort chain subtable type4 "
113 "(Non-Contextual Glyph Substitution)" );
115 gxvalid
->lookupval_sign
= GXV_LOOKUPVALUE_UNSIGNED
;
116 gxvalid
->lookupval_func
= gxv_mort_subtable_type4_lookupval_validate
;
117 gxvalid
->lookupfmt4_trans
= gxv_mort_subtable_type4_lookupfmt4_transit
;
119 gxv_LookupTable_validate( p
, limit
, gxvalid
);