/[freetype]/freetype2/src/gxvalid/gxvlcar.c
ViewVC logotype

Diff of /freetype2/src/gxvalid/gxvlcar.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mpsuzuki, Wed Aug 24 04:31:31 2005 UTC revision 1.2 by wl, Wed Aug 31 22:39:23 2005 UTC
# Line 4  Line 4 
4  /*                                                                         */  /*                                                                         */
5  /*    TrueTypeGX/AAT lcar table validation (body).                         */  /*    TrueTypeGX/AAT lcar table validation (body).                         */
6  /*                                                                         */  /*                                                                         */
7  /*  Copyright 2004 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */  /*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
8  /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */  /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
9  /*                                                                         */  /*                                                                         */
10  /*  This file is part of the FreeType project, and may only be used,       */  /*  This file is part of the FreeType project, and may only be used,       */
# Line 16  Line 16 
16  /***************************************************************************/  /***************************************************************************/
17    
18  /***************************************************************************/  /***************************************************************************/
19    /*                                                                         */
20  /* gxvalid is derived from both gxlayout module and otvalid module.        */  /* gxvalid is derived from both gxlayout module and otvalid module.        */
21  /* Development of gxlayout was support of Information-technology Promotion */  /* Development of gxlayout is supported by the Information-technology      */
22  /* Agency(IPA), Japan.                                                     */  /* Promotion Agency(IPA), Japan.                                           */
23    /*                                                                         */
24  /***************************************************************************/  /***************************************************************************/
25    
26    
27  #include "gxvalid.h"  #include "gxvalid.h"
28  #include "gxvcommn.h"  #include "gxvcommn.h"
29    
30    
31    /*************************************************************************/    /*************************************************************************/
32    /*                                                                       */    /*                                                                       */
33    /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */    /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
# Line 35  Line 38 
38  #define FT_COMPONENT  trace_gxvlcar  #define FT_COMPONENT  trace_gxvlcar
39    
40    
   
41    /*************************************************************************/    /*************************************************************************/
42    /*************************************************************************/    /*************************************************************************/
43    /*****                                                               *****/    /*****                                                               *****/
# Line 50  Line 52 
52    
53    } GXV_lcar_DataRec, *GXV_lcar_Data;    } GXV_lcar_DataRec, *GXV_lcar_Data;
54    
55  #define  GXV_LCAR_DATA(FIELD)  GXV_TABLE_DATA( lcar, FIELD )  #define GXV_LCAR_DATA(FIELD)  GXV_TABLE_DATA( lcar, FIELD )
56    
57    
58    /*************************************************************************/    /*************************************************************************/
# Line 83  Line 85 
85                                   GXV_LookupValueDesc  value,                                   GXV_LookupValueDesc  value,
86                                   GXV_Validator        valid )                                   GXV_Validator        valid )
87    {    {
88      FT_Bytes      p     = valid->root->base + value.u;      FT_Bytes   p     = valid->root->base + value.u;
89      FT_Bytes      limit = valid->root->limit;      FT_Bytes   limit = valid->root->limit;
90      FT_UShort     count;      FT_UShort  count;
91      FT_Short      partial;      FT_Short   partial;
92      unsigned int  i;      FT_UShort  i;
93    
94    
95      GXV_NAME_ENTER( "element in lookupTable" );      GXV_NAME_ENTER( "element in lookupTable" );
96    
   
97      GXV_LIMIT_CHECK( 2 );      GXV_LIMIT_CHECK( 2 );
98      count = FT_NEXT_USHORT( p );      count = FT_NEXT_USHORT( p );
99    
# Line 106  Line 107 
107      GXV_EXIT;      GXV_EXIT;
108    }    }
109    
110    
111    /*    /*
112      +------ lcar --------------------+      +------ lcar --------------------+
113      |                                |      |                                |
# Line 138  Line 140 
140      |      |
141      |      |
142      |      |
143      +---->  lcar values...handled by lcar callback function */      +---->  lcar values...handled by lcar callback function
144      */
145    
146    static GXV_LookupValueDesc    static GXV_LookupValueDesc
147    gxv_lcar_LookupFmt4_transit( FT_UShort            relative_gindex,    gxv_lcar_LookupFmt4_transit( FT_UShort            relative_gindex,
# Line 151  Line 154 
154      FT_UShort            offset;      FT_UShort            offset;
155      GXV_LookupValueDesc  value;      GXV_LookupValueDesc  value;
156    
157        FT_UNUSED( lookuptbl_limit );
158    
159      offset = base_value.u + ( relative_gindex * sizeof ( FT_UShort ) );  
160        offset = base_value.u + relative_gindex * sizeof ( FT_UShort );
161      p      = valid->root->base + offset;      p      = valid->root->base + offset;
162      limit  = valid->root->limit;      limit  = valid->root->limit;
163    
# Line 191  Line 196 
196      valid->table_data = lcar;      valid->table_data = lcar;
197      valid->face       = face;      valid->face       = face;
198    
199      FT_TRACE3(( "validation lcar table\n" ));      FT_TRACE3(( "validating `lcar' table\n" ));
200      GXV_INIT;      GXV_INIT;
201    
202      GXV_LIMIT_CHECK( 4 + 2 );      GXV_LIMIT_CHECK( 4 + 2 );
203      version = FT_NEXT_ULONG( p );      version = FT_NEXT_ULONG( p );
204      GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p );      GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p );
205    
206      if ( version != 0x00010000)      if ( version != 0x00010000UL)
207        FT_INVALID_FORMAT;        FT_INVALID_FORMAT;
208    
209      if ( GXV_LCAR_DATA( format ) > 1 )      if ( GXV_LCAR_DATA( format ) > 1 )
210        FT_INVALID_FORMAT;        FT_INVALID_FORMAT;
211    
   
212      valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;      valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
213      valid->lookupval_func   = gxv_lcar_LookupValue_validate;      valid->lookupval_func   = gxv_lcar_LookupValue_validate;
214      valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;      valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26