misc/libfreetype/src/gxvalid/gxvopbd.c
author sheepluva
Wed, 05 Jun 2013 16:28:30 +0200
changeset 9137 d987230b85ed
parent 5172 88f2e05288ba
permissions -rw-r--r--
fixed all engine compilation hints and notes (that I could see)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  gxvopbd.c                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    TrueTypeGX/AAT opbd table validation (body).                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
/* gxvalid is derived from both gxlayout module and otvalid module.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
/* Development of gxlayout is supported by the Information-technology      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
/* Promotion Agency(IPA), Japan.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#include "gxvalid.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
#include "gxvcommn.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
  /* messages during execution.                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
#undef  FT_COMPONENT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
#define FT_COMPONENT  trace_gxvopbd
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
  /*****                      Data and Types                           *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  typedef struct  GXV_opbd_DataRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
    FT_UShort  format;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
    FT_UShort  valueOffset_min;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
  } GXV_opbd_DataRec, *GXV_opbd_Data;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
#define GXV_OPBD_DATA( FIELD )  GXV_TABLE_DATA( opbd, FIELD )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
  /*****                      UTILITY FUNCTIONS                        *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  gxv_opbd_LookupValue_validate( FT_UShort            glyph,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
                                 GXV_LookupValueCPtr  value_p,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
                                 GXV_Validator        valid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
    /* offset in LookupTable is measured from the head of opbd table */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
    FT_Bytes   p     = valid->root->base + value_p->u;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
    FT_Bytes   limit = valid->root->limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
    FT_Short   delta_value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
    int        i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
    if ( value_p->u < GXV_OPBD_DATA( valueOffset_min ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
      GXV_OPBD_DATA( valueOffset_min ) = value_p->u;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
    for ( i = 0; i < 4; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
      GXV_LIMIT_CHECK( 2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
      delta_value = FT_NEXT_SHORT( p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
      if ( GXV_OPBD_DATA( format ) )    /* format 1, value is ctrl pt. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
        if ( delta_value == -1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
          continue;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
        gxv_ctlPoint_validate( glyph, delta_value, valid );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
      else                              /* format 0, value is distance */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
        continue;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
  /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
    opbd ---------------------+
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
                              |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
    +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
    | lookup header |         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
    +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
    | BinSrchHeader |         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
    +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
    | lastGlyph[0]  |         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
    +---------------+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
    | firstGlyph[0] |         |  head of opbd sfnt table
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
    +---------------+         |             +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
    | offset[0]     |    ->   |          offset            [byte]
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
    +===============+         |             +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
    | lastGlyph[1]  |         | (glyphID - firstGlyph) * 4 * sizeof(FT_Short) [byte]
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
    +---------------+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
    | firstGlyph[1] |         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
    +---------------+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
    | offset[1]     |         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
    +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
                              |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
     ....                     |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
                              |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
    48bit value array         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
    +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
    |     value     | <-------+
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
    |               |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
    |               |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
    |               |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
    +---------------+
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
    .... */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
  static GXV_LookupValueDesc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
  gxv_opbd_LookupFmt4_transit( FT_UShort            relative_gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
                               GXV_LookupValueCPtr  base_value_p,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
                               FT_Bytes             lookuptbl_limit,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
                               GXV_Validator        valid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
    GXV_LookupValueDesc  value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
    FT_UNUSED( lookuptbl_limit );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
    FT_UNUSED( valid );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
    /* XXX: check range? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
    value.u = (FT_UShort)( base_value_p->u +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
                           relative_gindex * 4 * sizeof ( FT_Short ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
    return value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
  /*****                         opbd TABLE                            *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
  gxv_opbd_validate( FT_Bytes      table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
                     FT_Face       face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
                     FT_Validator  ftvalid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
    GXV_ValidatorRec  validrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
    GXV_Validator     valid = &validrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
    GXV_opbd_DataRec  opbdrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
    GXV_opbd_Data     opbd  = &opbdrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
    FT_Bytes          p     = table;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
    FT_Bytes          limit = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
    FT_ULong  version;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
    valid->root       = ftvalid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
    valid->table_data = opbd;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
    valid->face       = face;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
    FT_TRACE3(( "validating `opbd' table\n" ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
    GXV_INIT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
    GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
    GXV_LIMIT_CHECK( 4 + 2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
    version                 = FT_NEXT_ULONG( p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
    GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
    /* only 0x00010000 is defined (1996) */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
    GXV_TRACE(( "(version=0x%08x)\n", version ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
    if ( 0x00010000UL != version )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
      FT_INVALID_FORMAT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
    /* only values 0 and 1 are defined (1996) */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
    GXV_TRACE(( "(format=0x%04x)\n", GXV_OPBD_DATA( format ) ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
    if ( 0x0001 < GXV_OPBD_DATA( format ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
      FT_INVALID_FORMAT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
    valid->lookupval_func   = gxv_opbd_LookupValue_validate;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
    valid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
    gxv_LookupTable_validate( p, limit, valid );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
    p += valid->subtable_length;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
    if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
      GXV_TRACE((
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
        "found overlap between LookupTable and opbd_value array\n" ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
      FT_INVALID_OFFSET;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
    FT_TRACE4(( "\n" ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
/* END */