gxvmorx0.c

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  gxvmorx0.c                                                             */
00004 /*                                                                         */
00005 /*    TrueTypeGX/AAT morx table validation                                 */
00006 /*    body for type0 (Indic Script Rearrangement) subtable.                */
00007 /*                                                                         */
00008 /*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */
00009 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00010 /*                                                                         */
00011 /*  This file is part of the FreeType project, and may only be used,       */
00012 /*  modified, and distributed under the terms of the FreeType project      */
00013 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00014 /*  this file you indicate that you have read the license and              */
00015 /*  understand and accept it fully.                                        */
00016 /*                                                                         */
00017 /***************************************************************************/
00018 
00019 /***************************************************************************/
00020 /*                                                                         */
00021 /* gxvalid is derived from both gxlayout module and otvalid module.        */
00022 /* Development of gxlayout is supported by the Information-technology      */
00023 /* Promotion Agency(IPA), Japan.                                           */
00024 /*                                                                         */
00025 /***************************************************************************/
00026 
00027 
00028 #include "gxvmorx.h"
00029 
00030 
00031   /*************************************************************************/
00032   /*                                                                       */
00033   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
00034   /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
00035   /* messages during execution.                                            */
00036   /*                                                                       */
00037 #undef  FT_COMPONENT
00038 #define FT_COMPONENT  trace_gxvmorx
00039 
00040 
00041   static void
00042   gxv_morx_subtable_type0_entry_validate(
00043     FT_UShort                        state,
00044     FT_UShort                        flags,
00045     GXV_XStateTable_GlyphOffsetCPtr  glyphOffset_p,
00046     FT_Bytes                         table,
00047     FT_Bytes                         limit,
00048     GXV_Validator                    valid )
00049   {
00050     FT_UShort  markFirst;
00051     FT_UShort  dontAdvance;
00052     FT_UShort  markLast;
00053     FT_UShort  reserved;
00054     FT_UShort  verb;
00055 
00056     FT_UNUSED( state );
00057     FT_UNUSED( glyphOffset_p );
00058     FT_UNUSED( table );
00059     FT_UNUSED( limit );
00060 
00061 
00062     markFirst   = (FT_UShort)( ( flags >> 15 ) & 1 );
00063     dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
00064     markLast    = (FT_UShort)( ( flags >> 13 ) & 1 );
00065 
00066     reserved = (FT_UShort)( flags & 0x1FF0 );
00067     verb     = (FT_UShort)( flags & 0x000F );
00068 
00069     if ( 0 < reserved )
00070     {
00071       GXV_TRACE(( " non-zero bits found in reserved range\n" ));
00072       FT_INVALID_DATA;
00073     }
00074   }
00075 
00076 
00077   FT_LOCAL_DEF( void )
00078   gxv_morx_subtable_type0_validate( FT_Bytes       table,
00079                                     FT_Bytes       limit,
00080                                     GXV_Validator  valid )
00081   {
00082     FT_Bytes  p = table;
00083 
00084 
00085     GXV_NAME_ENTER(
00086       "morx chain subtable type0 (Indic-Script Rearrangement)" );
00087 
00088     GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );
00089 
00090     valid->xstatetable.optdata               = NULL;
00091     valid->xstatetable.optdata_load_func     = NULL;
00092     valid->xstatetable.subtable_setup_func   = NULL;
00093     valid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
00094     valid->xstatetable.entry_validate_func =
00095       gxv_morx_subtable_type0_entry_validate;
00096 
00097     gxv_XStateTable_validate( p, limit, valid );
00098 
00099     GXV_EXIT;
00100   }
00101 
00102 
00103 /* END */

Generated on Tue Jul 5 14:13:47 2011 for ROOT_528-00b_version by  doxygen 1.5.1