misc/libfreetype/src/gxvalid/gxvlcar.c
author nemo
Thu, 28 Feb 2013 23:15:33 -0500
changeset 8617 e7bea88096d2
parent 5172 88f2e05288ba
permissions -rw-r--r--
So. A while ago, while trying to prevent hogs blowtorching getting turned around, unc0rr altered the old range of blowtorch from 1/8th of 180° up or down, to a 4° gain in upwards and a -4° loss in downwards. He also made it so that starting tunnels could fail to erase sufficient terrain, trapping hogs. Here are a couple of workarounds to more closely approximate old behaviour (do some initial erasure, adjust min/max angles)
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
/*  gxvlcar.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 lcar 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_gxvlcar
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_lcar_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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
  } GXV_lcar_DataRec, *GXV_lcar_Data;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
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
#define GXV_LCAR_DATA( FIELD )  GXV_TABLE_DATA( lcar, FIELD )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
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
  /*****                      UTILITY FUNCTIONS                        *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
  /*****                                                               *****/
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
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  gxv_lcar_partial_validate( FT_UShort      partial,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
                             FT_UShort      glyph,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
                             GXV_Validator  valid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
    GXV_NAME_ENTER( "partial" );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
    if ( GXV_LCAR_DATA( format ) != 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
      goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
    gxv_ctlPoint_validate( glyph, partial, valid );
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
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
    GXV_EXIT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
  }
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
  gxv_lcar_LookupValue_validate( FT_UShort            glyph,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
                                 GXV_LookupValueCPtr  value_p,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
                                 GXV_Validator        valid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
    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
    90
    FT_Bytes   limit = valid->root->limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
    FT_UShort  count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
    FT_Short   partial;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
    FT_UShort  i;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
    GXV_NAME_ENTER( "element in lookupTable" );
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
    GXV_LIMIT_CHECK( 2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
    count = FT_NEXT_USHORT( p );
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
    GXV_LIMIT_CHECK( 2 * count );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
    for ( i = 0; i < count; i++ )
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
      partial = FT_NEXT_SHORT( p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
      gxv_lcar_partial_validate( partial, glyph, valid );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
    GXV_EXIT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
  }
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
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
    +------ lcar --------------------+
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
    |      +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
    |      | looup header  |         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
    |      +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
    |      | BinSrchHeader |         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
    |      +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
    |      | lastGlyph[0]  |         |
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
    |      | firstGlyph[0] |         |  head of lcar sfnt table
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
    |      | offset[0]     |    ->   |          offset            [byte]
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
    |      | lastGlyph[1]  |         | (glyphID - firstGlyph) * 2 [byte]
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
    |      | firstGlyph[1] |         |
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
    |      | offset[1]     |         |
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
    |       ....                     |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
    |                                |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
    |      16bit value array         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
    |      +===============+         |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
    +------|     value     | <-------+
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
    |
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
    |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
    |
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
    +---->  lcar values...handled by lcar callback function
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
  static GXV_LookupValueDesc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
  gxv_lcar_LookupFmt4_transit( FT_UShort            relative_gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
                               GXV_LookupValueCPtr  base_value_p,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
                               FT_Bytes             lookuptbl_limit,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
                               GXV_Validator        valid )
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
    FT_Bytes             p;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
    FT_Bytes             limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
    FT_UShort            offset;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
    GXV_LookupValueDesc  value;
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
    FT_UNUSED( lookuptbl_limit );
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
    /* XXX: check range? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
    offset = (FT_UShort)( base_value_p->u +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
                          relative_gindex * sizeof ( FT_UShort ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
    p      = valid->root->base + offset;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
    limit  = valid->root->limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
    GXV_LIMIT_CHECK ( 2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
    value.u = FT_NEXT_USHORT( p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
    return value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
  }
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
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
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
  /*****                          lcar TABLE                           *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
  /*****                                                               *****/
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
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
  gxv_lcar_validate( FT_Bytes      table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
                     FT_Face       face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
                     FT_Validator  ftvalid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
    FT_Bytes          p     = table;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
    FT_Bytes          limit = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
    GXV_ValidatorRec  validrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
    GXV_Validator     valid = &validrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
    GXV_lcar_DataRec  lcarrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
    GXV_lcar_Data     lcar = &lcarrec;
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
    FT_Fixed          version;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
    valid->root       = ftvalid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
    valid->table_data = lcar;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
    valid->face       = face;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
    FT_TRACE3(( "validating `lcar' table\n" ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
    GXV_INIT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
    GXV_LIMIT_CHECK( 4 + 2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
    version = FT_NEXT_ULONG( p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
    GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p );
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
    if ( version != 0x00010000UL)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
      FT_INVALID_FORMAT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
    if ( GXV_LCAR_DATA( format ) > 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
      FT_INVALID_FORMAT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
    valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
    valid->lookupval_func   = gxv_lcar_LookupValue_validate;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
    valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
    gxv_LookupTable_validate( p, limit, valid );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   219
    FT_TRACE4(( "\n" ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
/* END */