misc/libfreetype/src/truetype/ttinterp.c
author koda
Wed, 19 Dec 2012 18:17:23 +0100
changeset 8312 9e8781faabab
parent 5172 88f2e05288ba
permissions -rw-r--r--
can compile engine as library on linux but not run the executable (automatically), most likely breaking other platforms (wrt engine-as-library)
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
/*  ttinterp.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
/*    TrueType bytecode interpreter (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 1996-2011                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  by 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
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#include FT_INTERNAL_DEBUG_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#include FT_INTERNAL_CALC_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#include FT_TRIGONOMETRY_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#include FT_SYSTEM_H
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
#include "ttinterp.h"
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 "tterrors.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
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
#ifdef TT_USE_BYTECODE_INTERPRETER
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
#define TT_MULFIX           FT_MulFix
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
#define TT_MULDIV           FT_MulDiv
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
#define TT_MULDIV_NO_ROUND  FT_MulDiv_No_Round
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
  /*************************************************************************/
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
  /* 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
    41
  /* 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
    42
  /* messages during execution.                                            */
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
#undef  FT_COMPONENT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
#define FT_COMPONENT  trace_ttinterp
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
  /* In order to detect infinite loops in the code, we set up a counter    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  /* within the run loop.  A single stroke of interpretation is now        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
  /* limited to a maximal number of opcodes defined below.                 */
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
#define MAX_RUNNABLE_OPCODES  1000000L
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
  /*************************************************************************/
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
  /* There are two kinds of implementations:                               */
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
  /* a. static implementation                                              */
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
  /*    The current execution context is a static variable, which fields   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
  /*    are accessed directly by the interpreter during execution.  The    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
  /*    context is named `cur'.                                            */
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
  /*    This version is non-reentrant, of course.                          */
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
  /* b. indirect implementation                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
  /*    The current execution context is passed to _each_ function as its  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  /*    first argument, and each field is thus accessed indirectly.        */
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
  /*    This version is fully re-entrant.                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
  /* The idea is that an indirect implementation may be slower to execute  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
  /* on low-end processors that are used in some systems (like 386s or     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
  /* even 486s).                                                           */
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
  /* As a consequence, the indirect implementation is now the default, as  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
  /* its performance costs can be considered negligible in our context.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
  /* Note, however, that we kept the same source with macros because:      */
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
  /* - The code is kept very close in design to the Pascal code used for   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
  /*   development.                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
  /* - It's much more readable that way!                                   */
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
  /* - It's still open to experimentation and tuning.                      */
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
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
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
#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER     /* indirect implementation */
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
#define CUR  (*exc)                             /* see ttobjs.h */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
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
  /* This macro is used whenever `exec' is unused in a function, to avoid  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
  /* stupid warnings from pedantic compilers.                              */
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
#define FT_UNUSED_EXEC  FT_UNUSED( exc )
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
#else                                           /* static implementation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
#define CUR  cur
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
#define FT_UNUSED_EXEC  int  __dummy = __dummy
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
  static
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
  TT_ExecContextRec  cur;   /* static exec. context variable */
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
  /* apparently, we have a _lot_ of direct indexing when accessing  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
  /* the static `cur', which makes the code bigger (due to all the  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
  /* four bytes addresses).                                         */
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
#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */
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
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
  /* The instruction argument stack.                                       */
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
#define INS_ARG  EXEC_OP_ FT_Long*  args    /* see ttobjs.h for EXEC_OP_ */
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
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
  /* This macro is used whenever `args' is unused in a function, to avoid  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
  /* stupid warnings from pedantic compilers.                              */
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
#define FT_UNUSED_ARG  FT_UNUSED_EXEC; FT_UNUSED( args )
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
  /*************************************************************************/
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
  /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
  /* increase readability of the code.                                     */
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
#define SKIP_Code() \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
          SkipCode( EXEC_ARG )
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
#define GET_ShortIns() \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
          GetShortIns( EXEC_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
#define NORMalize( x, y, v ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
          Normalize( EXEC_ARG_ x, y, v )
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
#define SET_SuperRound( scale, flags ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
          SetSuperRound( EXEC_ARG_ scale, flags )
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
#define ROUND_None( d, c ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
          Round_None( EXEC_ARG_ d, c )
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
#define INS_Goto_CodeRange( range, ip ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
          Ins_Goto_CodeRange( EXEC_ARG_ range, ip )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
#define CUR_Func_move( z, p, d ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
          CUR.func_move( EXEC_ARG_ z, p, d )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
#define CUR_Func_move_orig( z, p, d ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
          CUR.func_move_orig( EXEC_ARG_ z, p, d )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
#define CUR_Func_round( d, c ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
          CUR.func_round( EXEC_ARG_ d, c )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
#define CUR_Func_read_cvt( index ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
          CUR.func_read_cvt( EXEC_ARG_ index )
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
#define CUR_Func_write_cvt( index, val ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
          CUR.func_write_cvt( EXEC_ARG_ index, val )
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
#define CUR_Func_move_cvt( index, val ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
          CUR.func_move_cvt( EXEC_ARG_ index, val )
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
#define CURRENT_Ratio() \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
          Current_Ratio( EXEC_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
#define CURRENT_Ppem() \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
          Current_Ppem( EXEC_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
#define CUR_Ppem() \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
          Cur_PPEM( EXEC_ARG )
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
#define INS_SxVTL( a, b, c, d ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
          Ins_SxVTL( EXEC_ARG_ a, b, c, d )
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
#define COMPUTE_Funcs() \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
          Compute_Funcs( EXEC_ARG )
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
#define COMPUTE_Round( a ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
          Compute_Round( EXEC_ARG_ a )
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
#define COMPUTE_Point_Displacement( a, b, c, d ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
          Compute_Point_Displacement( EXEC_ARG_ a, b, c, d )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
#define MOVE_Zp2_Point( a, b, c, t ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
          Move_Zp2_Point( EXEC_ARG_ a, b, c, t )
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
#define CUR_Func_project( v1, v2 )  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
          CUR.func_project( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
#define CUR_Func_dualproj( v1, v2 )  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
          CUR.func_dualproj( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
#define CUR_fast_project( v ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
          CUR.func_project( EXEC_ARG_ (v)->x, (v)->y )
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
#define CUR_fast_dualproj( v ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
          CUR.func_dualproj( EXEC_ARG_ (v)->x, (v)->y )
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
  /*************************************************************************/
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
  /* Instruction dispatch function, as used by the interpreter.            */
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
  typedef void  (*TInstruction_Function)( INS_ARG );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
  /* Two simple bounds-checking macros.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
#define BOUNDS( x, n )   ( (FT_UInt)(x)  >= (FT_UInt)(n)  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
#define BOUNDSL( x, n )  ( (FT_ULong)(x) >= (FT_ULong)(n) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
#undef  SUCCESS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
#define SUCCESS  0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
#undef  FAILURE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
#define FAILURE  1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
#define GUESS_VECTOR( V )                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
  if ( CUR.face->unpatented_hinting )                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
  {                                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
    CUR.GS.V.x = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0x4000 : 0 ); \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
    CUR.GS.V.y = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0 : 0x4000 ); \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
#define GUESS_VECTOR( V )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
  /*                        CODERANGE FUNCTIONS                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
  /*    TT_Goto_CodeRange                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
  /*    Switches to a new code range (updates the code related elements in */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
  /*    `exec', and `IP').                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
  /*    range :: The new execution code range.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
  /*    IP    :: The new IP in the new code range.                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
  /*    exec  :: The target execution context.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
  TT_Goto_CodeRange( TT_ExecContext  exec,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
                     FT_Int          range,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
                     FT_Long         IP )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
    TT_CodeRange*  coderange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   282
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   283
    FT_ASSERT( range >= 1 && range <= 3 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   284
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
    coderange = &exec->codeRangeTable[range - 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   287
    FT_ASSERT( coderange->base != NULL );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
    /* NOTE: Because the last instruction of a program may be a CALL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   290
    /*       which will return to the first byte *after* the code    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   291
    /*       range, we test for IP <= Size instead of IP < Size.     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
    /*                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   293
    FT_ASSERT( (FT_ULong)IP <= coderange->size );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   294
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   295
    exec->code     = coderange->base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
    exec->codeSize = coderange->size;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
    exec->IP       = IP;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
    exec->curRange = range;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   300
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   303
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   304
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   305
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   307
  /*    TT_Set_CodeRange                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   308
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
  /*    Sets a code range.                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   311
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   312
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
  /*    range  :: The code range index.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
  /*    base   :: The new code base.                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
  /*    length :: The range size in bytes.                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   318
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   319
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
  /*    exec   :: The target execution context.                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   324
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   325
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   326
  TT_Set_CodeRange( TT_ExecContext  exec,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
                    FT_Int          range,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
                    void*           base,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   329
                    FT_Long         length )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   330
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   331
    FT_ASSERT( range >= 1 && range <= 3 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   332
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   333
    exec->codeRangeTable[range - 1].base = (FT_Byte*)base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
    exec->codeRangeTable[range - 1].size = length;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   335
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   338
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   339
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
  /*    TT_Clear_CodeRange                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
  /*    Clears a code range.                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   349
  /*    range :: The code range index.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
  /*    exec  :: The target execution context.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
  /*    Does not set the Error variable.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
  TT_Clear_CodeRange( TT_ExecContext  exec,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
                      FT_Int          range )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
    FT_ASSERT( range >= 1 && range <= 3 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
    exec->codeRangeTable[range - 1].base = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
    exec->codeRangeTable[range - 1].size = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   373
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   374
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   375
  /*                   EXECUTION CONTEXT ROUTINES                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   376
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   381
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   382
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
  /*    TT_Done_Context                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   385
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
  /*    Destroys a given context.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
  /*    exec   :: A handle to the target execution context.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
  /*    memory :: A handle to the parent memory object.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
  /*    Only the glyph loader and debugger should call this function.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   399
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
  TT_Done_Context( TT_ExecContext  exec )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   402
    FT_Memory  memory = exec->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   403
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   404
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   405
    /* points zone */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
    exec->maxPoints   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   407
    exec->maxContours = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   408
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
    /* free stack */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
    FT_FREE( exec->stack );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   411
    exec->stackSize = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   412
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   413
    /* free call stack */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   414
    FT_FREE( exec->callStack );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   415
    exec->callSize = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   416
    exec->callTop  = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   417
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   418
    /* free glyph code range */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   419
    FT_FREE( exec->glyphIns );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   420
    exec->glyphSize = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   421
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   422
    exec->size = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   423
    exec->face = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   424
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   425
    FT_FREE( exec );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   426
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   427
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   428
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   429
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   430
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   431
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   432
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   433
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   434
  /*    Init_Context                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   435
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   436
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   437
  /*    Initializes a context object.                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   438
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   439
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   440
  /*    memory :: A handle to the parent memory object.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   441
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   442
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   443
  /*    exec   :: A handle to the target execution context.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   444
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   445
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   446
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   447
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   448
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   449
  Init_Context( TT_ExecContext  exec,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   450
                FT_Memory       memory )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   451
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   452
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   453
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   454
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   455
    FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   456
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   457
    exec->memory   = memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   458
    exec->callSize = 32;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   459
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   460
    if ( FT_NEW_ARRAY( exec->callStack, exec->callSize ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   461
      goto Fail_Memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   462
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   463
    /* all values in the context are set to 0 already, but this is */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   464
    /* here as a remainder                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   465
    exec->maxPoints   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   466
    exec->maxContours = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   467
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   468
    exec->stackSize = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   469
    exec->glyphSize = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   470
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   471
    exec->stack     = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   472
    exec->glyphIns  = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   473
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   474
    exec->face = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   475
    exec->size = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   476
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   477
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   478
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   479
  Fail_Memory:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   480
    FT_ERROR(( "Init_Context: not enough memory for %p\n", exec ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   481
    TT_Done_Context( exec );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   482
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   483
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   484
 }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   485
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   486
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   487
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   488
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   489
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   490
  /*    Update_Max                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   491
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   492
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   493
  /*    Checks the size of a buffer and reallocates it if necessary.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   494
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   495
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   496
  /*    memory     :: A handle to the parent memory object.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   497
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   498
  /*    multiplier :: The size in bytes of each element in the buffer.     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   499
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   500
  /*    new_max    :: The new capacity (size) of the buffer.               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   501
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   502
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   503
  /*    size       :: The address of the buffer's current size expressed   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   504
  /*                  in elements.                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   505
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   506
  /*    buff       :: The address of the buffer base pointer.              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   507
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   508
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   509
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   510
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   511
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   512
  Update_Max( FT_Memory  memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   513
              FT_ULong*  size,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   514
              FT_Long    multiplier,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   515
              void*      _pbuff,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   516
              FT_ULong   new_max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   517
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   518
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   519
    void**    pbuff = (void**)_pbuff;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   520
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   521
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   522
    if ( *size < new_max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   523
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   524
      if ( FT_REALLOC( *pbuff, *size * multiplier, new_max * multiplier ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   525
        return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   526
      *size = new_max;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   527
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   528
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   529
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   530
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   531
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   532
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   533
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   534
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   535
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   536
  /*    TT_Load_Context                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   537
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   538
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   539
  /*    Prepare an execution context for glyph hinting.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   540
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   541
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   542
  /*    face :: A handle to the source face object.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   543
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   544
  /*    size :: A handle to the source size object.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   545
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   546
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   547
  /*    exec :: A handle to the target execution context.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   548
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   549
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   550
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   551
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   552
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   553
  /*    Only the glyph loader and debugger should call this function.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   554
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   555
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   556
  TT_Load_Context( TT_ExecContext  exec,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   557
                   TT_Face         face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   558
                   TT_Size         size )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   559
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   560
    FT_Int          i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   561
    FT_ULong        tmp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   562
    TT_MaxProfile*  maxp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   563
    FT_Error        error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   564
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   565
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   566
    exec->face = face;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   567
    maxp       = &face->max_profile;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   568
    exec->size = size;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   569
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   570
    if ( size )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   571
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   572
      exec->numFDefs   = size->num_function_defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   573
      exec->maxFDefs   = size->max_function_defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   574
      exec->numIDefs   = size->num_instruction_defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   575
      exec->maxIDefs   = size->max_instruction_defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   576
      exec->FDefs      = size->function_defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   577
      exec->IDefs      = size->instruction_defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   578
      exec->tt_metrics = size->ttmetrics;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   579
      exec->metrics    = size->metrics;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   580
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   581
      exec->maxFunc    = size->max_func;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   582
      exec->maxIns     = size->max_ins;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   583
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   584
      for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   585
        exec->codeRangeTable[i] = size->codeRangeTable[i];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   586
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   587
      /* set graphics state */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   588
      exec->GS = size->GS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   589
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   590
      exec->cvtSize = size->cvt_size;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   591
      exec->cvt     = size->cvt;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   592
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   593
      exec->storeSize = size->storage_size;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   594
      exec->storage   = size->storage;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   595
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   596
      exec->twilight  = size->twilight;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   597
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   598
      /* In case of multi-threading it can happen that the old size object */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   599
      /* no longer exists, thus we must clear all glyph zone references.   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   600
      ft_memset( &exec->zp0, 0, sizeof ( exec->zp0 ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   601
      exec->zp1 = exec->zp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   602
      exec->zp2 = exec->zp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   603
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   604
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   605
    /* XXX: We reserve a little more elements on the stack to deal safely */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   606
    /*      with broken fonts like arialbs, courbs, timesbs, etc.         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   607
    tmp = exec->stackSize;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   608
    error = Update_Max( exec->memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   609
                        &tmp,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   610
                        sizeof ( FT_F26Dot6 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   611
                        (void*)&exec->stack,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   612
                        maxp->maxStackElements + 32 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   613
    exec->stackSize = (FT_UInt)tmp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   614
    if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   615
      return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   616
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   617
    tmp = exec->glyphSize;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   618
    error = Update_Max( exec->memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   619
                        &tmp,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   620
                        sizeof ( FT_Byte ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   621
                        (void*)&exec->glyphIns,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   622
                        maxp->maxSizeOfInstructions );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   623
    exec->glyphSize = (FT_UShort)tmp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   624
    if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   625
      return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   626
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   627
    exec->pts.n_points   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   628
    exec->pts.n_contours = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   629
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   630
    exec->zp1 = exec->pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   631
    exec->zp2 = exec->pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   632
    exec->zp0 = exec->pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   633
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   634
    exec->instruction_trap = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   635
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   636
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   637
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   638
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   639
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   640
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   641
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   642
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   643
  /*    TT_Save_Context                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   644
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   645
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   646
  /*    Saves the code ranges in a `size' object.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   647
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   648
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   649
  /*    exec :: A handle to the source execution context.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   650
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   651
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   652
  /*    size :: A handle to the target size object.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   653
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   654
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   655
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   656
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   657
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   658
  /*    Only the glyph loader and debugger should call this function.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   659
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   660
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   661
  TT_Save_Context( TT_ExecContext  exec,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   662
                   TT_Size         size )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   663
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   664
    FT_Int  i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   665
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   666
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   667
    /* XXXX: Will probably disappear soon with all the code range */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   668
    /*       management, which is now rather obsolete.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   669
    /*                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   670
    size->num_function_defs    = exec->numFDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   671
    size->num_instruction_defs = exec->numIDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   672
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   673
    size->max_func = exec->maxFunc;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   674
    size->max_ins  = exec->maxIns;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   675
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   676
    for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   677
      size->codeRangeTable[i] = exec->codeRangeTable[i];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   678
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   679
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   680
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   681
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   682
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   683
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   684
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   685
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   686
  /*    TT_Run_Context                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   687
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   688
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   689
  /*    Executes one or more instructions in the execution context.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   690
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   691
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   692
  /*    debug :: A Boolean flag.  If set, the function sets some internal  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   693
  /*             variables and returns immediately, otherwise TT_RunIns()  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   694
  /*             is called.                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   695
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   696
  /*             This is commented out currently.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   697
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   698
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   699
  /*    exec  :: A handle to the target execution context.                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   700
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   701
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   702
  /*    TrueType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   703
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   704
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   705
  /*    Only the glyph loader and debugger should call this function.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   706
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   707
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   708
  TT_Run_Context( TT_ExecContext  exec,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   709
                  FT_Bool         debug )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   710
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   711
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   712
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   713
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   714
    if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0  ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   715
           != TT_Err_Ok )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   716
      return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   717
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   718
    exec->zp0 = exec->pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   719
    exec->zp1 = exec->pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   720
    exec->zp2 = exec->pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   721
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   722
    exec->GS.gep0 = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   723
    exec->GS.gep1 = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   724
    exec->GS.gep2 = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   725
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   726
    exec->GS.projVector.x = 0x4000;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   727
    exec->GS.projVector.y = 0x0000;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   728
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   729
    exec->GS.freeVector = exec->GS.projVector;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   730
    exec->GS.dualVector = exec->GS.projVector;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   731
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   732
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   733
    exec->GS.both_x_axis = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   734
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   735
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   736
    exec->GS.round_state = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   737
    exec->GS.loop        = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   738
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   739
    /* some glyphs leave something on the stack. so we clean it */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   740
    /* before a new execution.                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   741
    exec->top     = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   742
    exec->callTop = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   743
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   744
#if 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   745
    FT_UNUSED( debug );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   746
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   747
    return exec->face->interpreter( exec );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   748
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   749
    if ( !debug )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   750
      return TT_RunIns( exec );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   751
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   752
      return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   753
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   754
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   755
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   756
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   757
  /* The default value for `scan_control' is documented as FALSE in the */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   758
  /* TrueType specification.  This is confusing since it implies a      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   759
  /* Boolean value.  However, this is not the case, thus both the       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   760
  /* default values of our `scan_type' and `scan_control' fields (which */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   761
  /* the documentation's `scan_control' variable is split into) are     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   762
  /* zero.                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   763
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   764
  const TT_GraphicsState  tt_default_graphics_state =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   765
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   766
    0, 0, 0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   767
    { 0x4000, 0 },
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   768
    { 0x4000, 0 },
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   769
    { 0x4000, 0 },
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   770
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   771
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   772
    TRUE,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   773
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   774
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   775
    1, 64, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   776
    TRUE, 68, 0, 0, 9, 3,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   777
    0, FALSE, 0, 1, 1, 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   778
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   779
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   780
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   781
  /* documentation is in ttinterp.h */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   782
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   783
  FT_EXPORT_DEF( TT_ExecContext )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   784
  TT_New_Context( TT_Driver  driver )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   785
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   786
    TT_ExecContext  exec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   787
    FT_Memory       memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   788
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   789
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   790
    memory = driver->root.root.memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   791
    exec   = driver->context;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   792
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   793
    if ( !driver->context )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   794
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   795
      FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   796
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   797
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   798
      /* allocate object */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   799
      if ( FT_NEW( exec ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   800
        goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   801
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   802
      /* initialize it; in case of error this deallocates `exec' too */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   803
      error = Init_Context( exec, memory );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   804
      if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   805
        goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   806
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   807
      /* store it into the driver */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   808
      driver->context = exec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   809
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   810
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   811
    return driver->context;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   812
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   813
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   814
    return NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   815
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   816
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   817
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   818
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   819
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   820
  /* Before an opcode is executed, the interpreter verifies that there are */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   821
  /* enough arguments on the stack, with the help of the `Pop_Push_Count'  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   822
  /* table.                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   823
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   824
  /* For each opcode, the first column gives the number of arguments that  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   825
  /* are popped from the stack; the second one gives the number of those   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   826
  /* that are pushed in result.                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   827
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   828
  /* Opcodes which have a varying number of parameters in the data stream  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   829
  /* (NPUSHB, NPUSHW) are handled specially; they have a negative value in */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   830
  /* the `opcode_length' table, and the value in `Pop_Push_Count' is set   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   831
  /* to zero.                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   832
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   833
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   834
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   835
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   836
#undef  PACK
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   837
#define PACK( x, y )  ( ( x << 4 ) | y )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   838
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   839
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   840
  static
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   841
  const FT_Byte  Pop_Push_Count[256] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   842
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   843
    /* opcodes are gathered in groups of 16 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   844
    /* please keep the spaces as they are   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   845
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   846
    /*  SVTCA  y  */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   847
    /*  SVTCA  x  */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   848
    /*  SPvTCA y  */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   849
    /*  SPvTCA x  */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   850
    /*  SFvTCA y  */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   851
    /*  SFvTCA x  */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   852
    /*  SPvTL //  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   853
    /*  SPvTL +   */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   854
    /*  SFvTL //  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   855
    /*  SFvTL +   */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   856
    /*  SPvFS     */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   857
    /*  SFvFS     */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   858
    /*  GPV       */  PACK( 0, 2 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   859
    /*  GFV       */  PACK( 0, 2 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   860
    /*  SFvTPv    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   861
    /*  ISECT     */  PACK( 5, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   862
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   863
    /*  SRP0      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   864
    /*  SRP1      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   865
    /*  SRP2      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   866
    /*  SZP0      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   867
    /*  SZP1      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   868
    /*  SZP2      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   869
    /*  SZPS      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   870
    /*  SLOOP     */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   871
    /*  RTG       */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   872
    /*  RTHG      */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   873
    /*  SMD       */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   874
    /*  ELSE      */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   875
    /*  JMPR      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   876
    /*  SCvTCi    */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   877
    /*  SSwCi     */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   878
    /*  SSW       */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   879
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   880
    /*  DUP       */  PACK( 1, 2 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   881
    /*  POP       */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   882
    /*  CLEAR     */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   883
    /*  SWAP      */  PACK( 2, 2 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   884
    /*  DEPTH     */  PACK( 0, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   885
    /*  CINDEX    */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   886
    /*  MINDEX    */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   887
    /*  AlignPTS  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   888
    /*  INS_$28   */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   889
    /*  UTP       */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   890
    /*  LOOPCALL  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   891
    /*  CALL      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   892
    /*  FDEF      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   893
    /*  ENDF      */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   894
    /*  MDAP[0]   */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   895
    /*  MDAP[1]   */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   896
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   897
    /*  IUP[0]    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   898
    /*  IUP[1]    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   899
    /*  SHP[0]    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   900
    /*  SHP[1]    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   901
    /*  SHC[0]    */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   902
    /*  SHC[1]    */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   903
    /*  SHZ[0]    */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   904
    /*  SHZ[1]    */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   905
    /*  SHPIX     */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   906
    /*  IP        */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   907
    /*  MSIRP[0]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   908
    /*  MSIRP[1]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   909
    /*  AlignRP   */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   910
    /*  RTDG      */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   911
    /*  MIAP[0]   */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   912
    /*  MIAP[1]   */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   913
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   914
    /*  NPushB    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   915
    /*  NPushW    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   916
    /*  WS        */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   917
    /*  RS        */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   918
    /*  WCvtP     */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   919
    /*  RCvt      */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   920
    /*  GC[0]     */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   921
    /*  GC[1]     */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   922
    /*  SCFS      */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   923
    /*  MD[0]     */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   924
    /*  MD[1]     */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   925
    /*  MPPEM     */  PACK( 0, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   926
    /*  MPS       */  PACK( 0, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   927
    /*  FlipON    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   928
    /*  FlipOFF   */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   929
    /*  DEBUG     */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   930
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   931
    /*  LT        */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   932
    /*  LTEQ      */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   933
    /*  GT        */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   934
    /*  GTEQ      */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   935
    /*  EQ        */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   936
    /*  NEQ       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   937
    /*  ODD       */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   938
    /*  EVEN      */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   939
    /*  IF        */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   940
    /*  EIF       */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   941
    /*  AND       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   942
    /*  OR        */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   943
    /*  NOT       */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   944
    /*  DeltaP1   */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   945
    /*  SDB       */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   946
    /*  SDS       */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   947
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   948
    /*  ADD       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   949
    /*  SUB       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   950
    /*  DIV       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   951
    /*  MUL       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   952
    /*  ABS       */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   953
    /*  NEG       */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   954
    /*  FLOOR     */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   955
    /*  CEILING   */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   956
    /*  ROUND[0]  */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   957
    /*  ROUND[1]  */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   958
    /*  ROUND[2]  */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   959
    /*  ROUND[3]  */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   960
    /*  NROUND[0] */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   961
    /*  NROUND[1] */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   962
    /*  NROUND[2] */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   963
    /*  NROUND[3] */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   964
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   965
    /*  WCvtF     */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   966
    /*  DeltaP2   */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   967
    /*  DeltaP3   */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   968
    /*  DeltaCn[0] */ PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   969
    /*  DeltaCn[1] */ PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   970
    /*  DeltaCn[2] */ PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   971
    /*  SROUND    */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   972
    /*  S45Round  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   973
    /*  JROT      */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   974
    /*  JROF      */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   975
    /*  ROFF      */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   976
    /*  INS_$7B   */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   977
    /*  RUTG      */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   978
    /*  RDTG      */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   979
    /*  SANGW     */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   980
    /*  AA        */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   981
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   982
    /*  FlipPT    */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   983
    /*  FlipRgON  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   984
    /*  FlipRgOFF */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   985
    /*  INS_$83   */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   986
    /*  INS_$84   */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   987
    /*  ScanCTRL  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   988
    /*  SDPVTL[0] */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   989
    /*  SDPVTL[1] */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   990
    /*  GetINFO   */  PACK( 1, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   991
    /*  IDEF      */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   992
    /*  ROLL      */  PACK( 3, 3 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   993
    /*  MAX       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   994
    /*  MIN       */  PACK( 2, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   995
    /*  ScanTYPE  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   996
    /*  InstCTRL  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   997
    /*  INS_$8F   */  PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   998
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   999
    /*  INS_$90  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1000
    /*  INS_$91  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1001
    /*  INS_$92  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1002
    /*  INS_$93  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1003
    /*  INS_$94  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1004
    /*  INS_$95  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1005
    /*  INS_$96  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1006
    /*  INS_$97  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1007
    /*  INS_$98  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1008
    /*  INS_$99  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1009
    /*  INS_$9A  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1010
    /*  INS_$9B  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1011
    /*  INS_$9C  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1012
    /*  INS_$9D  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1013
    /*  INS_$9E  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1014
    /*  INS_$9F  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1015
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1016
    /*  INS_$A0  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1017
    /*  INS_$A1  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1018
    /*  INS_$A2  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1019
    /*  INS_$A3  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1020
    /*  INS_$A4  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1021
    /*  INS_$A5  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1022
    /*  INS_$A6  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1023
    /*  INS_$A7  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1024
    /*  INS_$A8  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1025
    /*  INS_$A9  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1026
    /*  INS_$AA  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1027
    /*  INS_$AB  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1028
    /*  INS_$AC  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1029
    /*  INS_$AD  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1030
    /*  INS_$AE  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1031
    /*  INS_$AF  */   PACK( 0, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1032
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1033
    /*  PushB[0]  */  PACK( 0, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1034
    /*  PushB[1]  */  PACK( 0, 2 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1035
    /*  PushB[2]  */  PACK( 0, 3 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1036
    /*  PushB[3]  */  PACK( 0, 4 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1037
    /*  PushB[4]  */  PACK( 0, 5 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1038
    /*  PushB[5]  */  PACK( 0, 6 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1039
    /*  PushB[6]  */  PACK( 0, 7 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1040
    /*  PushB[7]  */  PACK( 0, 8 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1041
    /*  PushW[0]  */  PACK( 0, 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1042
    /*  PushW[1]  */  PACK( 0, 2 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1043
    /*  PushW[2]  */  PACK( 0, 3 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1044
    /*  PushW[3]  */  PACK( 0, 4 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1045
    /*  PushW[4]  */  PACK( 0, 5 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1046
    /*  PushW[5]  */  PACK( 0, 6 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1047
    /*  PushW[6]  */  PACK( 0, 7 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1048
    /*  PushW[7]  */  PACK( 0, 8 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1049
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1050
    /*  MDRP[00]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1051
    /*  MDRP[01]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1052
    /*  MDRP[02]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1053
    /*  MDRP[03]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1054
    /*  MDRP[04]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1055
    /*  MDRP[05]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1056
    /*  MDRP[06]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1057
    /*  MDRP[07]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1058
    /*  MDRP[08]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1059
    /*  MDRP[09]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1060
    /*  MDRP[10]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1061
    /*  MDRP[11]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1062
    /*  MDRP[12]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1063
    /*  MDRP[13]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1064
    /*  MDRP[14]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1065
    /*  MDRP[15]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1066
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1067
    /*  MDRP[16]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1068
    /*  MDRP[17]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1069
    /*  MDRP[18]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1070
    /*  MDRP[19]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1071
    /*  MDRP[20]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1072
    /*  MDRP[21]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1073
    /*  MDRP[22]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1074
    /*  MDRP[23]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1075
    /*  MDRP[24]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1076
    /*  MDRP[25]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1077
    /*  MDRP[26]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1078
    /*  MDRP[27]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1079
    /*  MDRP[28]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1080
    /*  MDRP[29]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1081
    /*  MDRP[30]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1082
    /*  MDRP[31]  */  PACK( 1, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1083
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1084
    /*  MIRP[00]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1085
    /*  MIRP[01]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1086
    /*  MIRP[02]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1087
    /*  MIRP[03]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1088
    /*  MIRP[04]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1089
    /*  MIRP[05]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1090
    /*  MIRP[06]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1091
    /*  MIRP[07]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1092
    /*  MIRP[08]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1093
    /*  MIRP[09]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1094
    /*  MIRP[10]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1095
    /*  MIRP[11]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1096
    /*  MIRP[12]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1097
    /*  MIRP[13]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1098
    /*  MIRP[14]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1099
    /*  MIRP[15]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1100
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1101
    /*  MIRP[16]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1102
    /*  MIRP[17]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1103
    /*  MIRP[18]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1104
    /*  MIRP[19]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1105
    /*  MIRP[20]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1106
    /*  MIRP[21]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1107
    /*  MIRP[22]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1108
    /*  MIRP[23]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1109
    /*  MIRP[24]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1110
    /*  MIRP[25]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1111
    /*  MIRP[26]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1112
    /*  MIRP[27]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1113
    /*  MIRP[28]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1114
    /*  MIRP[29]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1115
    /*  MIRP[30]  */  PACK( 2, 0 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1116
    /*  MIRP[31]  */  PACK( 2, 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1117
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1119
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1120
#ifdef FT_DEBUG_LEVEL_TRACE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1121
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1122
  static
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1123
  const char*  const opcode_name[256] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1124
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1125
    "SVTCA y",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1126
    "SVTCA x",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1127
    "SPvTCA y",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1128
    "SPvTCA x",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1129
    "SFvTCA y",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1130
    "SFvTCA x",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1131
    "SPvTL ||",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1132
    "SPvTL +",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1133
    "SFvTL ||",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1134
    "SFvTL +",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1135
    "SPvFS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1136
    "SFvFS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1137
    "GPV",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1138
    "GFV",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1139
    "SFvTPv",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1140
    "ISECT",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1141
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1142
    "SRP0",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1143
    "SRP1",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1144
    "SRP2",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1145
    "SZP0",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1146
    "SZP1",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1147
    "SZP2",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1148
    "SZPS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1149
    "SLOOP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1150
    "RTG",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1151
    "RTHG",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1152
    "SMD",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1153
    "ELSE",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1154
    "JMPR",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1155
    "SCvTCi",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1156
    "SSwCi",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1157
    "SSW",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1158
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1159
    "DUP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1160
    "POP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1161
    "CLEAR",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1162
    "SWAP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1163
    "DEPTH",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1164
    "CINDEX",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1165
    "MINDEX",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1166
    "AlignPTS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1167
    "INS_$28",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1168
    "UTP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1169
    "LOOPCALL",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1170
    "CALL",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1171
    "FDEF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1172
    "ENDF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1173
    "MDAP[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1174
    "MDAP[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1175
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1176
    "IUP[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1177
    "IUP[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1178
    "SHP[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1179
    "SHP[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1180
    "SHC[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1181
    "SHC[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1182
    "SHZ[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1183
    "SHZ[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1184
    "SHPIX",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1185
    "IP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1186
    "MSIRP[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1187
    "MSIRP[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1188
    "AlignRP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1189
    "RTDG",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1190
    "MIAP[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1191
    "MIAP[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1192
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1193
    "NPushB",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1194
    "NPushW",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1195
    "WS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1196
    "RS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1197
    "WCvtP",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1198
    "RCvt",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1199
    "GC[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1200
    "GC[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1201
    "SCFS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1202
    "MD[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1203
    "MD[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1204
    "MPPEM",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1205
    "MPS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1206
    "FlipON",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1207
    "FlipOFF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1208
    "DEBUG",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1209
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1210
    "LT",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1211
    "LTEQ",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1212
    "GT",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1213
    "GTEQ",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1214
    "EQ",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1215
    "NEQ",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1216
    "ODD",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1217
    "EVEN",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1218
    "IF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1219
    "EIF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1220
    "AND",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1221
    "OR",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1222
    "NOT",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1223
    "DeltaP1",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1224
    "SDB",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1225
    "SDS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1226
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1227
    "ADD",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1228
    "SUB",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1229
    "DIV",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1230
    "MUL",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1231
    "ABS",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1232
    "NEG",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1233
    "FLOOR",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1234
    "CEILING",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1235
    "ROUND[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1236
    "ROUND[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1237
    "ROUND[2]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1238
    "ROUND[3]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1239
    "NROUND[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1240
    "NROUND[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1241
    "NROUND[2]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1242
    "NROUND[3]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1243
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1244
    "WCvtF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1245
    "DeltaP2",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1246
    "DeltaP3",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1247
    "DeltaCn[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1248
    "DeltaCn[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1249
    "DeltaCn[2]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1250
    "SROUND",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1251
    "S45Round",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1252
    "JROT",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1253
    "JROF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1254
    "ROFF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1255
    "INS_$7B",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1256
    "RUTG",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1257
    "RDTG",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1258
    "SANGW",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1259
    "AA",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1260
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1261
    "FlipPT",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1262
    "FlipRgON",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1263
    "FlipRgOFF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1264
    "INS_$83",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1265
    "INS_$84",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1266
    "ScanCTRL",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1267
    "SDVPTL[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1268
    "SDVPTL[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1269
    "GetINFO",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1270
    "IDEF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1271
    "ROLL",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1272
    "MAX",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1273
    "MIN",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1274
    "ScanTYPE",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1275
    "InstCTRL",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1276
    "INS_$8F",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1277
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1278
    "INS_$90",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1279
    "INS_$91",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1280
    "INS_$92",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1281
    "INS_$93",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1282
    "INS_$94",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1283
    "INS_$95",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1284
    "INS_$96",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1285
    "INS_$97",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1286
    "INS_$98",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1287
    "INS_$99",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1288
    "INS_$9A",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1289
    "INS_$9B",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1290
    "INS_$9C",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1291
    "INS_$9D",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1292
    "INS_$9E",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1293
    "INS_$9F",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1294
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1295
    "INS_$A0",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1296
    "INS_$A1",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1297
    "INS_$A2",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1298
    "INS_$A3",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1299
    "INS_$A4",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1300
    "INS_$A5",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1301
    "INS_$A6",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1302
    "INS_$A7",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1303
    "INS_$A8",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1304
    "INS_$A9",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1305
    "INS_$AA",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1306
    "INS_$AB",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1307
    "INS_$AC",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1308
    "INS_$AD",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1309
    "INS_$AE",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1310
    "INS_$AF",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1311
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1312
    "PushB[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1313
    "PushB[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1314
    "PushB[2]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1315
    "PushB[3]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1316
    "PushB[4]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1317
    "PushB[5]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1318
    "PushB[6]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1319
    "PushB[7]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1320
    "PushW[0]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1321
    "PushW[1]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1322
    "PushW[2]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1323
    "PushW[3]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1324
    "PushW[4]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1325
    "PushW[5]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1326
    "PushW[6]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1327
    "PushW[7]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1328
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1329
    "MDRP[00]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1330
    "MDRP[01]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1331
    "MDRP[02]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1332
    "MDRP[03]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1333
    "MDRP[04]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1334
    "MDRP[05]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1335
    "MDRP[06]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1336
    "MDRP[07]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1337
    "MDRP[08]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1338
    "MDRP[09]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1339
    "MDRP[10]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1340
    "MDRP[11]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1341
    "MDRP[12]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1342
    "MDRP[13]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1343
    "MDRP[14]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1344
    "MDRP[15]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1345
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1346
    "MDRP[16]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1347
    "MDRP[17]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1348
    "MDRP[18]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1349
    "MDRP[19]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1350
    "MDRP[20]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1351
    "MDRP[21]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1352
    "MDRP[22]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1353
    "MDRP[23]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1354
    "MDRP[24]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1355
    "MDRP[25]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1356
    "MDRP[26]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1357
    "MDRP[27]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1358
    "MDRP[28]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1359
    "MDRP[29]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1360
    "MDRP[30]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1361
    "MDRP[31]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1362
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1363
    "MIRP[00]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1364
    "MIRP[01]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1365
    "MIRP[02]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1366
    "MIRP[03]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1367
    "MIRP[04]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1368
    "MIRP[05]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1369
    "MIRP[06]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1370
    "MIRP[07]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1371
    "MIRP[08]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1372
    "MIRP[09]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1373
    "MIRP[10]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1374
    "MIRP[11]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1375
    "MIRP[12]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1376
    "MIRP[13]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1377
    "MIRP[14]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1378
    "MIRP[15]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1379
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1380
    "MIRP[16]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1381
    "MIRP[17]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1382
    "MIRP[18]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1383
    "MIRP[19]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1384
    "MIRP[20]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1385
    "MIRP[21]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1386
    "MIRP[22]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1387
    "MIRP[23]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1388
    "MIRP[24]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1389
    "MIRP[25]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1390
    "MIRP[26]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1391
    "MIRP[27]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1392
    "MIRP[28]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1393
    "MIRP[29]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1394
    "MIRP[30]",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1395
    "MIRP[31]"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1396
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1397
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1398
#endif /* FT_DEBUG_LEVEL_TRACE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1399
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1400
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1401
  static
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1402
  const FT_Char  opcode_length[256] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1403
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1404
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1405
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1406
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1407
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1408
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1409
   -1,-2, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1410
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1411
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1412
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1413
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1414
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1415
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1416
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1417
    2, 3, 4, 5,  6, 7, 8, 9,  3, 5, 7, 9, 11,13,15,17,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1418
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1419
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1420
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1421
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1422
    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1423
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1424
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1425
#undef PACK
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1426
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1427
#if 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1428
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1429
  static FT_Int32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1430
  TT_MulFix14( FT_Int32  a,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1431
               FT_Int    b )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1432
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1433
    FT_Int32   sign;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1434
    FT_UInt32  ah, al, mid, lo, hi;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1435
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1436
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1437
    sign = a ^ b;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1438
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1439
    if ( a < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1440
      a = -a;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1441
    if ( b < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1442
      b = -b;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1443
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1444
    ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1445
    al = (FT_UInt32)( a & 0xFFFFU );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1446
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1447
    lo    = al * b;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1448
    mid   = ah * b;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1449
    hi    = mid >> 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1450
    mid   = ( mid << 16 ) + ( 1 << 13 ); /* rounding */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1451
    lo   += mid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1452
    if ( lo < mid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1453
      hi += 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1454
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1455
    mid = ( lo >> 14 ) | ( hi << 18 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1456
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1457
    return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1458
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1459
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1460
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1461
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1462
  /* compute (a*b)/2^14 with maximal accuracy and rounding */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1463
  static FT_Int32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1464
  TT_MulFix14( FT_Int32  a,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1465
               FT_Int    b )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1466
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1467
    FT_Int32   m, s, hi;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1468
    FT_UInt32  l, lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1469
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1470
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1471
    /* compute ax*bx as 64-bit value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1472
    l  = (FT_UInt32)( ( a & 0xFFFFU ) * b );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1473
    m  = ( a >> 16 ) * b;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1474
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1475
    lo = l + (FT_UInt32)( m << 16 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1476
    hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1477
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1478
    /* divide the result by 2^14 with rounding */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1479
    s   = hi >> 31;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1480
    l   = lo + (FT_UInt32)s;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1481
    hi += s + ( l < lo );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1482
    lo  = l;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1483
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1484
    l   = lo + 0x2000U;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1485
    hi += l < lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1486
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1487
    return ( hi << 18 ) | ( l >> 14 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1488
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1489
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1490
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1491
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1492
  /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1493
  static FT_Int32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1494
  TT_DotFix14( FT_Int32  ax,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1495
               FT_Int32  ay,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1496
               FT_Int    bx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1497
               FT_Int    by )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1498
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1499
    FT_Int32   m, s, hi1, hi2, hi;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1500
    FT_UInt32  l, lo1, lo2, lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1501
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1502
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1503
    /* compute ax*bx as 64-bit value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1504
    l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1505
    m = ( ax >> 16 ) * bx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1506
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1507
    lo1 = l + (FT_UInt32)( m << 16 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1508
    hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1509
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1510
    /* compute ay*by as 64-bit value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1511
    l = (FT_UInt32)( ( ay & 0xFFFFU ) * by );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1512
    m = ( ay >> 16 ) * by;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1513
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1514
    lo2 = l + (FT_UInt32)( m << 16 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1515
    hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1516
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1517
    /* add them */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1518
    lo = lo1 + lo2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1519
    hi = hi1 + hi2 + ( lo < lo1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1520
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1521
    /* divide the result by 2^14 with rounding */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1522
    s   = hi >> 31;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1523
    l   = lo + (FT_UInt32)s;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1524
    hi += s + ( l < lo );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1525
    lo  = l;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1526
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1527
    l   = lo + 0x2000U;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1528
    hi += ( l < lo );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1529
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1530
    return ( hi << 18 ) | ( l >> 14 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1531
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1532
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1533
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1534
  /* return length of given vector */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1535
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1536
#if 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1537
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1538
  static FT_Int32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1539
  TT_VecLen( FT_Int32  x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1540
             FT_Int32  y )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1541
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1542
    FT_Int32   m, hi1, hi2, hi;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1543
    FT_UInt32  l, lo1, lo2, lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1544
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1545
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1546
    /* compute x*x as 64-bit value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1547
    lo = (FT_UInt32)( x & 0xFFFFU );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1548
    hi = x >> 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1549
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1550
    l  = lo * lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1551
    m  = hi * lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1552
    hi = hi * hi;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1553
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1554
    lo1 = l + (FT_UInt32)( m << 17 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1555
    hi1 = hi + ( m >> 15 ) + ( lo1 < l );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1556
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1557
    /* compute y*y as 64-bit value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1558
    lo = (FT_UInt32)( y & 0xFFFFU );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1559
    hi = y >> 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1560
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1561
    l  = lo * lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1562
    m  = hi * lo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1563
    hi = hi * hi;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1564
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1565
    lo2 = l + (FT_UInt32)( m << 17 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1566
    hi2 = hi + ( m >> 15 ) + ( lo2 < l );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1567
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1568
    /* add them to get 'x*x+y*y' as 64-bit value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1569
    lo = lo1 + lo2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1570
    hi = hi1 + hi2 + ( lo < lo1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1571
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1572
    /* compute the square root of this value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1573
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1574
      FT_UInt32  root, rem, test_div;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1575
      FT_Int     count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1576
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1577
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1578
      root = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1579
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1580
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1581
        rem   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1582
        count = 32;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1583
        do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1584
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1585
          rem      = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1586
          hi       = (  hi << 2 ) | (            lo >> 30 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1587
          lo     <<= 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1588
          root   <<= 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1589
          test_div = ( root << 1 ) + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1590
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1591
          if ( rem >= test_div )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1592
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1593
            rem  -= test_div;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1594
            root += 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1595
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1596
        } while ( --count );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1597
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1598
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1599
      return (FT_Int32)root;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1600
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1601
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1602
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1603
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1604
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1605
  /* this version uses FT_Vector_Length which computes the same value */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1606
  /* much, much faster..                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1607
  /*                                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1608
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1609
  TT_VecLen( FT_F26Dot6  X,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1610
             FT_F26Dot6  Y )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1611
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1612
    FT_Vector  v;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1613
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1614
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1615
    v.x = X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1616
    v.y = Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1617
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1618
    return FT_Vector_Length( &v );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1619
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1620
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1621
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1622
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1623
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1624
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1625
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1626
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1627
  /*    Current_Ratio                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1628
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1629
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1630
  /*    Returns the current aspect ratio scaling factor depending on the   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1631
  /*    projection vector's state and device resolutions.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1632
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1633
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1634
  /*    The aspect ratio in 16.16 format, always <= 1.0 .                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1635
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1636
  static FT_Long
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1637
  Current_Ratio( EXEC_OP )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1638
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1639
    if ( !CUR.tt_metrics.ratio )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1640
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1641
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1642
      if ( CUR.face->unpatented_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1643
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1644
        if ( CUR.GS.both_x_axis )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1645
          CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1646
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1647
          CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1648
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1649
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1650
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1651
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1652
        if ( CUR.GS.projVector.y == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1653
          CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1654
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1655
        else if ( CUR.GS.projVector.x == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1656
          CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1657
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1658
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1659
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1660
          FT_Long  x, y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1661
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1662
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1663
          x = TT_MULDIV( CUR.GS.projVector.x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1664
                         CUR.tt_metrics.x_ratio, 0x4000 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1665
          y = TT_MULDIV( CUR.GS.projVector.y,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1666
                         CUR.tt_metrics.y_ratio, 0x4000 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1667
          CUR.tt_metrics.ratio = TT_VecLen( x, y );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1668
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1669
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1670
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1671
    return CUR.tt_metrics.ratio;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1672
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1673
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1674
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1675
  static FT_Long
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1676
  Current_Ppem( EXEC_OP )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1677
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1678
    return TT_MULFIX( CUR.tt_metrics.ppem, CURRENT_Ratio() );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1679
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1680
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1681
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1682
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1683
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1684
  /* Functions related to the control value table (CVT).                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1685
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1686
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1687
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1688
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1689
  FT_CALLBACK_DEF( FT_F26Dot6 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1690
  Read_CVT( EXEC_OP_ FT_ULong  idx )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1691
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1692
    return CUR.cvt[idx];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1693
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1694
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1695
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1696
  FT_CALLBACK_DEF( FT_F26Dot6 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1697
  Read_CVT_Stretched( EXEC_OP_ FT_ULong  idx )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1698
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1699
    return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1700
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1701
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1702
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1703
  FT_CALLBACK_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1704
  Write_CVT( EXEC_OP_ FT_ULong    idx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1705
                      FT_F26Dot6  value )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1706
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1707
    CUR.cvt[idx] = value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1708
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1709
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1710
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1711
  FT_CALLBACK_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1712
  Write_CVT_Stretched( EXEC_OP_ FT_ULong    idx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1713
                                FT_F26Dot6  value )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1714
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1715
    CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1716
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1717
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1718
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1719
  FT_CALLBACK_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1720
  Move_CVT( EXEC_OP_ FT_ULong    idx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1721
                     FT_F26Dot6  value )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1722
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1723
    CUR.cvt[idx] += value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1724
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1725
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1726
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1727
  FT_CALLBACK_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1728
  Move_CVT_Stretched( EXEC_OP_ FT_ULong    idx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1729
                               FT_F26Dot6  value )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1730
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1731
    CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1732
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1733
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1734
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1735
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1736
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1737
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1738
  /*    GetShortIns                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1739
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1740
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1741
  /*    Returns a short integer taken from the instruction stream at       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1742
  /*    address IP.                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1743
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1744
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1745
  /*    Short read at code[IP].                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1746
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1747
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1748
  /*    This one could become a macro.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1749
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1750
  static FT_Short
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1751
  GetShortIns( EXEC_OP )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1752
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1753
    /* Reading a byte stream so there is no endianess (DaveP) */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1754
    CUR.IP += 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1755
    return (FT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1756
                         CUR.code[CUR.IP - 1]      );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1757
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1758
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1759
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1760
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1761
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1762
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1763
  /*    Ins_Goto_CodeRange                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1764
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1765
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1766
  /*    Goes to a certain code range in the instruction stream.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1767
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1768
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1769
  /*    aRange :: The index of the code range.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1770
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1771
  /*    aIP    :: The new IP address in the code range.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1772
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1773
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1774
  /*    SUCCESS or FAILURE.                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1775
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1776
  static FT_Bool
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1777
  Ins_Goto_CodeRange( EXEC_OP_ FT_Int    aRange,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1778
                               FT_ULong  aIP )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1779
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1780
    TT_CodeRange*  range;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1781
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1782
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1783
    if ( aRange < 1 || aRange > 3 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1784
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1785
      CUR.error = TT_Err_Bad_Argument;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1786
      return FAILURE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1787
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1788
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1789
    range = &CUR.codeRangeTable[aRange - 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1790
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1791
    if ( range->base == NULL )     /* invalid coderange */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1792
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1793
      CUR.error = TT_Err_Invalid_CodeRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1794
      return FAILURE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1795
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1796
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1797
    /* NOTE: Because the last instruction of a program may be a CALL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1798
    /*       which will return to the first byte *after* the code    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1799
    /*       range, we test for AIP <= Size, instead of AIP < Size.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1800
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1801
    if ( aIP > range->size )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1802
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1803
      CUR.error = TT_Err_Code_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1804
      return FAILURE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1805
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1806
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1807
    CUR.code     = range->base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1808
    CUR.codeSize = range->size;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1809
    CUR.IP       = aIP;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1810
    CUR.curRange = aRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1811
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1812
    return SUCCESS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1813
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1814
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1815
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1816
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1817
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1818
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1819
  /*    Direct_Move                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1820
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1821
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1822
  /*    Moves a point by a given distance along the freedom vector.  The   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1823
  /*    point will be `touched'.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1824
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1825
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1826
  /*    point    :: The index of the point to move.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1827
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1828
  /*    distance :: The distance to apply.                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1829
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1830
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1831
  /*    zone     :: The affected glyph zone.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1832
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1833
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1834
  Direct_Move( EXEC_OP_ TT_GlyphZone  zone,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1835
                        FT_UShort     point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1836
                        FT_F26Dot6    distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1837
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1838
    FT_F26Dot6  v;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1839
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1840
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1841
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1842
    FT_ASSERT( !CUR.face->unpatented_hinting );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1843
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1844
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1845
    v = CUR.GS.freeVector.x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1846
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1847
    if ( v != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1848
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1849
      zone->cur[point].x += TT_MULDIV( distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1850
                                       v * 0x10000L,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1851
                                       CUR.F_dot_P );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1852
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1853
      zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1854
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1855
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1856
    v = CUR.GS.freeVector.y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1857
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1858
    if ( v != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1859
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1860
      zone->cur[point].y += TT_MULDIV( distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1861
                                       v * 0x10000L,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1862
                                       CUR.F_dot_P );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1863
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1864
      zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1865
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1866
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1867
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1868
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1869
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1870
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1871
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1872
  /*    Direct_Move_Orig                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1873
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1874
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1875
  /*    Moves the *original* position of a point by a given distance along */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1876
  /*    the freedom vector.  Obviously, the point will not be `touched'.   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1877
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1878
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1879
  /*    point    :: The index of the point to move.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1880
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1881
  /*    distance :: The distance to apply.                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1882
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1883
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1884
  /*    zone     :: The affected glyph zone.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1885
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1886
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1887
  Direct_Move_Orig( EXEC_OP_ TT_GlyphZone  zone,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1888
                             FT_UShort     point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1889
                             FT_F26Dot6    distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1890
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1891
    FT_F26Dot6  v;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1892
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1893
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1894
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1895
    FT_ASSERT( !CUR.face->unpatented_hinting );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1896
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1897
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1898
    v = CUR.GS.freeVector.x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1899
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1900
    if ( v != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1901
      zone->org[point].x += TT_MULDIV( distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1902
                                       v * 0x10000L,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1903
                                       CUR.F_dot_P );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1904
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1905
    v = CUR.GS.freeVector.y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1906
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1907
    if ( v != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1908
      zone->org[point].y += TT_MULDIV( distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1909
                                       v * 0x10000L,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1910
                                       CUR.F_dot_P );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1911
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1912
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1913
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1914
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1915
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1916
  /* Special versions of Direct_Move()                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1917
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1918
  /*   The following versions are used whenever both vectors are both      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1919
  /*   along one of the coordinate unit vectors, i.e. in 90% of the cases. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1920
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1921
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1922
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1923
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1924
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1925
  Direct_Move_X( EXEC_OP_ TT_GlyphZone  zone,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1926
                          FT_UShort     point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1927
                          FT_F26Dot6    distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1928
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1929
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1930
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1931
    zone->cur[point].x += distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1932
    zone->tags[point]  |= FT_CURVE_TAG_TOUCH_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1933
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1934
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1935
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1936
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1937
  Direct_Move_Y( EXEC_OP_ TT_GlyphZone  zone,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1938
                          FT_UShort     point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1939
                          FT_F26Dot6    distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1940
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1941
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1942
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1943
    zone->cur[point].y += distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1944
    zone->tags[point]  |= FT_CURVE_TAG_TOUCH_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1945
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1946
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1947
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1948
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1949
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1950
  /* Special versions of Direct_Move_Orig()                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1951
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1952
  /*   The following versions are used whenever both vectors are both      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1953
  /*   along one of the coordinate unit vectors, i.e. in 90% of the cases. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1954
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1955
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1956
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1957
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1958
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1959
  Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone  zone,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1960
                               FT_UShort     point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1961
                               FT_F26Dot6    distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1962
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1963
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1964
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1965
    zone->org[point].x += distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1966
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1967
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1968
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1969
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1970
  Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone  zone,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1971
                               FT_UShort     point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1972
                               FT_F26Dot6    distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1973
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1974
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1975
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1976
    zone->org[point].y += distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1977
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1978
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1979
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1980
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1981
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1982
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1983
  /*    Round_None                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1984
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1985
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1986
  /*    Does not round, but adds engine compensation.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1987
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1988
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1989
  /*    distance     :: The distance (not) to round.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1990
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1991
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1992
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1993
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1994
  /*    The compensated distance.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1995
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1996
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1997
  /*    The TrueType specification says very few about the relationship    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1998
  /*    between rounding and engine compensation.  However, it seems from  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1999
  /*    the description of super round that we should add the compensation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2000
  /*    before rounding.                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2001
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2002
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2003
  Round_None( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2004
                       FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2005
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2006
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2007
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2008
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2009
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2010
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2011
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2012
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2013
      val = distance + compensation;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2014
      if ( distance && val < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2015
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2016
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2017
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2018
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2019
      val = distance - compensation;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2020
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2021
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2022
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2023
    return val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2024
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2025
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2026
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2027
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2028
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2029
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2030
  /*    Round_To_Grid                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2031
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2032
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2033
  /*    Rounds value to grid after adding engine compensation.             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2034
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2035
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2036
  /*    distance     :: The distance to round.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2037
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2038
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2039
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2040
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2041
  /*    Rounded distance.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2042
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2043
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2044
  Round_To_Grid( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2045
                          FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2046
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2047
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2048
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2049
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2050
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2051
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2052
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2053
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2054
      val = distance + compensation + 32;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2055
      if ( distance && val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2056
        val &= ~63;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2057
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2058
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2059
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2060
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2061
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2062
      val = -FT_PIX_ROUND( compensation - distance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2063
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2064
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2065
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2066
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2067
    return  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2068
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2069
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2070
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2071
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2072
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2073
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2074
  /*    Round_To_Half_Grid                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2075
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2076
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2077
  /*    Rounds value to half grid after adding engine compensation.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2078
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2079
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2080
  /*    distance     :: The distance to round.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2081
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2082
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2083
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2084
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2085
  /*    Rounded distance.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2086
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2087
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2088
  Round_To_Half_Grid( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2089
                               FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2090
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2091
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2092
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2093
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2094
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2095
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2096
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2097
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2098
      val = FT_PIX_FLOOR( distance + compensation ) + 32;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2099
      if ( distance && val < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2100
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2101
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2102
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2103
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2104
      val = -( FT_PIX_FLOOR( compensation - distance ) + 32 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2105
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2106
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2107
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2108
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2109
    return val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2110
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2111
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2112
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2113
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2114
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2115
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2116
  /*    Round_Down_To_Grid                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2117
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2118
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2119
  /*    Rounds value down to grid after adding engine compensation.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2120
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2121
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2122
  /*    distance     :: The distance to round.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2123
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2124
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2125
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2126
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2127
  /*    Rounded distance.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2128
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2129
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2130
  Round_Down_To_Grid( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2131
                               FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2132
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2133
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2134
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2135
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2136
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2137
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2138
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2139
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2140
      val = distance + compensation;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2141
      if ( distance && val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2142
        val &= ~63;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2143
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2144
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2145
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2146
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2147
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2148
      val = -( ( compensation - distance ) & -64 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2149
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2150
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2151
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2152
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2153
    return val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2154
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2155
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2156
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2157
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2158
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2159
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2160
  /*    Round_Up_To_Grid                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2161
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2162
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2163
  /*    Rounds value up to grid after adding engine compensation.          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2164
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2165
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2166
  /*    distance     :: The distance to round.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2167
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2168
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2169
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2170
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2171
  /*    Rounded distance.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2172
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2173
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2174
  Round_Up_To_Grid( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2175
                             FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2176
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2177
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2178
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2179
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2180
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2181
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2182
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2183
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2184
      val = distance + compensation + 63;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2185
      if ( distance && val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2186
        val &= ~63;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2187
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2188
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2189
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2190
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2191
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2192
      val = - FT_PIX_CEIL( compensation - distance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2193
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2194
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2195
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2196
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2197
    return val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2198
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2199
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2200
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2201
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2202
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2203
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2204
  /*    Round_To_Double_Grid                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2205
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2206
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2207
  /*    Rounds value to double grid after adding engine compensation.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2208
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2209
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2210
  /*    distance     :: The distance to round.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2211
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2212
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2213
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2214
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2215
  /*    Rounded distance.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2216
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2217
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2218
  Round_To_Double_Grid( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2219
                                 FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2220
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2221
    FT_F26Dot6 val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2222
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2223
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2224
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2225
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2226
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2227
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2228
      val = distance + compensation + 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2229
      if ( distance && val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2230
        val &= ~31;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2231
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2232
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2233
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2234
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2235
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2236
      val = -FT_PAD_ROUND( compensation - distance, 32 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2237
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2238
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2239
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2240
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2241
    return val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2242
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2243
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2244
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2245
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2246
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2247
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2248
  /*    Round_Super                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2249
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2250
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2251
  /*    Super-rounds value to grid after adding engine compensation.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2252
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2253
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2254
  /*    distance     :: The distance to round.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2255
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2256
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2257
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2258
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2259
  /*    Rounded distance.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2260
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2261
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2262
  /*    The TrueType specification says very few about the relationship    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2263
  /*    between rounding and engine compensation.  However, it seems from  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2264
  /*    the description of super round that we should add the compensation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2265
  /*    before rounding.                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2266
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2267
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2268
  Round_Super( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2269
                        FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2270
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2271
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2272
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2273
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2274
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2275
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2276
      val = ( distance - CUR.phase + CUR.threshold + compensation ) &
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2277
              -CUR.period;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2278
      if ( distance && val < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2279
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2280
      val += CUR.phase;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2281
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2282
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2283
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2284
      val = -( ( CUR.threshold - CUR.phase - distance + compensation ) &
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2285
               -CUR.period );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2286
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2287
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2288
      val -= CUR.phase;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2289
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2290
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2291
    return val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2292
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2293
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2294
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2295
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2296
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2297
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2298
  /*    Round_Super_45                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2299
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2300
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2301
  /*    Super-rounds value to grid after adding engine compensation.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2302
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2303
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2304
  /*    distance     :: The distance to round.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2305
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2306
  /*    compensation :: The engine compensation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2307
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2308
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2309
  /*    Rounded distance.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2310
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2311
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2312
  /*    There is a separate function for Round_Super_45() as we may need   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2313
  /*    greater precision.                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2314
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2315
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2316
  Round_Super_45( EXEC_OP_ FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2317
                           FT_F26Dot6  compensation )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2318
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2319
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2320
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2321
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2322
    if ( distance >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2323
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2324
      val = ( ( distance - CUR.phase + CUR.threshold + compensation ) /
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2325
                CUR.period ) * CUR.period;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2326
      if ( distance && val < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2327
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2328
      val += CUR.phase;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2329
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2330
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2331
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2332
      val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) /
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2333
                   CUR.period ) * CUR.period );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2334
      if ( val > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2335
        val = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2336
      val -= CUR.phase;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2337
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2338
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2339
    return val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2340
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2341
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2342
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2343
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2344
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2345
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2346
  /*    Compute_Round                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2347
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2348
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2349
  /*    Sets the rounding mode.                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2350
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2351
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2352
  /*    round_mode :: The rounding mode to be used.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2353
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2354
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2355
  Compute_Round( EXEC_OP_ FT_Byte  round_mode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2356
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2357
    switch ( round_mode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2358
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2359
    case TT_Round_Off:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2360
      CUR.func_round = (TT_Round_Func)Round_None;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2361
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2362
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2363
    case TT_Round_To_Grid:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2364
      CUR.func_round = (TT_Round_Func)Round_To_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2365
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2366
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2367
    case TT_Round_Up_To_Grid:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2368
      CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2369
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2370
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2371
    case TT_Round_Down_To_Grid:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2372
      CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2373
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2374
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2375
    case TT_Round_To_Half_Grid:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2376
      CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2377
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2378
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2379
    case TT_Round_To_Double_Grid:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2380
      CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2381
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2382
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2383
    case TT_Round_Super:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2384
      CUR.func_round = (TT_Round_Func)Round_Super;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2385
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2386
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2387
    case TT_Round_Super_45:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2388
      CUR.func_round = (TT_Round_Func)Round_Super_45;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2389
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2390
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2391
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2392
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2393
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2394
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2395
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2396
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2397
  /*    SetSuperRound                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2398
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2399
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2400
  /*    Sets Super Round parameters.                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2401
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2402
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2403
  /*    GridPeriod :: Grid period                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2404
  /*    selector   :: SROUND opcode                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2405
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2406
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2407
  SetSuperRound( EXEC_OP_ FT_F26Dot6  GridPeriod,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2408
                          FT_Long     selector )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2409
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2410
    switch ( (FT_Int)( selector & 0xC0 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2411
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2412
      case 0:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2413
        CUR.period = GridPeriod / 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2414
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2415
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2416
      case 0x40:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2417
        CUR.period = GridPeriod;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2418
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2419
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2420
      case 0x80:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2421
        CUR.period = GridPeriod * 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2422
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2423
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2424
      /* This opcode is reserved, but... */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2425
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2426
      case 0xC0:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2427
        CUR.period = GridPeriod;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2428
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2429
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2430
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2431
    switch ( (FT_Int)( selector & 0x30 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2432
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2433
    case 0:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2434
      CUR.phase = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2435
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2436
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2437
    case 0x10:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2438
      CUR.phase = CUR.period / 4;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2439
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2440
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2441
    case 0x20:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2442
      CUR.phase = CUR.period / 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2443
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2444
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2445
    case 0x30:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2446
      CUR.phase = CUR.period * 3 / 4;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2447
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2448
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2449
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2450
    if ( ( selector & 0x0F ) == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2451
      CUR.threshold = CUR.period - 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2452
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2453
      CUR.threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2454
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2455
    CUR.period    /= 256;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2456
    CUR.phase     /= 256;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2457
    CUR.threshold /= 256;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2458
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2459
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2460
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2461
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2462
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2463
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2464
  /*    Project                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2465
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2466
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2467
  /*    Computes the projection of vector given by (v2-v1) along the       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2468
  /*    current projection vector.                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2469
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2470
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2471
  /*    v1 :: First input vector.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2472
  /*    v2 :: Second input vector.                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2473
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2474
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2475
  /*    The distance in F26dot6 format.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2476
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2477
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2478
  Project( EXEC_OP_ FT_Pos  dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2479
                    FT_Pos  dy )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2480
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2481
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2482
    FT_ASSERT( !CUR.face->unpatented_hinting );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2483
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2484
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2485
    return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2486
                        CUR.GS.projVector.x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2487
                        CUR.GS.projVector.y );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2488
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2489
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2490
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2491
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2492
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2493
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2494
  /*    Dual_Project                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2495
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2496
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2497
  /*    Computes the projection of the vector given by (v2-v1) along the   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2498
  /*    current dual vector.                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2499
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2500
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2501
  /*    v1 :: First input vector.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2502
  /*    v2 :: Second input vector.                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2503
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2504
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2505
  /*    The distance in F26dot6 format.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2506
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2507
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2508
  Dual_Project( EXEC_OP_ FT_Pos  dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2509
                         FT_Pos  dy )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2510
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2511
    return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2512
                        CUR.GS.dualVector.x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2513
                        CUR.GS.dualVector.y );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2514
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2515
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2516
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2517
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2518
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2519
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2520
  /*    Project_x                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2521
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2522
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2523
  /*    Computes the projection of the vector given by (v2-v1) along the   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2524
  /*    horizontal axis.                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2525
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2526
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2527
  /*    v1 :: First input vector.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2528
  /*    v2 :: Second input vector.                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2529
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2530
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2531
  /*    The distance in F26dot6 format.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2532
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2533
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2534
  Project_x( EXEC_OP_ FT_Pos  dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2535
                      FT_Pos  dy )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2536
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2537
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2538
    FT_UNUSED( dy );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2539
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2540
    return dx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2541
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2542
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2543
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2544
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2545
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2546
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2547
  /*    Project_y                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2548
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2549
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2550
  /*    Computes the projection of the vector given by (v2-v1) along the   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2551
  /*    vertical axis.                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2552
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2553
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2554
  /*    v1 :: First input vector.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2555
  /*    v2 :: Second input vector.                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2556
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2557
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2558
  /*    The distance in F26dot6 format.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2559
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2560
  static FT_F26Dot6
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2561
  Project_y( EXEC_OP_ FT_Pos  dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2562
                      FT_Pos  dy )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2563
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2564
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2565
    FT_UNUSED( dx );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2566
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2567
    return dy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2568
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2569
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2570
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2571
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2572
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2573
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2574
  /*    Compute_Funcs                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2575
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2576
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2577
  /*    Computes the projection and movement function pointers according   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2578
  /*    to the current graphics state.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2579
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2580
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2581
  Compute_Funcs( EXEC_OP )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2582
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2583
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2584
    if ( CUR.face->unpatented_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2585
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2586
      /* If both vectors point rightwards along the x axis, set             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2587
      /* `both-x-axis' true, otherwise set it false.  The x values only     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2588
      /* need be tested because the vector has been normalised to a unit    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2589
      /* vector of length 0x4000 = unity.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2590
      CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2591
                                      CUR.GS.freeVector.x == 0x4000 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2592
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2593
      /* Throw away projection and freedom vector information */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2594
      /* because the patents don't allow them to be stored.   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2595
      /* The relevant US Patents are 5155805 and 5325479.     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2596
      CUR.GS.projVector.x = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2597
      CUR.GS.projVector.y = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2598
      CUR.GS.freeVector.x = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2599
      CUR.GS.freeVector.y = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2600
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2601
      if ( CUR.GS.both_x_axis )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2602
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2603
        CUR.func_project   = Project_x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2604
        CUR.func_move      = Direct_Move_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2605
        CUR.func_move_orig = Direct_Move_Orig_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2606
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2607
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2608
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2609
        CUR.func_project   = Project_y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2610
        CUR.func_move      = Direct_Move_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2611
        CUR.func_move_orig = Direct_Move_Orig_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2612
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2613
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2614
      if ( CUR.GS.dualVector.x == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2615
        CUR.func_dualproj = Project_x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2616
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2617
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2618
        if ( CUR.GS.dualVector.y == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2619
          CUR.func_dualproj = Project_y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2620
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2621
          CUR.func_dualproj = Dual_Project;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2622
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2623
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2624
      /* Force recalculation of cached aspect ratio */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2625
      CUR.tt_metrics.ratio = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2626
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2627
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2628
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2629
#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2630
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2631
    if ( CUR.GS.freeVector.x == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2632
      CUR.F_dot_P       = CUR.GS.projVector.x * 0x10000L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2633
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2634
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2635
      if ( CUR.GS.freeVector.y == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2636
        CUR.F_dot_P       = CUR.GS.projVector.y * 0x10000L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2637
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2638
        CUR.F_dot_P = (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2639
                      (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2640
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2641
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2642
    if ( CUR.GS.projVector.x == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2643
      CUR.func_project = (TT_Project_Func)Project_x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2644
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2645
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2646
      if ( CUR.GS.projVector.y == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2647
        CUR.func_project = (TT_Project_Func)Project_y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2648
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2649
        CUR.func_project = (TT_Project_Func)Project;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2650
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2651
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2652
    if ( CUR.GS.dualVector.x == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2653
      CUR.func_dualproj = (TT_Project_Func)Project_x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2654
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2655
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2656
      if ( CUR.GS.dualVector.y == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2657
        CUR.func_dualproj = (TT_Project_Func)Project_y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2658
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2659
        CUR.func_dualproj = (TT_Project_Func)Dual_Project;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2660
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2661
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2662
    CUR.func_move      = (TT_Move_Func)Direct_Move;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2663
    CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2664
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2665
    if ( CUR.F_dot_P == 0x40000000L )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2666
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2667
      if ( CUR.GS.freeVector.x == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2668
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2669
        CUR.func_move      = (TT_Move_Func)Direct_Move_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2670
        CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2671
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2672
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2673
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2674
        if ( CUR.GS.freeVector.y == 0x4000 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2675
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2676
          CUR.func_move      = (TT_Move_Func)Direct_Move_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2677
          CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2678
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2679
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2680
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2681
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2682
    /* at small sizes, F_dot_P can become too small, resulting   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2683
    /* in overflows and `spikes' in a number of glyphs like `w'. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2684
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2685
    if ( FT_ABS( CUR.F_dot_P ) < 0x4000000L )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2686
      CUR.F_dot_P = 0x40000000L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2687
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2688
    /* Disable cached aspect ratio */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2689
    CUR.tt_metrics.ratio = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2690
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2691
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2692
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2693
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2694
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2695
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2696
  /*    Normalize                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2697
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2698
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2699
  /*    Norms a vector.                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2700
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2701
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2702
  /*    Vx :: The horizontal input vector coordinate.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2703
  /*    Vy :: The vertical input vector coordinate.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2704
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2705
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2706
  /*    R  :: The normed unit vector.                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2707
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2708
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2709
  /*    Returns FAILURE if a vector parameter is zero.                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2710
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2711
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2712
  /*    In case Vx and Vy are both zero, Normalize() returns SUCCESS, and  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2713
  /*    R is undefined.                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2714
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2715
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2716
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2717
  static FT_Bool
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2718
  Normalize( EXEC_OP_ FT_F26Dot6      Vx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2719
                      FT_F26Dot6      Vy,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2720
                      FT_UnitVector*  R )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2721
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2722
    FT_F26Dot6  W;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2723
    FT_Bool     S1, S2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2724
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2725
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2726
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2727
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2728
    if ( FT_ABS( Vx ) < 0x10000L && FT_ABS( Vy ) < 0x10000L )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2729
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2730
      Vx *= 0x100;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2731
      Vy *= 0x100;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2732
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2733
      W = TT_VecLen( Vx, Vy );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2734
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2735
      if ( W == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2736
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2737
        /* XXX: UNDOCUMENTED! It seems that it is possible to try   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2738
        /*      to normalize the vector (0,0).  Return immediately. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2739
        return SUCCESS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2740
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2741
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2742
      R->x = (FT_F2Dot14)FT_MulDiv( Vx, 0x4000L, W );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2743
      R->y = (FT_F2Dot14)FT_MulDiv( Vy, 0x4000L, W );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2744
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2745
      return SUCCESS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2746
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2747
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2748
    W = TT_VecLen( Vx, Vy );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2749
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2750
    Vx = FT_MulDiv( Vx, 0x4000L, W );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2751
    Vy = FT_MulDiv( Vy, 0x4000L, W );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2752
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2753
    W = Vx * Vx + Vy * Vy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2754
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2755
    /* Now, we want that Sqrt( W ) = 0x4000 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2756
    /* Or 0x10000000 <= W < 0x10004000        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2757
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2758
    if ( Vx < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2759
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2760
      Vx = -Vx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2761
      S1 = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2762
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2763
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2764
      S1 = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2765
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2766
    if ( Vy < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2767
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2768
      Vy = -Vy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2769
      S2 = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2770
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2771
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2772
      S2 = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2773
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2774
    while ( W < 0x10000000L )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2775
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2776
      /* We need to increase W by a minimal amount */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2777
      if ( Vx < Vy )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2778
        Vx++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2779
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2780
        Vy++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2781
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2782
      W = Vx * Vx + Vy * Vy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2783
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2784
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2785
    while ( W >= 0x10004000L )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2786
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2787
      /* We need to decrease W by a minimal amount */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2788
      if ( Vx < Vy )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2789
        Vx--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2790
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2791
        Vy--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2792
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2793
      W = Vx * Vx + Vy * Vy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2794
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2795
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2796
    /* Note that in various cases, we can only  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2797
    /* compute a Sqrt(W) of 0x3FFF, eg. Vx = Vy */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2798
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2799
    if ( S1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2800
      Vx = -Vx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2801
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2802
    if ( S2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2803
      Vy = -Vy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2804
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2805
    R->x = (FT_F2Dot14)Vx;   /* Type conversion */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2806
    R->y = (FT_F2Dot14)Vy;   /* Type conversion */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2807
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2808
    return SUCCESS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2809
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2810
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2811
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2812
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2813
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2814
  /* Here we start with the implementation of the various opcodes.         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2815
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2816
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2817
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2818
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2819
  static FT_Bool
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2820
  Ins_SxVTL( EXEC_OP_ FT_UShort       aIdx1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2821
                      FT_UShort       aIdx2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2822
                      FT_Int          aOpc,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2823
                      FT_UnitVector*  Vec )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2824
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2825
    FT_Long     A, B, C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2826
    FT_Vector*  p1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2827
    FT_Vector*  p2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2828
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2829
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2830
    if ( BOUNDS( aIdx1, CUR.zp2.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2831
         BOUNDS( aIdx2, CUR.zp1.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2832
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2833
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2834
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2835
      return FAILURE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2836
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2837
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2838
    p1 = CUR.zp1.cur + aIdx2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2839
    p2 = CUR.zp2.cur + aIdx1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2840
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2841
    A = p1->x - p2->x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2842
    B = p1->y - p2->y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2843
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2844
    if ( ( aOpc & 1 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2845
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2846
      C =  B;   /* counter clockwise rotation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2847
      B =  A;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2848
      A = -C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2849
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2850
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2851
    NORMalize( A, B, Vec );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2852
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2853
    return SUCCESS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2854
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2855
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2856
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2857
  /* When not using the big switch statements, the interpreter uses a */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2858
  /* call table defined later below in this source.  Each opcode must */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2859
  /* thus have a corresponding function, even trivial ones.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2860
  /*                                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2861
  /* They are all defined there.                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2862
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2863
#define DO_SVTCA                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2864
  {                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2865
    FT_Short  A, B;                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2866
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2867
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2868
    A = (FT_Short)( CUR.opcode & 1 ) << 14; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2869
    B = A ^ (FT_Short)0x4000;               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2870
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2871
    CUR.GS.freeVector.x = A;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2872
    CUR.GS.projVector.x = A;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2873
    CUR.GS.dualVector.x = A;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2874
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2875
    CUR.GS.freeVector.y = B;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2876
    CUR.GS.projVector.y = B;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2877
    CUR.GS.dualVector.y = B;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2878
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2879
    COMPUTE_Funcs();                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2880
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2881
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2882
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2883
#define DO_SPVTCA                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2884
  {                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2885
    FT_Short  A, B;                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2886
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2887
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2888
    A = (FT_Short)( CUR.opcode & 1 ) << 14; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2889
    B = A ^ (FT_Short)0x4000;               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2890
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2891
    CUR.GS.projVector.x = A;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2892
    CUR.GS.dualVector.x = A;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2893
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2894
    CUR.GS.projVector.y = B;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2895
    CUR.GS.dualVector.y = B;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2896
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2897
    GUESS_VECTOR( freeVector );             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2898
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2899
    COMPUTE_Funcs();                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2900
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2901
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2902
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2903
#define DO_SFVTCA                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2904
  {                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2905
    FT_Short  A, B;                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2906
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2907
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2908
    A = (FT_Short)( CUR.opcode & 1 ) << 14; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2909
    B = A ^ (FT_Short)0x4000;               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2910
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2911
    CUR.GS.freeVector.x = A;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2912
    CUR.GS.freeVector.y = B;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2913
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2914
    GUESS_VECTOR( projVector );             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2915
                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2916
    COMPUTE_Funcs();                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2917
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2918
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2919
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2920
#define DO_SPVTL                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2921
    if ( INS_SxVTL( (FT_UShort)args[1],               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2922
                    (FT_UShort)args[0],               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2923
                    CUR.opcode,                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2924
                    &CUR.GS.projVector ) == SUCCESS ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2925
    {                                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2926
      CUR.GS.dualVector = CUR.GS.projVector;          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2927
      GUESS_VECTOR( freeVector );                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2928
      COMPUTE_Funcs();                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2929
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2930
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2931
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2932
#define DO_SFVTL                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2933
    if ( INS_SxVTL( (FT_UShort)args[1],               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2934
                    (FT_UShort)args[0],               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2935
                    CUR.opcode,                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2936
                    &CUR.GS.freeVector ) == SUCCESS ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2937
    {                                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2938
      GUESS_VECTOR( projVector );                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2939
      COMPUTE_Funcs();                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2940
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2941
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2942
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2943
#define DO_SFVTPV                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2944
    GUESS_VECTOR( projVector );            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2945
    CUR.GS.freeVector = CUR.GS.projVector; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2946
    COMPUTE_Funcs();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2947
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2948
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2949
#define DO_SPVFS                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2950
  {                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2951
    FT_Short  S;                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2952
    FT_Long   X, Y;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2953
                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2954
                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2955
    /* Only use low 16bits, then sign extend */ \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2956
    S = (FT_Short)args[1];                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2957
    Y = (FT_Long)S;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2958
    S = (FT_Short)args[0];                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2959
    X = (FT_Long)S;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2960
                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2961
    NORMalize( X, Y, &CUR.GS.projVector );      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2962
                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2963
    CUR.GS.dualVector = CUR.GS.projVector;      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2964
    GUESS_VECTOR( freeVector );                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2965
    COMPUTE_Funcs();                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2966
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2967
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2968
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2969
#define DO_SFVFS                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2970
  {                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2971
    FT_Short  S;                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2972
    FT_Long   X, Y;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2973
                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2974
                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2975
    /* Only use low 16bits, then sign extend */ \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2976
    S = (FT_Short)args[1];                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2977
    Y = (FT_Long)S;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2978
    S = (FT_Short)args[0];                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2979
    X = S;                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2980
                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2981
    NORMalize( X, Y, &CUR.GS.freeVector );      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2982
    GUESS_VECTOR( projVector );                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2983
    COMPUTE_Funcs();                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2984
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2985
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2986
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2987
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2988
#define DO_GPV                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2989
    if ( CUR.face->unpatented_hinting )          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2990
    {                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2991
      args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2992
      args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2993
    }                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2994
    else                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2995
    {                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2996
      args[0] = CUR.GS.projVector.x;             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2997
      args[1] = CUR.GS.projVector.y;             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2998
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  2999
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3000
#define DO_GPV                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3001
    args[0] = CUR.GS.projVector.x;               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3002
    args[1] = CUR.GS.projVector.y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3003
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3004
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3005
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3006
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3007
#define DO_GFV                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3008
    if ( CUR.face->unpatented_hinting )          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3009
    {                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3010
      args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3011
      args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3012
    }                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3013
    else                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3014
    {                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3015
      args[0] = CUR.GS.freeVector.x;             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3016
      args[1] = CUR.GS.freeVector.y;             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3017
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3018
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3019
#define DO_GFV                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3020
    args[0] = CUR.GS.freeVector.x;               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3021
    args[1] = CUR.GS.freeVector.y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3022
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3023
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3024
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3025
#define DO_SRP0                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3026
    CUR.GS.rp0 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3027
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3028
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3029
#define DO_SRP1                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3030
    CUR.GS.rp1 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3031
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3032
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3033
#define DO_SRP2                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3034
    CUR.GS.rp2 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3035
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3036
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3037
#define DO_RTHG                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3038
    CUR.GS.round_state = TT_Round_To_Half_Grid;         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3039
    CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3040
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3041
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3042
#define DO_RTG                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3043
    CUR.GS.round_state = TT_Round_To_Grid;         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3044
    CUR.func_round = (TT_Round_Func)Round_To_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3045
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3046
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3047
#define DO_RTDG                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3048
    CUR.GS.round_state = TT_Round_To_Double_Grid;         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3049
    CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3050
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3051
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3052
#define DO_RUTG                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3053
    CUR.GS.round_state = TT_Round_Up_To_Grid;         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3054
    CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3055
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3056
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3057
#define DO_RDTG                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3058
    CUR.GS.round_state = TT_Round_Down_To_Grid;         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3059
    CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3060
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3061
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3062
#define DO_ROFF                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3063
    CUR.GS.round_state = TT_Round_Off;          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3064
    CUR.func_round = (TT_Round_Func)Round_None;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3065
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3066
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3067
#define DO_SROUND                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3068
    SET_SuperRound( 0x4000, args[0] );           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3069
    CUR.GS.round_state = TT_Round_Super;         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3070
    CUR.func_round = (TT_Round_Func)Round_Super;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3071
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3072
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3073
#define DO_S45ROUND                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3074
    SET_SuperRound( 0x2D41, args[0] );              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3075
    CUR.GS.round_state = TT_Round_Super_45;         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3076
    CUR.func_round = (TT_Round_Func)Round_Super_45;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3077
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3078
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3079
#define DO_SLOOP                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3080
    if ( args[0] < 0 )                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3081
      CUR.error = TT_Err_Bad_Argument; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3082
    else                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3083
      CUR.GS.loop = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3084
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3085
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3086
#define DO_SMD                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3087
    CUR.GS.minimum_distance = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3088
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3089
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3090
#define DO_SCVTCI                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3091
    CUR.GS.control_value_cutin = (FT_F26Dot6)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3092
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3093
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3094
#define DO_SSWCI                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3095
    CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3096
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3097
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3098
    /* XXX: UNDOCUMENTED! or bug in the Windows engine?   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3099
    /*                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3100
    /*      It seems that the value that is read here is  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3101
    /*      expressed in 16.16 format rather than in font */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3102
    /*      units.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3103
    /*                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3104
#define DO_SSW                                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3105
    CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3106
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3107
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3108
#define DO_FLIPON            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3109
    CUR.GS.auto_flip = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3110
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3111
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3112
#define DO_FLIPOFF            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3113
    CUR.GS.auto_flip = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3115
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3116
#define DO_SDB                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3117
    CUR.GS.delta_base = (FT_Short)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3119
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3120
#define DO_SDS                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3121
    CUR.GS.delta_shift = (FT_Short)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3122
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3123
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3124
#define DO_MD  /* nothing */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3125
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3126
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3127
#define DO_MPPEM              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3128
    args[0] = CURRENT_Ppem();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3130
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3131
  /* Note: The pointSize should be irrelevant in a given font program; */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3132
  /*       we thus decide to return only the ppem.                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3133
#if 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3134
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3135
#define DO_MPS                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3136
    args[0] = CUR.metrics.pointSize;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3137
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3138
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3139
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3140
#define DO_MPS                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3141
    args[0] = CURRENT_Ppem();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3142
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3143
#endif /* 0 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3144
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3145
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3146
#define DO_DUP         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3147
    args[1] = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3148
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3149
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3150
#define DO_CLEAR     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3151
    CUR.new_top = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3152
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3153
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3154
#define DO_SWAP        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3155
  {                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3156
    FT_Long  L;        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3157
                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3158
                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3159
    L       = args[0]; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3160
    args[0] = args[1]; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3161
    args[1] = L;       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3162
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3163
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3164
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3165
#define DO_DEPTH       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3166
    args[0] = CUR.top;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3167
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3168
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3169
#define DO_CINDEX                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3170
  {                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3171
    FT_Long  L;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3172
                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3173
                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3174
    L = args[0];                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3175
                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3176
    if ( L <= 0 || L > CUR.args )             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3177
    {                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3178
      if ( CUR.pedantic_hinting )             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3179
        CUR.error = TT_Err_Invalid_Reference; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3180
      args[0] = 0;                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3181
    }                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3182
    else                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3183
      args[0] = CUR.stack[CUR.args - L];      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3184
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3185
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3186
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3187
#define DO_JROT                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3188
    if ( args[1] != 0 )                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3189
    {                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3190
      if ( args[0] == 0 && CUR.args == 0 ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3191
        CUR.error = TT_Err_Bad_Argument;   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3192
      CUR.IP += args[0];                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3193
      if ( CUR.IP < 0 )                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3194
        CUR.error = TT_Err_Bad_Argument;   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3195
      CUR.step_ins = FALSE;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3196
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3197
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3198
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3199
#define DO_JMPR                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3200
    if ( args[0] == 0 && CUR.args == 0 ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3201
      CUR.error = TT_Err_Bad_Argument;   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3202
    CUR.IP += args[0];                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3203
    if ( CUR.IP < 0 )                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3204
      CUR.error = TT_Err_Bad_Argument;   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3205
    CUR.step_ins = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3206
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3207
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3208
#define DO_JROF                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3209
    if ( args[1] == 0 )                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3210
    {                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3211
      if ( args[0] == 0 && CUR.args == 0 ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3212
        CUR.error = TT_Err_Bad_Argument;   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3213
      CUR.IP += args[0];                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3214
      if ( CUR.IP < 0 )                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3215
        CUR.error = TT_Err_Bad_Argument;   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3216
      CUR.step_ins = FALSE;                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3217
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3218
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3219
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3220
#define DO_LT                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3221
    args[0] = ( args[0] < args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3222
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3223
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3224
#define DO_LTEQ                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3225
    args[0] = ( args[0] <= args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3226
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3227
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3228
#define DO_GT                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3229
    args[0] = ( args[0] > args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3230
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3231
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3232
#define DO_GTEQ                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3233
    args[0] = ( args[0] >= args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3234
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3235
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3236
#define DO_EQ                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3237
    args[0] = ( args[0] == args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3238
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3239
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3240
#define DO_NEQ                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3241
    args[0] = ( args[0] != args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3242
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3243
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3244
#define DO_ODD                                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3245
    args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 64 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3246
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3247
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3248
#define DO_EVEN                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3249
    args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 0 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3250
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3251
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3252
#define DO_AND                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3253
    args[0] = ( args[0] && args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3254
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3255
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3256
#define DO_OR                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3257
    args[0] = ( args[0] || args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3258
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3259
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3260
#define DO_NOT          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3261
    args[0] = !args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3262
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3263
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3264
#define DO_ADD          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3265
    args[0] += args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3266
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3267
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3268
#define DO_SUB          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3269
    args[0] -= args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3270
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3271
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3272
#define DO_DIV                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3273
    if ( args[1] == 0 )                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3274
      CUR.error = TT_Err_Divide_By_Zero;                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3275
    else                                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3276
      args[0] = TT_MULDIV_NO_ROUND( args[0], 64L, args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3277
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3278
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3279
#define DO_MUL                                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3280
    args[0] = TT_MULDIV( args[0], args[1], 64L );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3281
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3282
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3283
#define DO_ABS                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3284
    args[0] = FT_ABS( args[0] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3285
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3286
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3287
#define DO_NEG          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3288
    args[0] = -args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3289
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3290
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3291
#define DO_FLOOR    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3292
    args[0] = FT_PIX_FLOOR( args[0] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3293
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3294
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3295
#define DO_CEILING                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3296
    args[0] = FT_PIX_CEIL( args[0] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3297
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3298
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3299
#define DO_RS                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3300
   {                                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3301
     FT_ULong  I = (FT_ULong)args[0];   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3302
                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3303
                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3304
     if ( BOUNDSL( I, CUR.storeSize ) ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3305
     {                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3306
       if ( CUR.pedantic_hinting )      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3307
       {                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3308
         ARRAY_BOUND_ERROR;             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3309
       }                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3310
       else                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3311
         args[0] = 0;                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3312
     }                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3313
     else                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3314
       args[0] = CUR.storage[I];        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3315
   }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3316
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3317
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3318
#define DO_WS                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3319
   {                                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3320
     FT_ULong  I = (FT_ULong)args[0];   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3321
                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3322
                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3323
     if ( BOUNDSL( I, CUR.storeSize ) ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3324
     {                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3325
       if ( CUR.pedantic_hinting )      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3326
       {                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3327
         ARRAY_BOUND_ERROR;             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3328
       }                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3329
     }                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3330
     else                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3331
       CUR.storage[I] = args[1];        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3332
   }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3333
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3334
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3335
#define DO_RCVT                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3336
   {                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3337
     FT_ULong  I = (FT_ULong)args[0];    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3338
                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3339
                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3340
     if ( BOUNDSL( I, CUR.cvtSize ) )    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3341
     {                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3342
       if ( CUR.pedantic_hinting )       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3343
       {                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3344
         ARRAY_BOUND_ERROR;              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3345
       }                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3346
       else                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3347
         args[0] = 0;                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3348
     }                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3349
     else                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3350
       args[0] = CUR_Func_read_cvt( I ); \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3351
   }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3352
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3353
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3354
#define DO_WCVTP                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3355
   {                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3356
     FT_ULong  I = (FT_ULong)args[0];    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3357
                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3358
                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3359
     if ( BOUNDSL( I, CUR.cvtSize ) )    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3360
     {                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3361
       if ( CUR.pedantic_hinting )       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3362
       {                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3363
         ARRAY_BOUND_ERROR;              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3364
       }                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3365
     }                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3366
     else                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3367
       CUR_Func_write_cvt( I, args[1] ); \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3368
   }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3369
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3370
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3371
#define DO_WCVTF                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3372
   {                                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3373
     FT_ULong  I = (FT_ULong)args[0];                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3374
                                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3375
                                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3376
     if ( BOUNDSL( I, CUR.cvtSize ) )                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3377
     {                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3378
       if ( CUR.pedantic_hinting )                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3379
       {                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3380
         ARRAY_BOUND_ERROR;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3381
       }                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3382
     }                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3383
     else                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3384
       CUR.cvt[I] = TT_MULFIX( args[1], CUR.tt_metrics.scale ); \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3385
   }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3386
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3387
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3388
#define DO_DEBUG                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3389
    CUR.error = TT_Err_Debug_OpCode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3390
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3391
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3392
#define DO_ROUND                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3393
    args[0] = CUR_Func_round(                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3394
                args[0],                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3395
                CUR.tt_metrics.compensations[CUR.opcode - 0x68] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3396
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3397
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3398
#define DO_NROUND                                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3399
    args[0] = ROUND_None( args[0],                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3400
                          CUR.tt_metrics.compensations[CUR.opcode - 0x6C] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3401
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3402
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3403
#define DO_MAX               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3404
    if ( args[1] > args[0] ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3405
      args[0] = args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3406
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3407
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3408
#define DO_MIN               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3409
    if ( args[1] < args[0] ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3410
      args[0] = args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3411
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3412
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3413
#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3414
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3415
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3416
#undef  ARRAY_BOUND_ERROR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3417
#define ARRAY_BOUND_ERROR                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3418
    {                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3419
      CUR.error = TT_Err_Invalid_Reference; \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3420
      return;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3421
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3422
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3423
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3424
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3425
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3426
  /* SVTCA[a]:     Set (F and P) Vectors to Coordinate Axis                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3427
  /* Opcode range: 0x00-0x01                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3428
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3429
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3430
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3431
  Ins_SVTCA( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3432
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3433
    DO_SVTCA
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3434
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3435
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3436
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3437
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3438
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3439
  /* SPVTCA[a]:    Set PVector to Coordinate Axis                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3440
  /* Opcode range: 0x02-0x03                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3441
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3442
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3443
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3444
  Ins_SPVTCA( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3445
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3446
    DO_SPVTCA
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3447
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3448
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3449
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3450
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3451
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3452
  /* SFVTCA[a]:    Set FVector to Coordinate Axis                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3453
  /* Opcode range: 0x04-0x05                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3454
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3455
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3456
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3457
  Ins_SFVTCA( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3458
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3459
    DO_SFVTCA
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3460
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3461
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3462
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3463
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3464
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3465
  /* SPVTL[a]:     Set PVector To Line                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3466
  /* Opcode range: 0x06-0x07                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3467
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3468
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3469
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3470
  Ins_SPVTL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3471
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3472
    DO_SPVTL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3473
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3474
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3475
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3476
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3477
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3478
  /* SFVTL[a]:     Set FVector To Line                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3479
  /* Opcode range: 0x08-0x09                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3480
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3481
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3482
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3483
  Ins_SFVTL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3484
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3485
    DO_SFVTL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3486
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3487
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3488
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3489
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3490
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3491
  /* SFVTPV[]:     Set FVector To PVector                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3492
  /* Opcode range: 0x0E                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3493
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3494
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3495
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3496
  Ins_SFVTPV( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3497
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3498
    DO_SFVTPV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3499
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3500
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3501
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3502
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3503
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3504
  /* SPVFS[]:      Set PVector From Stack                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3505
  /* Opcode range: 0x0A                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3506
  /* Stack:        f2.14 f2.14 -->                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3507
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3508
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3509
  Ins_SPVFS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3510
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3511
    DO_SPVFS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3512
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3513
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3514
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3515
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3516
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3517
  /* SFVFS[]:      Set FVector From Stack                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3518
  /* Opcode range: 0x0B                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3519
  /* Stack:        f2.14 f2.14 -->                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3520
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3521
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3522
  Ins_SFVFS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3523
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3524
    DO_SFVFS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3525
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3526
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3527
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3528
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3529
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3530
  /* GPV[]:        Get Projection Vector                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3531
  /* Opcode range: 0x0C                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3532
  /* Stack:        ef2.14 --> ef2.14                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3533
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3534
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3535
  Ins_GPV( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3536
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3537
    DO_GPV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3538
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3539
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3540
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3541
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3542
  /* GFV[]:        Get Freedom Vector                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3543
  /* Opcode range: 0x0D                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3544
  /* Stack:        ef2.14 --> ef2.14                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3545
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3546
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3547
  Ins_GFV( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3548
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3549
    DO_GFV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3550
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3551
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3552
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3553
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3554
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3555
  /* SRP0[]:       Set Reference Point 0                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3556
  /* Opcode range: 0x10                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3557
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3558
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3559
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3560
  Ins_SRP0( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3561
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3562
    DO_SRP0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3563
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3564
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3565
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3566
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3567
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3568
  /* SRP1[]:       Set Reference Point 1                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3569
  /* Opcode range: 0x11                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3570
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3571
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3572
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3573
  Ins_SRP1( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3574
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3575
    DO_SRP1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3576
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3577
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3578
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3579
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3580
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3581
  /* SRP2[]:       Set Reference Point 2                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3582
  /* Opcode range: 0x12                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3583
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3584
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3585
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3586
  Ins_SRP2( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3587
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3588
    DO_SRP2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3589
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3590
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3591
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3592
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3593
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3594
  /* RTHG[]:       Round To Half Grid                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3595
  /* Opcode range: 0x19                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3596
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3597
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3598
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3599
  Ins_RTHG( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3600
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3601
    DO_RTHG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3602
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3603
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3604
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3605
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3606
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3607
  /* RTG[]:        Round To Grid                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3608
  /* Opcode range: 0x18                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3609
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3610
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3611
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3612
  Ins_RTG( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3613
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3614
    DO_RTG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3615
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3616
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3617
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3618
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3619
  /* RTDG[]:       Round To Double Grid                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3620
  /* Opcode range: 0x3D                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3621
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3622
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3623
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3624
  Ins_RTDG( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3625
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3626
    DO_RTDG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3627
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3628
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3629
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3630
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3631
  /* RUTG[]:       Round Up To Grid                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3632
  /* Opcode range: 0x7C                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3633
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3634
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3635
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3636
  Ins_RUTG( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3637
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3638
    DO_RUTG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3639
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3640
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3641
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3642
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3643
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3644
  /* RDTG[]:       Round Down To Grid                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3645
  /* Opcode range: 0x7D                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3646
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3647
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3648
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3649
  Ins_RDTG( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3650
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3651
    DO_RDTG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3652
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3653
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3654
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3655
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3656
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3657
  /* ROFF[]:       Round OFF                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3658
  /* Opcode range: 0x7A                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3659
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3660
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3661
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3662
  Ins_ROFF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3663
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3664
    DO_ROFF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3665
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3666
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3667
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3668
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3669
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3670
  /* SROUND[]:     Super ROUND                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3671
  /* Opcode range: 0x76                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3672
  /* Stack:        Eint8 -->                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3673
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3674
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3675
  Ins_SROUND( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3676
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3677
    DO_SROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3678
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3679
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3680
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3681
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3682
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3683
  /* S45ROUND[]:   Super ROUND 45 degrees                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3684
  /* Opcode range: 0x77                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3685
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3686
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3687
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3688
  Ins_S45ROUND( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3689
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3690
    DO_S45ROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3691
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3692
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3693
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3694
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3695
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3696
  /* SLOOP[]:      Set LOOP variable                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3697
  /* Opcode range: 0x17                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3698
  /* Stack:        int32? -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3699
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3700
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3701
  Ins_SLOOP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3702
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3703
    DO_SLOOP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3704
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3705
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3706
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3707
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3708
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3709
  /* SMD[]:        Set Minimum Distance                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3710
  /* Opcode range: 0x1A                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3711
  /* Stack:        f26.6 -->                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3712
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3713
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3714
  Ins_SMD( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3715
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3716
    DO_SMD
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3717
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3718
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3719
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3720
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3721
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3722
  /* SCVTCI[]:     Set Control Value Table Cut In                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3723
  /* Opcode range: 0x1D                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3724
  /* Stack:        f26.6 -->                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3725
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3726
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3727
  Ins_SCVTCI( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3728
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3729
    DO_SCVTCI
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3730
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3731
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3732
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3733
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3734
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3735
  /* SSWCI[]:      Set Single Width Cut In                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3736
  /* Opcode range: 0x1E                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3737
  /* Stack:        f26.6 -->                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3738
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3739
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3740
  Ins_SSWCI( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3741
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3742
    DO_SSWCI
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3743
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3744
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3745
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3746
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3747
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3748
  /* SSW[]:        Set Single Width                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3749
  /* Opcode range: 0x1F                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3750
  /* Stack:        int32? -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3751
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3752
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3753
  Ins_SSW( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3754
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3755
    DO_SSW
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3756
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3757
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3758
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3759
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3760
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3761
  /* FLIPON[]:     Set auto-FLIP to ON                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3762
  /* Opcode range: 0x4D                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3763
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3764
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3765
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3766
  Ins_FLIPON( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3767
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3768
    DO_FLIPON
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3769
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3770
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3771
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3772
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3773
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3774
  /* FLIPOFF[]:    Set auto-FLIP to OFF                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3775
  /* Opcode range: 0x4E                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3776
  /* Stack: -->                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3777
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3778
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3779
  Ins_FLIPOFF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3780
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3781
    DO_FLIPOFF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3782
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3783
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3784
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3785
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3786
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3787
  /* SANGW[]:      Set ANGle Weight                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3788
  /* Opcode range: 0x7E                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3789
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3790
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3791
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3792
  Ins_SANGW( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3793
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3794
    /* instruction not supported anymore */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3795
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3796
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3797
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3798
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3799
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3800
  /* SDB[]:        Set Delta Base                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3801
  /* Opcode range: 0x5E                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3802
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3803
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3804
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3805
  Ins_SDB( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3806
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3807
    DO_SDB
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3808
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3809
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3810
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3811
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3812
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3813
  /* SDS[]:        Set Delta Shift                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3814
  /* Opcode range: 0x5F                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3815
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3816
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3817
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3818
  Ins_SDS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3819
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3820
    DO_SDS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3821
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3822
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3823
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3824
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3825
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3826
  /* MPPEM[]:      Measure Pixel Per EM                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3827
  /* Opcode range: 0x4B                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3828
  /* Stack:        --> Euint16                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3829
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3830
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3831
  Ins_MPPEM( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3832
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3833
    DO_MPPEM
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3834
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3835
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3836
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3837
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3838
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3839
  /* MPS[]:        Measure Point Size                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3840
  /* Opcode range: 0x4C                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3841
  /* Stack:        --> Euint16                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3842
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3843
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3844
  Ins_MPS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3845
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3846
    DO_MPS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3847
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3848
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3849
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3850
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3851
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3852
  /* DUP[]:        DUPlicate the top stack's element                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3853
  /* Opcode range: 0x20                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3854
  /* Stack:        StkElt --> StkElt StkElt                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3855
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3856
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3857
  Ins_DUP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3858
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3859
    DO_DUP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3860
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3861
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3862
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3863
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3864
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3865
  /* POP[]:        POP the stack's top element                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3866
  /* Opcode range: 0x21                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3867
  /* Stack:        StkElt -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3868
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3869
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3870
  Ins_POP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3871
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3872
    /* nothing to do */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3873
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3874
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3875
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3876
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3877
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3878
  /* CLEAR[]:      CLEAR the entire stack                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3879
  /* Opcode range: 0x22                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3880
  /* Stack:        StkElt... -->                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3881
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3882
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3883
  Ins_CLEAR( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3884
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3885
    DO_CLEAR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3886
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3887
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3888
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3889
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3890
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3891
  /* SWAP[]:       SWAP the stack's top two elements                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3892
  /* Opcode range: 0x23                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3893
  /* Stack:        2 * StkElt --> 2 * StkElt                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3894
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3895
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3896
  Ins_SWAP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3897
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3898
    DO_SWAP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3899
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3900
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3901
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3902
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3903
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3904
  /* DEPTH[]:      return the stack DEPTH                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3905
  /* Opcode range: 0x24                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3906
  /* Stack:        --> uint32                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3907
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3908
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3909
  Ins_DEPTH( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3910
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3911
    DO_DEPTH
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3912
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3913
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3914
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3915
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3916
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3917
  /* CINDEX[]:     Copy INDEXed element                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3918
  /* Opcode range: 0x25                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3919
  /* Stack:        int32 --> StkElt                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3920
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3921
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3922
  Ins_CINDEX( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3923
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3924
    DO_CINDEX
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3925
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3926
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3927
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3928
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3929
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3930
  /* EIF[]:        End IF                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3931
  /* Opcode range: 0x59                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3932
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3933
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3934
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3935
  Ins_EIF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3936
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3937
    /* nothing to do */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3938
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3939
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3940
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3941
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3942
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3943
  /* JROT[]:       Jump Relative On True                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3944
  /* Opcode range: 0x78                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3945
  /* Stack:        StkElt int32 -->                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3946
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3947
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3948
  Ins_JROT( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3949
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3950
    DO_JROT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3951
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3952
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3953
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3954
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3955
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3956
  /* JMPR[]:       JuMP Relative                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3957
  /* Opcode range: 0x1C                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3958
  /* Stack:        int32 -->                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3959
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3960
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3961
  Ins_JMPR( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3962
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3963
    DO_JMPR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3964
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3965
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3966
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3967
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3968
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3969
  /* JROF[]:       Jump Relative On False                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3970
  /* Opcode range: 0x79                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3971
  /* Stack:        StkElt int32 -->                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3972
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3973
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3974
  Ins_JROF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3975
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3976
    DO_JROF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3977
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3978
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3979
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3980
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3981
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3982
  /* LT[]:         Less Than                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3983
  /* Opcode range: 0x50                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3984
  /* Stack:        int32? int32? --> bool                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3985
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3986
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3987
  Ins_LT( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3988
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3989
    DO_LT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3990
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3991
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3992
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3993
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3994
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3995
  /* LTEQ[]:       Less Than or EQual                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3996
  /* Opcode range: 0x51                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3997
  /* Stack:        int32? int32? --> bool                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3998
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  3999
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4000
  Ins_LTEQ( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4001
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4002
    DO_LTEQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4003
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4004
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4005
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4006
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4007
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4008
  /* GT[]:         Greater Than                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4009
  /* Opcode range: 0x52                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4010
  /* Stack:        int32? int32? --> bool                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4011
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4012
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4013
  Ins_GT( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4014
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4015
    DO_GT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4016
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4017
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4018
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4019
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4020
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4021
  /* GTEQ[]:       Greater Than or EQual                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4022
  /* Opcode range: 0x53                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4023
  /* Stack:        int32? int32? --> bool                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4024
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4025
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4026
  Ins_GTEQ( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4027
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4028
    DO_GTEQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4029
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4030
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4031
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4032
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4033
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4034
  /* EQ[]:         EQual                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4035
  /* Opcode range: 0x54                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4036
  /* Stack:        StkElt StkElt --> bool                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4037
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4038
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4039
  Ins_EQ( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4040
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4041
    DO_EQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4042
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4043
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4044
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4045
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4046
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4047
  /* NEQ[]:        Not EQual                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4048
  /* Opcode range: 0x55                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4049
  /* Stack:        StkElt StkElt --> bool                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4050
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4051
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4052
  Ins_NEQ( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4053
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4054
    DO_NEQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4055
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4056
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4057
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4058
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4059
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4060
  /* ODD[]:        Is ODD                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4061
  /* Opcode range: 0x56                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4062
  /* Stack:        f26.6 --> bool                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4063
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4064
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4065
  Ins_ODD( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4066
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4067
    DO_ODD
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4068
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4069
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4070
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4071
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4072
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4073
  /* EVEN[]:       Is EVEN                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4074
  /* Opcode range: 0x57                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4075
  /* Stack:        f26.6 --> bool                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4076
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4077
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4078
  Ins_EVEN( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4079
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4080
    DO_EVEN
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4081
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4082
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4083
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4084
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4085
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4086
  /* AND[]:        logical AND                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4087
  /* Opcode range: 0x5A                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4088
  /* Stack:        uint32 uint32 --> uint32                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4089
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4090
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4091
  Ins_AND( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4092
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4093
    DO_AND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4094
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4095
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4096
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4097
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4098
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4099
  /* OR[]:         logical OR                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4100
  /* Opcode range: 0x5B                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4101
  /* Stack:        uint32 uint32 --> uint32                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4102
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4103
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4104
  Ins_OR( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4105
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4106
    DO_OR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4107
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4108
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4109
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4110
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4111
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4112
  /* NOT[]:        logical NOT                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4113
  /* Opcode range: 0x5C                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4114
  /* Stack:        StkElt --> uint32                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4115
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4116
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4117
  Ins_NOT( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4118
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4119
    DO_NOT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4120
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4121
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4122
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4123
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4124
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4125
  /* ADD[]:        ADD                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4126
  /* Opcode range: 0x60                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4127
  /* Stack:        f26.6 f26.6 --> f26.6                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4128
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4129
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4130
  Ins_ADD( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4131
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4132
    DO_ADD
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4133
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4134
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4135
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4136
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4137
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4138
  /* SUB[]:        SUBtract                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4139
  /* Opcode range: 0x61                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4140
  /* Stack:        f26.6 f26.6 --> f26.6                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4141
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4142
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4143
  Ins_SUB( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4144
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4145
    DO_SUB
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4146
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4147
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4148
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4149
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4150
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4151
  /* DIV[]:        DIVide                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4152
  /* Opcode range: 0x62                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4153
  /* Stack:        f26.6 f26.6 --> f26.6                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4154
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4155
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4156
  Ins_DIV( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4157
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4158
    DO_DIV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4159
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4160
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4161
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4162
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4163
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4164
  /* MUL[]:        MULtiply                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4165
  /* Opcode range: 0x63                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4166
  /* Stack:        f26.6 f26.6 --> f26.6                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4167
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4168
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4169
  Ins_MUL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4170
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4171
    DO_MUL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4172
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4173
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4174
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4175
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4176
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4177
  /* ABS[]:        ABSolute value                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4178
  /* Opcode range: 0x64                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4179
  /* Stack:        f26.6 --> f26.6                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4180
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4181
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4182
  Ins_ABS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4183
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4184
    DO_ABS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4185
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4186
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4187
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4188
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4189
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4190
  /* NEG[]:        NEGate                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4191
  /* Opcode range: 0x65                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4192
  /* Stack: f26.6 --> f26.6                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4193
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4194
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4195
  Ins_NEG( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4196
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4197
    DO_NEG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4198
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4199
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4200
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4201
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4202
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4203
  /* FLOOR[]:      FLOOR                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4204
  /* Opcode range: 0x66                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4205
  /* Stack:        f26.6 --> f26.6                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4206
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4207
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4208
  Ins_FLOOR( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4209
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4210
    DO_FLOOR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4211
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4212
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4213
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4214
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4215
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4216
  /* CEILING[]:    CEILING                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4217
  /* Opcode range: 0x67                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4218
  /* Stack:        f26.6 --> f26.6                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4219
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4220
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4221
  Ins_CEILING( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4222
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4223
    DO_CEILING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4224
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4225
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4226
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4227
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4228
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4229
  /* RS[]:         Read Store                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4230
  /* Opcode range: 0x43                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4231
  /* Stack:        uint32 --> uint32                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4232
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4233
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4234
  Ins_RS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4235
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4236
    DO_RS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4237
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4238
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4239
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4240
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4241
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4242
  /* WS[]:         Write Store                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4243
  /* Opcode range: 0x42                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4244
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4245
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4246
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4247
  Ins_WS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4248
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4249
    DO_WS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4250
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4251
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4252
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4253
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4254
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4255
  /* WCVTP[]:      Write CVT in Pixel units                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4256
  /* Opcode range: 0x44                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4257
  /* Stack:        f26.6 uint32 -->                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4258
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4259
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4260
  Ins_WCVTP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4261
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4262
    DO_WCVTP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4263
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4264
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4265
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4266
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4267
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4268
  /* WCVTF[]:      Write CVT in Funits                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4269
  /* Opcode range: 0x70                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4270
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4271
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4272
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4273
  Ins_WCVTF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4274
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4275
    DO_WCVTF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4276
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4277
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4278
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4279
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4280
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4281
  /* RCVT[]:       Read CVT                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4282
  /* Opcode range: 0x45                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4283
  /* Stack:        uint32 --> f26.6                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4284
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4285
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4286
  Ins_RCVT( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4287
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4288
    DO_RCVT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4289
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4290
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4291
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4292
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4293
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4294
  /* AA[]:         Adjust Angle                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4295
  /* Opcode range: 0x7F                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4296
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4297
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4298
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4299
  Ins_AA( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4300
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4301
    /* intentionally no longer supported */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4302
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4303
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4304
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4305
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4306
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4307
  /* DEBUG[]:      DEBUG.  Unsupported.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4308
  /* Opcode range: 0x4F                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4309
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4310
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4311
  /* Note: The original instruction pops a value from the stack.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4312
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4313
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4314
  Ins_DEBUG( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4315
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4316
    DO_DEBUG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4317
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4318
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4319
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4320
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4321
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4322
  /* ROUND[ab]:    ROUND value                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4323
  /* Opcode range: 0x68-0x6B                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4324
  /* Stack:        f26.6 --> f26.6                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4325
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4326
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4327
  Ins_ROUND( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4328
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4329
    DO_ROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4330
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4331
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4332
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4333
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4334
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4335
  /* NROUND[ab]:   No ROUNDing of value                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4336
  /* Opcode range: 0x6C-0x6F                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4337
  /* Stack:        f26.6 --> f26.6                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4338
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4339
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4340
  Ins_NROUND( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4341
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4342
    DO_NROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4343
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4344
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4345
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4346
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4347
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4348
  /* MAX[]:        MAXimum                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4349
  /* Opcode range: 0x68                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4350
  /* Stack:        int32? int32? --> int32                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4351
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4352
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4353
  Ins_MAX( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4354
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4355
    DO_MAX
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4356
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4357
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4358
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4359
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4360
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4361
  /* MIN[]:        MINimum                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4362
  /* Opcode range: 0x69                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4363
  /* Stack:        int32? int32? --> int32                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4364
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4365
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4366
  Ins_MIN( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4367
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4368
    DO_MIN
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4369
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4370
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4371
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4372
#endif  /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4373
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4374
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4375
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4376
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4377
  /* The following functions are called as is within the switch statement. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4378
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4379
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4380
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4381
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4382
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4383
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4384
  /* MINDEX[]:     Move INDEXed element                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4385
  /* Opcode range: 0x26                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4386
  /* Stack:        int32? --> StkElt                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4387
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4388
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4389
  Ins_MINDEX( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4390
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4391
    FT_Long  L, K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4392
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4393
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4394
    L = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4395
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4396
    if ( L <= 0 || L > CUR.args )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4397
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4398
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4399
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4400
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4401
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4402
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4403
      K = CUR.stack[CUR.args - L];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4404
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4405
      FT_ARRAY_MOVE( &CUR.stack[CUR.args - L    ],
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4406
                     &CUR.stack[CUR.args - L + 1],
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4407
                     ( L - 1 ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4408
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4409
      CUR.stack[CUR.args - 1] = K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4410
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4411
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4412
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4413
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4414
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4415
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4416
  /* ROLL[]:       ROLL top three elements                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4417
  /* Opcode range: 0x8A                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4418
  /* Stack:        3 * StkElt --> 3 * StkElt                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4419
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4420
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4421
  Ins_ROLL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4422
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4423
    FT_Long  A, B, C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4424
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4425
    FT_UNUSED_EXEC;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4426
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4427
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4428
    A = args[2];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4429
    B = args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4430
    C = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4431
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4432
    args[2] = C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4433
    args[1] = A;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4434
    args[0] = B;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4435
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4436
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4437
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4438
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4439
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4440
  /* MANAGING THE FLOW OF CONTROL                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4441
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4442
  /*   Instructions appear in the specification's order.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4443
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4444
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4445
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4446
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4447
  static FT_Bool
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4448
  SkipCode( EXEC_OP )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4449
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4450
    CUR.IP += CUR.length;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4451
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4452
    if ( CUR.IP < CUR.codeSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4453
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4454
      CUR.opcode = CUR.code[CUR.IP];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4455
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4456
      CUR.length = opcode_length[CUR.opcode];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4457
      if ( CUR.length < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4458
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4459
        if ( CUR.IP + 1 > CUR.codeSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4460
          goto Fail_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4461
        CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4462
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4463
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4464
      if ( CUR.IP + CUR.length <= CUR.codeSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4465
        return SUCCESS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4466
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4467
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4468
  Fail_Overflow:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4469
    CUR.error = TT_Err_Code_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4470
    return FAILURE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4471
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4472
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4473
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4474
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4475
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4476
  /* IF[]:         IF test                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4477
  /* Opcode range: 0x58                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4478
  /* Stack:        StkElt -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4479
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4480
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4481
  Ins_IF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4482
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4483
    FT_Int   nIfs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4484
    FT_Bool  Out;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4485
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4486
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4487
    if ( args[0] != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4488
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4489
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4490
    nIfs = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4491
    Out = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4492
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4493
    do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4494
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4495
      if ( SKIP_Code() == FAILURE )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4496
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4497
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4498
      switch ( CUR.opcode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4499
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4500
      case 0x58:      /* IF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4501
        nIfs++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4502
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4503
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4504
      case 0x1B:      /* ELSE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4505
        Out = FT_BOOL( nIfs == 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4506
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4507
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4508
      case 0x59:      /* EIF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4509
        nIfs--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4510
        Out = FT_BOOL( nIfs == 0 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4511
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4512
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4513
    } while ( Out == 0 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4514
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4515
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4516
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4517
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4518
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4519
  /* ELSE[]:       ELSE                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4520
  /* Opcode range: 0x1B                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4521
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4522
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4523
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4524
  Ins_ELSE( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4525
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4526
    FT_Int  nIfs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4527
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4528
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4529
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4530
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4531
    nIfs = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4532
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4533
    do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4534
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4535
      if ( SKIP_Code() == FAILURE )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4536
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4537
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4538
      switch ( CUR.opcode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4539
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4540
      case 0x58:    /* IF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4541
        nIfs++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4542
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4543
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4544
      case 0x59:    /* EIF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4545
        nIfs--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4546
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4547
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4548
    } while ( nIfs != 0 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4549
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4550
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4551
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4552
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4553
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4554
  /* DEFINING AND USING FUNCTIONS AND INSTRUCTIONS                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4555
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4556
  /*   Instructions appear in the specification's order.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4557
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4558
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4559
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4560
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4561
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4562
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4563
  /* FDEF[]:       Function DEFinition                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4564
  /* Opcode range: 0x2C                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4565
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4566
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4567
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4568
  Ins_FDEF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4569
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4570
    FT_ULong       n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4571
    TT_DefRecord*  rec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4572
    TT_DefRecord*  limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4573
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4574
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4575
    /* some font programs are broken enough to redefine functions! */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4576
    /* We will then parse the current table.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4577
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4578
    rec   = CUR.FDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4579
    limit = rec + CUR.numFDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4580
    n     = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4581
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4582
    for ( ; rec < limit; rec++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4583
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4584
      if ( rec->opc == n )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4585
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4586
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4587
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4588
    if ( rec == limit )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4589
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4590
      /* check that there is enough room for new functions */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4591
      if ( CUR.numFDefs >= CUR.maxFDefs )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4592
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4593
        CUR.error = TT_Err_Too_Many_Function_Defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4594
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4595
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4596
      CUR.numFDefs++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4597
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4598
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4599
    /* Although FDEF takes unsigned 32-bit integer,  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4600
    /* func # must be within unsigned 16-bit integer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4601
    if ( n > 0xFFFFU )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4602
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4603
      CUR.error = TT_Err_Too_Many_Function_Defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4604
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4605
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4606
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4607
    rec->range  = CUR.curRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4608
    rec->opc    = (FT_UInt16)n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4609
    rec->start  = CUR.IP + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4610
    rec->active = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4611
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4612
    if ( n > CUR.maxFunc )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4613
      CUR.maxFunc = (FT_UInt16)n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4614
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4615
    /* Now skip the whole function definition. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4616
    /* We don't allow nested IDEFS & FDEFs.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4617
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4618
    while ( SKIP_Code() == SUCCESS )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4619
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4620
      switch ( CUR.opcode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4621
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4622
      case 0x89:    /* IDEF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4623
      case 0x2C:    /* FDEF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4624
        CUR.error = TT_Err_Nested_DEFS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4625
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4626
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4627
      case 0x2D:   /* ENDF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4628
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4629
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4630
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4631
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4632
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4633
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4634
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4635
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4636
  /* ENDF[]:       END Function definition                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4637
  /* Opcode range: 0x2D                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4638
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4639
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4640
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4641
  Ins_ENDF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4642
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4643
    TT_CallRec*  pRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4644
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4645
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4646
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4647
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4648
    if ( CUR.callTop <= 0 )     /* We encountered an ENDF without a call */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4649
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4650
      CUR.error = TT_Err_ENDF_In_Exec_Stream;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4651
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4652
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4653
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4654
    CUR.callTop--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4655
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4656
    pRec = &CUR.callStack[CUR.callTop];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4657
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4658
    pRec->Cur_Count--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4659
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4660
    CUR.step_ins = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4661
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4662
    if ( pRec->Cur_Count > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4663
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4664
      CUR.callTop++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4665
      CUR.IP = pRec->Cur_Restart;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4666
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4667
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4668
      /* Loop through the current function */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4669
      INS_Goto_CodeRange( pRec->Caller_Range,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4670
                          pRec->Caller_IP );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4671
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4672
    /* Exit the current call frame.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4673
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4674
    /* NOTE: If the last instruction of a program is a   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4675
    /*       CALL or LOOPCALL, the return address is     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4676
    /*       always out of the code range.  This is a    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4677
    /*       valid address, and it is why we do not test */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4678
    /*       the result of Ins_Goto_CodeRange() here!    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4679
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4680
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4681
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4682
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4683
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4684
  /* CALL[]:       CALL function                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4685
  /* Opcode range: 0x2B                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4686
  /* Stack:        uint32? -->                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4687
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4688
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4689
  Ins_CALL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4690
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4691
    FT_ULong       F;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4692
    TT_CallRec*    pCrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4693
    TT_DefRecord*  def;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4694
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4695
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4696
    /* first of all, check the index */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4697
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4698
    F = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4699
    if ( BOUNDSL( F, CUR.maxFunc + 1 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4700
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4701
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4702
    /* Except for some old Apple fonts, all functions in a TrueType */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4703
    /* font are defined in increasing order, starting from 0.  This */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4704
    /* means that we normally have                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4705
    /*                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4706
    /*    CUR.maxFunc+1 == CUR.numFDefs                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4707
    /*    CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4708
    /*                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4709
    /* If this isn't true, we need to look up the function table.   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4710
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4711
    def = CUR.FDefs + F;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4712
    if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4713
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4714
      /* look up the FDefs table */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4715
      TT_DefRecord*  limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4716
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4717
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4718
      def   = CUR.FDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4719
      limit = def + CUR.numFDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4720
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4721
      while ( def < limit && def->opc != F )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4722
        def++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4723
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4724
      if ( def == limit )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4725
        goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4726
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4727
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4728
    /* check that the function is active */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4729
    if ( !def->active )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4730
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4731
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4732
    /* check the call stack */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4733
    if ( CUR.callTop >= CUR.callSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4734
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4735
      CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4736
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4737
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4738
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4739
    pCrec = CUR.callStack + CUR.callTop;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4740
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4741
    pCrec->Caller_Range = CUR.curRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4742
    pCrec->Caller_IP    = CUR.IP + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4743
    pCrec->Cur_Count    = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4744
    pCrec->Cur_Restart  = def->start;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4745
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4746
    CUR.callTop++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4747
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4748
    INS_Goto_CodeRange( def->range,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4749
                        def->start );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4750
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4751
    CUR.step_ins = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4752
    return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4753
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4754
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4755
    CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4756
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4757
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4758
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4759
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4760
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4761
  /* LOOPCALL[]:   LOOP and CALL function                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4762
  /* Opcode range: 0x2A                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4763
  /* Stack:        uint32? Eint16? -->                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4764
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4765
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4766
  Ins_LOOPCALL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4767
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4768
    FT_ULong       F;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4769
    TT_CallRec*    pCrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4770
    TT_DefRecord*  def;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4771
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4772
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4773
    /* first of all, check the index */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4774
    F = args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4775
    if ( BOUNDSL( F, CUR.maxFunc + 1 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4776
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4777
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4778
    /* Except for some old Apple fonts, all functions in a TrueType */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4779
    /* font are defined in increasing order, starting from 0.  This */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4780
    /* means that we normally have                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4781
    /*                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4782
    /*    CUR.maxFunc+1 == CUR.numFDefs                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4783
    /*    CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4784
    /*                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4785
    /* If this isn't true, we need to look up the function table.   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4786
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4787
    def = CUR.FDefs + F;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4788
    if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4789
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4790
      /* look up the FDefs table */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4791
      TT_DefRecord*  limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4792
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4793
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4794
      def   = CUR.FDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4795
      limit = def + CUR.numFDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4796
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4797
      while ( def < limit && def->opc != F )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4798
        def++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4799
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4800
      if ( def == limit )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4801
        goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4802
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4803
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4804
    /* check that the function is active */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4805
    if ( !def->active )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4806
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4807
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4808
    /* check stack */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4809
    if ( CUR.callTop >= CUR.callSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4810
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4811
      CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4812
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4813
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4814
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4815
    if ( args[0] > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4816
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4817
      pCrec = CUR.callStack + CUR.callTop;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4818
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4819
      pCrec->Caller_Range = CUR.curRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4820
      pCrec->Caller_IP    = CUR.IP + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4821
      pCrec->Cur_Count    = (FT_Int)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4822
      pCrec->Cur_Restart  = def->start;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4823
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4824
      CUR.callTop++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4825
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4826
      INS_Goto_CodeRange( def->range, def->start );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4827
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4828
      CUR.step_ins = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4829
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4830
    return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4831
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4832
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4833
    CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4834
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4835
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4836
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4837
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4838
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4839
  /* IDEF[]:       Instruction DEFinition                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4840
  /* Opcode range: 0x89                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4841
  /* Stack:        Eint8 -->                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4842
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4843
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4844
  Ins_IDEF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4845
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4846
    TT_DefRecord*  def;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4847
    TT_DefRecord*  limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4848
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4849
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4850
    /*  First of all, look for the same function in our table */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4851
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4852
    def   = CUR.IDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4853
    limit = def + CUR.numIDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4854
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4855
    for ( ; def < limit; def++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4856
      if ( def->opc == (FT_ULong)args[0] )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4857
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4858
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4859
    if ( def == limit )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4860
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4861
      /* check that there is enough room for a new instruction */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4862
      if ( CUR.numIDefs >= CUR.maxIDefs )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4863
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4864
        CUR.error = TT_Err_Too_Many_Instruction_Defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4865
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4866
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4867
      CUR.numIDefs++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4868
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4869
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4870
    /* opcode must be unsigned 8-bit integer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4871
    if ( 0 > args[0] || args[0] > 0x00FF )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4872
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4873
      CUR.error = TT_Err_Too_Many_Instruction_Defs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4874
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4875
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4876
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4877
    def->opc    = (FT_Byte)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4878
    def->start  = CUR.IP + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4879
    def->range  = CUR.curRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4880
    def->active = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4881
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4882
    if ( (FT_ULong)args[0] > CUR.maxIns )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4883
      CUR.maxIns = (FT_Byte)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4884
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4885
    /* Now skip the whole function definition. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4886
    /* We don't allow nested IDEFs & FDEFs.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4887
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4888
    while ( SKIP_Code() == SUCCESS )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4889
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4890
      switch ( CUR.opcode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4891
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4892
      case 0x89:   /* IDEF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4893
      case 0x2C:   /* FDEF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4894
        CUR.error = TT_Err_Nested_DEFS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4895
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4896
      case 0x2D:   /* ENDF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4897
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4898
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4899
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4900
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4901
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4902
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4903
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4904
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4905
  /* PUSHING DATA ONTO THE INTERPRETER STACK                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4906
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4907
  /*   Instructions appear in the specification's order.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4908
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4909
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4910
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4911
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4912
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4913
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4914
  /* NPUSHB[]:     PUSH N Bytes                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4915
  /* Opcode range: 0x40                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4916
  /* Stack:        --> uint32...                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4917
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4918
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4919
  Ins_NPUSHB( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4920
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4921
    FT_UShort  L, K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4922
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4923
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4924
    L = (FT_UShort)CUR.code[CUR.IP + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4925
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4926
    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4927
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4928
      CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4929
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4930
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4931
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4932
    for ( K = 1; K <= L; K++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4933
      args[K - 1] = CUR.code[CUR.IP + K + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4934
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4935
    CUR.new_top += L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4936
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4937
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4938
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4939
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4940
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4941
  /* NPUSHW[]:     PUSH N Words                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4942
  /* Opcode range: 0x41                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4943
  /* Stack:        --> int32...                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4944
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4945
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4946
  Ins_NPUSHW( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4947
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4948
    FT_UShort  L, K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4949
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4950
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4951
    L = (FT_UShort)CUR.code[CUR.IP + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4952
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4953
    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4954
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4955
      CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4956
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4957
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4958
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4959
    CUR.IP += 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4960
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4961
    for ( K = 0; K < L; K++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4962
      args[K] = GET_ShortIns();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4963
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4964
    CUR.step_ins = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4965
    CUR.new_top += L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4966
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4967
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4968
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4969
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4970
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4971
  /* PUSHB[abc]:   PUSH Bytes                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4972
  /* Opcode range: 0xB0-0xB7                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4973
  /* Stack:        --> uint32...                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4974
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4975
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4976
  Ins_PUSHB( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4977
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4978
    FT_UShort  L, K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4979
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4980
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4981
    L = (FT_UShort)( CUR.opcode - 0xB0 + 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4982
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4983
    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4984
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4985
      CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4986
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4987
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4988
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4989
    for ( K = 1; K <= L; K++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4990
      args[K - 1] = CUR.code[CUR.IP + K];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4991
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4992
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4993
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4994
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4995
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4996
  /* PUSHW[abc]:   PUSH Words                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4997
  /* Opcode range: 0xB8-0xBF                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4998
  /* Stack:        --> int32...                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  4999
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5000
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5001
  Ins_PUSHW( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5002
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5003
    FT_UShort  L, K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5004
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5005
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5006
    L = (FT_UShort)( CUR.opcode - 0xB8 + 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5007
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5008
    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5009
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5010
      CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5011
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5012
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5013
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5014
    CUR.IP++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5015
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5016
    for ( K = 0; K < L; K++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5017
      args[K] = GET_ShortIns();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5018
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5019
    CUR.step_ins = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5020
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5021
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5022
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5023
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5024
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5025
  /* MANAGING THE GRAPHICS STATE                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5026
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5027
  /*  Instructions appear in the specs' order.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5028
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5029
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5030
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5031
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5032
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5033
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5034
  /* GC[a]:        Get Coordinate projected onto                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5035
  /* Opcode range: 0x46-0x47                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5036
  /* Stack:        uint32 --> f26.6                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5037
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5038
  /* BULLSHIT: Measures from the original glyph must be taken along the    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5039
  /*           dual projection vector!                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5040
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5041
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5042
  Ins_GC( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5043
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5044
    FT_ULong    L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5045
    FT_F26Dot6  R;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5046
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5047
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5048
    L = (FT_ULong)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5049
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5050
    if ( BOUNDSL( L, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5051
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5052
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5053
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5054
      R = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5055
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5056
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5057
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5058
      if ( CUR.opcode & 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5059
        R = CUR_fast_dualproj( &CUR.zp2.org[L] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5060
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5061
        R = CUR_fast_project( &CUR.zp2.cur[L] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5062
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5063
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5064
    args[0] = R;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5065
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5066
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5067
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5068
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5069
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5070
  /* SCFS[]:       Set Coordinate From Stack                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5071
  /* Opcode range: 0x48                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5072
  /* Stack:        f26.6 uint32 -->                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5073
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5074
  /* Formula:                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5075
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5076
  /*   OA := OA + ( value - OA.p )/( f.p ) * f                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5077
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5078
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5079
  Ins_SCFS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5080
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5081
    FT_Long    K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5082
    FT_UShort  L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5083
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5084
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5085
    L = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5086
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5087
    if ( BOUNDS( L, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5088
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5089
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5090
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5091
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5092
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5093
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5094
    K = CUR_fast_project( &CUR.zp2.cur[L] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5095
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5096
    CUR_Func_move( &CUR.zp2, L, args[1] - K );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5097
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5098
    /* not part of the specs, but here for safety */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5099
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5100
    if ( CUR.GS.gep2 == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5101
      CUR.zp2.org[L] = CUR.zp2.cur[L];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5102
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5103
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5104
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5105
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5106
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5107
  /* MD[a]:        Measure Distance                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5108
  /* Opcode range: 0x49-0x4A                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5109
  /* Stack:        uint32 uint32 --> f26.6                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5110
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5111
  /* BULLSHIT: Measure taken in the original glyph must be along the dual  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5112
  /*           projection vector.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5113
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5114
  /* Second BULLSHIT: Flag attributes are inverted!                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5115
  /*                  0 => measure distance in original outline            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5116
  /*                  1 => measure distance in grid-fitted outline         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5117
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5118
  /* Third one: `zp0 - zp1', and not `zp2 - zp1!                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5119
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5120
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5121
  Ins_MD( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5122
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5123
    FT_UShort   K, L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5124
    FT_F26Dot6  D;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5125
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5126
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5127
    K = (FT_UShort)args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5128
    L = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5130
    if ( BOUNDS( L, CUR.zp0.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5131
         BOUNDS( K, CUR.zp1.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5132
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5133
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5134
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5135
      D = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5136
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5137
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5138
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5139
      if ( CUR.opcode & 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5140
        D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5141
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5142
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5143
        FT_Vector*  vec1 = CUR.zp0.orus + L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5144
        FT_Vector*  vec2 = CUR.zp1.orus + K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5145
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5146
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5147
        if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5148
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5149
          /* this should be faster */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5150
          D = CUR_Func_dualproj( vec1, vec2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5151
          D = TT_MULFIX( D, CUR.metrics.x_scale );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5152
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5153
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5154
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5155
          FT_Vector  vec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5156
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5157
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5158
          vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5159
          vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5160
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5161
          D = CUR_fast_dualproj( &vec );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5162
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5163
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5164
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5165
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5166
    args[0] = D;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5167
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5168
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5169
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5170
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5171
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5172
  /* SDPVTL[a]:    Set Dual PVector to Line                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5173
  /* Opcode range: 0x86-0x87                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5174
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5175
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5176
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5177
  Ins_SDPVTL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5178
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5179
    FT_Long    A, B, C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5180
    FT_UShort  p1, p2;   /* was FT_Int in pas type ERROR */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5181
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5182
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5183
    p1 = (FT_UShort)args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5184
    p2 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5185
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5186
    if ( BOUNDS( p2, CUR.zp1.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5187
         BOUNDS( p1, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5188
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5189
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5190
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5191
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5192
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5193
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5194
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5195
      FT_Vector* v1 = CUR.zp1.org + p2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5196
      FT_Vector* v2 = CUR.zp2.org + p1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5197
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5198
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5199
      A = v1->x - v2->x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5200
      B = v1->y - v2->y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5201
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5202
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5203
    if ( ( CUR.opcode & 1 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5204
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5205
      C =  B;   /* counter clockwise rotation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5206
      B =  A;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5207
      A = -C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5208
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5209
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5210
    NORMalize( A, B, &CUR.GS.dualVector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5211
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5212
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5213
      FT_Vector*  v1 = CUR.zp1.cur + p2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5214
      FT_Vector*  v2 = CUR.zp2.cur + p1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5215
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5216
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5217
      A = v1->x - v2->x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5218
      B = v1->y - v2->y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5219
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5220
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5221
    if ( ( CUR.opcode & 1 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5222
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5223
      C =  B;   /* counter clockwise rotation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5224
      B =  A;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5225
      A = -C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5226
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5227
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5228
    NORMalize( A, B, &CUR.GS.projVector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5229
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5230
    GUESS_VECTOR( freeVector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5231
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5232
    COMPUTE_Funcs();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5233
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5234
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5235
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5236
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5237
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5238
  /* SZP0[]:       Set Zone Pointer 0                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5239
  /* Opcode range: 0x13                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5240
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5241
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5242
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5243
  Ins_SZP0( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5244
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5245
    switch ( (FT_Int)args[0] )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5246
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5247
    case 0:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5248
      CUR.zp0 = CUR.twilight;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5249
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5250
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5251
    case 1:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5252
      CUR.zp0 = CUR.pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5253
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5254
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5255
    default:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5256
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5257
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5258
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5259
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5260
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5261
    CUR.GS.gep0 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5262
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5263
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5264
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5265
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5266
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5267
  /* SZP1[]:       Set Zone Pointer 1                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5268
  /* Opcode range: 0x14                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5269
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5270
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5271
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5272
  Ins_SZP1( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5273
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5274
    switch ( (FT_Int)args[0] )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5275
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5276
    case 0:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5277
      CUR.zp1 = CUR.twilight;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5278
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5279
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5280
    case 1:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5281
      CUR.zp1 = CUR.pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5282
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5283
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5284
    default:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5285
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5286
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5287
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5288
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5289
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5290
    CUR.GS.gep1 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5291
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5292
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5293
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5294
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5295
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5296
  /* SZP2[]:       Set Zone Pointer 2                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5297
  /* Opcode range: 0x15                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5298
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5299
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5300
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5301
  Ins_SZP2( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5302
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5303
    switch ( (FT_Int)args[0] )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5304
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5305
    case 0:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5306
      CUR.zp2 = CUR.twilight;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5307
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5308
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5309
    case 1:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5310
      CUR.zp2 = CUR.pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5311
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5312
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5313
    default:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5314
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5315
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5316
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5317
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5318
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5319
    CUR.GS.gep2 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5320
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5321
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5322
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5323
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5324
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5325
  /* SZPS[]:       Set Zone PointerS                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5326
  /* Opcode range: 0x16                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5327
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5328
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5329
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5330
  Ins_SZPS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5331
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5332
    switch ( (FT_Int)args[0] )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5333
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5334
    case 0:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5335
      CUR.zp0 = CUR.twilight;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5336
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5337
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5338
    case 1:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5339
      CUR.zp0 = CUR.pts;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5340
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5341
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5342
    default:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5343
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5344
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5345
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5346
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5347
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5348
    CUR.zp1 = CUR.zp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5349
    CUR.zp2 = CUR.zp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5350
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5351
    CUR.GS.gep0 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5352
    CUR.GS.gep1 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5353
    CUR.GS.gep2 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5354
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5355
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5356
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5357
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5358
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5359
  /* INSTCTRL[]:   INSTruction ConTRoL                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5360
  /* Opcode range: 0x8e                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5361
  /* Stack:        int32 int32 -->                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5362
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5363
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5364
  Ins_INSTCTRL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5365
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5366
    FT_Long  K, L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5367
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5368
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5369
    K = args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5370
    L = args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5371
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5372
    if ( K < 1 || K > 2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5373
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5374
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5375
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5376
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5377
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5378
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5379
    if ( L != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5380
        L = K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5381
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5382
    CUR.GS.instruct_control = FT_BOOL(
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5383
      ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5384
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5385
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5386
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5387
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5388
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5389
  /* SCANCTRL[]:   SCAN ConTRoL                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5390
  /* Opcode range: 0x85                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5391
  /* Stack:        uint32? -->                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5392
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5393
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5394
  Ins_SCANCTRL( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5395
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5396
    FT_Int  A;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5397
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5398
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5399
    /* Get Threshold */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5400
    A = (FT_Int)( args[0] & 0xFF );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5401
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5402
    if ( A == 0xFF )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5403
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5404
      CUR.GS.scan_control = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5405
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5406
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5407
    else if ( A == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5408
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5409
      CUR.GS.scan_control = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5410
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5411
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5412
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5413
    if ( ( args[0] & 0x100 ) != 0 && CUR.tt_metrics.ppem <= A )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5414
      CUR.GS.scan_control = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5415
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5416
    if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5417
      CUR.GS.scan_control = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5418
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5419
    if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5420
      CUR.GS.scan_control = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5421
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5422
    if ( ( args[0] & 0x800 ) != 0 && CUR.tt_metrics.ppem > A )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5423
      CUR.GS.scan_control = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5424
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5425
    if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5426
      CUR.GS.scan_control = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5427
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5428
    if ( ( args[0] & 0x2000 ) != 0 && CUR.tt_metrics.stretched )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5429
      CUR.GS.scan_control = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5430
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5431
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5432
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5433
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5434
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5435
  /* SCANTYPE[]:   SCAN TYPE                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5436
  /* Opcode range: 0x8D                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5437
  /* Stack:        uint32? -->                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5438
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5439
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5440
  Ins_SCANTYPE( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5441
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5442
    if ( args[0] >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5443
      CUR.GS.scan_type = (FT_Int)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5444
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5445
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5446
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5447
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5448
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5449
  /* MANAGING OUTLINES                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5450
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5451
  /*   Instructions appear in the specification's order.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5452
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5453
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5454
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5455
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5456
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5457
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5458
  /* FLIPPT[]:     FLIP PoinT                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5459
  /* Opcode range: 0x80                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5460
  /* Stack:        uint32... -->                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5461
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5462
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5463
  Ins_FLIPPT( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5464
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5465
    FT_UShort  point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5466
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5467
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5468
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5469
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5470
    if ( CUR.top < CUR.GS.loop )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5471
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5472
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5473
        CUR.error = TT_Err_Too_Few_Arguments;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5474
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5475
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5476
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5477
    while ( CUR.GS.loop > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5478
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5479
      CUR.args--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5480
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5481
      point = (FT_UShort)CUR.stack[CUR.args];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5482
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5483
      if ( BOUNDS( point, CUR.pts.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5484
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5485
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5486
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5487
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5488
          return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5489
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5490
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5491
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5492
        CUR.pts.tags[point] ^= FT_CURVE_TAG_ON;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5493
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5494
      CUR.GS.loop--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5495
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5496
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5497
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5498
    CUR.GS.loop = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5499
    CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5500
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5501
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5502
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5503
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5504
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5505
  /* FLIPRGON[]:   FLIP RanGe ON                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5506
  /* Opcode range: 0x81                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5507
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5508
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5509
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5510
  Ins_FLIPRGON( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5511
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5512
    FT_UShort  I, K, L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5513
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5514
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5515
    K = (FT_UShort)args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5516
    L = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5517
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5518
    if ( BOUNDS( K, CUR.pts.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5519
         BOUNDS( L, CUR.pts.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5520
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5521
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5522
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5523
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5524
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5525
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5526
    for ( I = L; I <= K; I++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5527
      CUR.pts.tags[I] |= FT_CURVE_TAG_ON;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5528
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5529
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5530
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5531
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5532
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5533
  /* FLIPRGOFF:    FLIP RanGe OFF                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5534
  /* Opcode range: 0x82                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5535
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5536
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5537
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5538
  Ins_FLIPRGOFF( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5539
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5540
    FT_UShort  I, K, L;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5541
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5542
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5543
    K = (FT_UShort)args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5544
    L = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5545
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5546
    if ( BOUNDS( K, CUR.pts.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5547
         BOUNDS( L, CUR.pts.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5548
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5549
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5550
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5551
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5552
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5553
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5554
    for ( I = L; I <= K; I++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5555
      CUR.pts.tags[I] &= ~FT_CURVE_TAG_ON;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5556
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5557
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5558
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5559
  static FT_Bool
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5560
  Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6*   x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5561
                                       FT_F26Dot6*   y,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5562
                                       TT_GlyphZone  zone,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5563
                                       FT_UShort*    refp )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5564
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5565
    TT_GlyphZoneRec  zp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5566
    FT_UShort        p;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5567
    FT_F26Dot6       d;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5568
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5569
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5570
    if ( CUR.opcode & 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5571
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5572
      zp = CUR.zp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5573
      p  = CUR.GS.rp1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5574
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5575
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5576
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5577
      zp = CUR.zp1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5578
      p  = CUR.GS.rp2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5579
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5580
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5581
    if ( BOUNDS( p, zp.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5582
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5583
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5584
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5585
      *refp = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5586
      return FAILURE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5587
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5588
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5589
    *zone = zp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5590
    *refp = p;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5591
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5592
    d = CUR_Func_project( zp.cur + p, zp.org + p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5593
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5594
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5595
    if ( CUR.face->unpatented_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5596
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5597
      if ( CUR.GS.both_x_axis )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5598
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5599
        *x = d;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5600
        *y = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5601
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5602
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5603
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5604
        *x = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5605
        *y = d;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5606
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5607
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5608
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5609
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5610
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5611
      *x = TT_MULDIV( d,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5612
                      (FT_Long)CUR.GS.freeVector.x * 0x10000L,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5613
                      CUR.F_dot_P );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5614
      *y = TT_MULDIV( d,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5615
                      (FT_Long)CUR.GS.freeVector.y * 0x10000L,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5616
                      CUR.F_dot_P );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5617
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5618
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5619
    return SUCCESS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5620
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5621
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5622
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5623
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5624
  Move_Zp2_Point( EXEC_OP_ FT_UShort   point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5625
                           FT_F26Dot6  dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5626
                           FT_F26Dot6  dy,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5627
                           FT_Bool     touch )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5628
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5629
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5630
    if ( CUR.face->unpatented_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5631
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5632
      if ( CUR.GS.both_x_axis )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5633
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5634
        CUR.zp2.cur[point].x += dx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5635
        if ( touch )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5636
          CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5637
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5638
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5639
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5640
        CUR.zp2.cur[point].y += dy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5641
        if ( touch )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5642
          CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5643
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5644
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5645
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5646
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5647
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5648
    if ( CUR.GS.freeVector.x != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5649
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5650
      CUR.zp2.cur[point].x += dx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5651
      if ( touch )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5652
        CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5653
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5654
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5655
    if ( CUR.GS.freeVector.y != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5656
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5657
      CUR.zp2.cur[point].y += dy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5658
      if ( touch )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5659
        CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5660
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5661
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5662
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5663
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5664
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5665
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5666
  /* SHP[a]:       SHift Point by the last point                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5667
  /* Opcode range: 0x32-0x33                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5668
  /* Stack:        uint32... -->                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5669
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5670
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5671
  Ins_SHP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5672
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5673
    TT_GlyphZoneRec  zp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5674
    FT_UShort        refp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5675
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5676
    FT_F26Dot6       dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5677
                     dy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5678
    FT_UShort        point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5679
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5680
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5681
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5682
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5683
    if ( CUR.top < CUR.GS.loop )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5684
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5685
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5686
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5687
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5688
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5689
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5690
    if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5691
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5692
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5693
    while ( CUR.GS.loop > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5694
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5695
      CUR.args--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5696
      point = (FT_UShort)CUR.stack[CUR.args];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5697
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5698
      if ( BOUNDS( point, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5699
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5700
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5701
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5702
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5703
          return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5704
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5705
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5706
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5707
        /* XXX: UNDOCUMENTED! SHP touches the points */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5708
        MOVE_Zp2_Point( point, dx, dy, TRUE );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5709
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5710
      CUR.GS.loop--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5711
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5712
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5713
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5714
    CUR.GS.loop = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5715
    CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5716
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5717
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5718
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5719
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5720
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5721
  /* SHC[a]:       SHift Contour                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5722
  /* Opcode range: 0x34-35                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5723
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5724
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5725
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5726
  Ins_SHC( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5727
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5728
    TT_GlyphZoneRec zp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5729
    FT_UShort       refp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5730
    FT_F26Dot6      dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5731
                    dy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5732
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5733
    FT_Short        contour;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5734
    FT_UShort       first_point, last_point, i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5735
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5736
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5737
    contour = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5738
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5739
    if ( BOUNDS( contour, CUR.pts.n_contours ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5740
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5741
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5742
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5743
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5744
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5745
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5746
    if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5747
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5748
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5749
    if ( contour == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5750
      first_point = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5751
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5752
      first_point = (FT_UShort)( CUR.pts.contours[contour - 1] + 1 -
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5753
                                 CUR.pts.first_point );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5754
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5755
    last_point = (FT_UShort)( CUR.pts.contours[contour] -
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5756
                              CUR.pts.first_point );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5757
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5758
    /* XXX: this is probably wrong... at least it prevents memory */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5759
    /*      corruption when zp2 is the twilight zone              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5760
    if ( BOUNDS( last_point, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5761
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5762
      if ( CUR.zp2.n_points > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5763
        last_point = (FT_UShort)(CUR.zp2.n_points - 1);
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5764
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5765
        last_point = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5766
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5767
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5768
    /* XXX: UNDOCUMENTED! SHC touches the points */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5769
    for ( i = first_point; i <= last_point; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5770
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5771
      if ( zp.cur != CUR.zp2.cur || refp != i )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5772
        MOVE_Zp2_Point( i, dx, dy, TRUE );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5773
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5774
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5775
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5776
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5777
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5778
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5779
  /* SHZ[a]:       SHift Zone                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5780
  /* Opcode range: 0x36-37                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5781
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5782
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5783
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5784
  Ins_SHZ( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5785
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5786
    TT_GlyphZoneRec  zp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5787
    FT_UShort        refp;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5788
    FT_F26Dot6       dx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5789
                     dy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5790
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5791
    FT_UShort        last_point, i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5792
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5793
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5794
    if ( BOUNDS( args[0], 2 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5795
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5796
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5797
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5798
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5799
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5800
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5801
    if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5802
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5803
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5804
    /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5805
    /*      Twilight zone has no contours, so use `n_points'.   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5806
    /*      Normal zone's `n_points' includes phantoms, so must */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5807
    /*      use end of last contour.                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5808
    if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5809
      last_point = (FT_UShort)( CUR.zp2.n_points - 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5810
    else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5811
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5812
      last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5813
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5814
      if ( BOUNDS( last_point, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5815
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5816
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5817
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5818
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5819
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5820
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5821
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5822
      last_point = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5823
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5824
    /* XXX: UNDOCUMENTED! SHZ doesn't touch the points */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5825
    for ( i = 0; i <= last_point; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5826
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5827
      if ( zp.cur != CUR.zp2.cur || refp != i )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5828
        MOVE_Zp2_Point( i, dx, dy, FALSE );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5829
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5830
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5831
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5832
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5833
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5834
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5835
  /* SHPIX[]:      SHift points by a PIXel amount                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5836
  /* Opcode range: 0x38                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5837
  /* Stack:        f26.6 uint32... -->                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5838
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5839
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5840
  Ins_SHPIX( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5841
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5842
    FT_F26Dot6  dx, dy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5843
    FT_UShort   point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5844
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5845
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5846
    if ( CUR.top < CUR.GS.loop + 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5847
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5848
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5849
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5850
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5851
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5852
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5853
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5854
    if ( CUR.face->unpatented_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5855
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5856
      if ( CUR.GS.both_x_axis )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5857
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5858
        dx = TT_MulFix14( (FT_UInt32)args[0], 0x4000 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5859
        dy = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5860
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5861
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5862
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5863
        dx = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5864
        dy = TT_MulFix14( (FT_UInt32)args[0], 0x4000 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5865
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5866
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5867
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5868
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5869
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5870
      dx = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.x );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5871
      dy = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.y );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5872
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5873
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5874
    while ( CUR.GS.loop > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5875
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5876
      CUR.args--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5877
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5878
      point = (FT_UShort)CUR.stack[CUR.args];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5879
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5880
      if ( BOUNDS( point, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5881
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5882
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5883
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5884
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5885
          return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5886
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5887
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5888
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5889
        MOVE_Zp2_Point( point, dx, dy, TRUE );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5890
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5891
      CUR.GS.loop--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5892
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5893
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5894
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5895
    CUR.GS.loop = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5896
    CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5897
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5898
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5899
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5900
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5901
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5902
  /* MSIRP[a]:     Move Stack Indirect Relative Position                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5903
  /* Opcode range: 0x3A-0x3B                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5904
  /* Stack:        f26.6 uint32 -->                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5905
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5906
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5907
  Ins_MSIRP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5908
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5909
    FT_UShort   point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5910
    FT_F26Dot6  distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5911
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5912
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5913
    point = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5914
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5915
    if ( BOUNDS( point,      CUR.zp1.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5916
         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5917
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5918
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5919
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5920
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5921
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5922
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5923
    /* XXX: UNDOCUMENTED! behaviour */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5924
    if ( CUR.GS.gep1 == 0 )   /* if the point that is to be moved */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5925
                              /* is in twilight zone              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5926
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5927
      CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5928
      CUR_Func_move_orig( &CUR.zp1, point, args[1] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5929
      CUR.zp1.cur[point] = CUR.zp1.org[point];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5930
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5931
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5932
    distance = CUR_Func_project( CUR.zp1.cur + point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5933
                                 CUR.zp0.cur + CUR.GS.rp0 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5934
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5935
    CUR_Func_move( &CUR.zp1, point, args[1] - distance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5936
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5937
    CUR.GS.rp1 = CUR.GS.rp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5938
    CUR.GS.rp2 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5939
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5940
    if ( ( CUR.opcode & 1 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5941
      CUR.GS.rp0 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5942
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5943
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5944
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5945
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5946
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5947
  /* MDAP[a]:      Move Direct Absolute Point                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5948
  /* Opcode range: 0x2E-0x2F                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5949
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5950
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5951
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5952
  Ins_MDAP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5953
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5954
    FT_UShort   point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5955
    FT_F26Dot6  cur_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5956
                distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5957
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5958
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5959
    point = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5960
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5961
    if ( BOUNDS( point, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5962
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5963
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5964
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5965
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5966
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5967
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5968
    /* XXX: Is there some undocumented feature while in the */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5969
    /*      twilight zone? ?                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5970
    if ( ( CUR.opcode & 1 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5971
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5972
      cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5973
      distance = CUR_Func_round( cur_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5974
                                 CUR.tt_metrics.compensations[0] ) - cur_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5975
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5976
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5977
      distance = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5978
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5979
    CUR_Func_move( &CUR.zp0, point, distance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5980
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5981
    CUR.GS.rp0 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5982
    CUR.GS.rp1 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5983
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5984
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5985
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5986
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5987
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5988
  /* MIAP[a]:      Move Indirect Absolute Point                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5989
  /* Opcode range: 0x3E-0x3F                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5990
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5991
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5992
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5993
  Ins_MIAP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5994
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5995
    FT_ULong    cvtEntry;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5996
    FT_UShort   point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5997
    FT_F26Dot6  distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5998
                org_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  5999
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6000
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6001
    cvtEntry = (FT_ULong)args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6002
    point    = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6003
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6004
    if ( BOUNDS( point,     CUR.zp0.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6005
         BOUNDSL( cvtEntry, CUR.cvtSize )      )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6006
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6007
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6008
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6009
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6010
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6011
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6012
    /* XXX: UNDOCUMENTED!                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6013
    /*                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6014
    /* The behaviour of an MIAP instruction is quite     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6015
    /* different when used in the twilight zone.         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6016
    /*                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6017
    /* First, no control value cut-in test is performed  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6018
    /* as it would fail anyway.  Second, the original    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6019
    /* point, i.e. (org_x,org_y) of zp0.point, is set    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6020
    /* to the absolute, unrounded distance found in      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6021
    /* the CVT.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6022
    /*                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6023
    /* This is used in the CVT programs of the Microsoft */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6024
    /* fonts Arial, Times, etc., in order to re-adjust   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6025
    /* some key font heights.  It allows the use of the  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6026
    /* IP instruction in the twilight zone, which        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6027
    /* otherwise would be `illegal' according to the     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6028
    /* specification.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6029
    /*                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6030
    /* We implement it with a special sequence for the   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6031
    /* twilight zone.  This is a bad hack, but it seems  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6032
    /* to work.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6033
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6034
    distance = CUR_Func_read_cvt( cvtEntry );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6035
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6036
    if ( CUR.GS.gep0 == 0 )   /* If in twilight zone */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6037
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6038
      CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance, CUR.GS.freeVector.x );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6039
      CUR.zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance, CUR.GS.freeVector.y ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6040
      CUR.zp0.cur[point]   = CUR.zp0.org[point];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6041
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6042
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6043
    org_dist = CUR_fast_project( &CUR.zp0.cur[point] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6044
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6045
    if ( ( CUR.opcode & 1 ) != 0 )   /* rounding and control cutin flag */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6046
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6047
      if ( FT_ABS( distance - org_dist ) > CUR.GS.control_value_cutin )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6048
        distance = org_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6049
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6050
      distance = CUR_Func_round( distance, CUR.tt_metrics.compensations[0] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6051
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6052
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6053
    CUR_Func_move( &CUR.zp0, point, distance - org_dist );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6054
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6055
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6056
    CUR.GS.rp0 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6057
    CUR.GS.rp1 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6058
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6059
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6060
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6061
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6062
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6063
  /* MDRP[abcde]:  Move Direct Relative Point                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6064
  /* Opcode range: 0xC0-0xDF                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6065
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6066
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6067
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6068
  Ins_MDRP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6069
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6070
    FT_UShort   point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6071
    FT_F26Dot6  org_dist, distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6072
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6073
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6074
    point = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6075
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6076
    if ( BOUNDS( point,      CUR.zp1.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6077
         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6078
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6079
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6080
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6081
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6082
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6083
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6084
    /* XXX: Is there some undocumented feature while in the */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6085
    /*      twilight zone?                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6086
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6087
    /* XXX: UNDOCUMENTED: twilight zone special case */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6088
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6089
    if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6090
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6091
      FT_Vector*  vec1 = &CUR.zp1.org[point];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6092
      FT_Vector*  vec2 = &CUR.zp0.org[CUR.GS.rp0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6093
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6094
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6095
      org_dist = CUR_Func_dualproj( vec1, vec2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6096
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6097
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6098
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6099
      FT_Vector*  vec1 = &CUR.zp1.orus[point];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6100
      FT_Vector*  vec2 = &CUR.zp0.orus[CUR.GS.rp0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6101
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6102
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6103
      if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6104
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6105
        /* this should be faster */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6106
        org_dist = CUR_Func_dualproj( vec1, vec2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6107
        org_dist = TT_MULFIX( org_dist, CUR.metrics.x_scale );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6108
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6109
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6110
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6111
        FT_Vector  vec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6112
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6113
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6114
        vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6115
        vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6116
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6117
        org_dist = CUR_fast_dualproj( &vec );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6118
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6119
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6120
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6121
    /* single width cut-in test */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6122
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6123
    if ( FT_ABS( org_dist - CUR.GS.single_width_value ) <
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6124
         CUR.GS.single_width_cutin )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6125
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6126
      if ( org_dist >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6127
        org_dist = CUR.GS.single_width_value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6128
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6129
        org_dist = -CUR.GS.single_width_value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6130
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6131
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6132
    /* round flag */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6133
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6134
    if ( ( CUR.opcode & 4 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6135
      distance = CUR_Func_round(
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6136
                   org_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6137
                   CUR.tt_metrics.compensations[CUR.opcode & 3] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6138
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6139
      distance = ROUND_None(
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6140
                   org_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6141
                   CUR.tt_metrics.compensations[CUR.opcode & 3] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6142
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6143
    /* minimum distance flag */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6144
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6145
    if ( ( CUR.opcode & 8 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6146
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6147
      if ( org_dist >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6148
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6149
        if ( distance < CUR.GS.minimum_distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6150
          distance = CUR.GS.minimum_distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6151
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6152
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6153
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6154
        if ( distance > -CUR.GS.minimum_distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6155
          distance = -CUR.GS.minimum_distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6156
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6157
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6158
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6159
    /* now move the point */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6160
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6161
    org_dist = CUR_Func_project( CUR.zp1.cur + point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6162
                                 CUR.zp0.cur + CUR.GS.rp0 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6163
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6164
    CUR_Func_move( &CUR.zp1, point, distance - org_dist );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6165
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6166
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6167
    CUR.GS.rp1 = CUR.GS.rp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6168
    CUR.GS.rp2 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6169
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6170
    if ( ( CUR.opcode & 16 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6171
      CUR.GS.rp0 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6172
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6173
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6174
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6175
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6176
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6177
  /* MIRP[abcde]:  Move Indirect Relative Point                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6178
  /* Opcode range: 0xE0-0xFF                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6179
  /* Stack:        int32? uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6180
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6181
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6182
  Ins_MIRP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6183
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6184
    FT_UShort   point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6185
    FT_ULong    cvtEntry;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6186
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6187
    FT_F26Dot6  cvt_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6188
                distance,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6189
                cur_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6190
                org_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6191
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6192
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6193
    point    = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6194
    cvtEntry = (FT_ULong)( args[1] + 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6195
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6196
    /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6197
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6198
    if ( BOUNDS( point,      CUR.zp1.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6199
         BOUNDSL( cvtEntry,  CUR.cvtSize + 1 )  ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6200
         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6201
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6202
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6203
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6204
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6205
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6206
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6207
    if ( !cvtEntry )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6208
      cvt_dist = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6209
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6210
      cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6211
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6212
    /* single width test */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6213
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6214
    if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) <
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6215
         CUR.GS.single_width_cutin )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6216
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6217
      if ( cvt_dist >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6218
        cvt_dist =  CUR.GS.single_width_value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6219
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6220
        cvt_dist = -CUR.GS.single_width_value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6221
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6222
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6223
    /* XXX: UNDOCUMENTED! -- twilight zone */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6224
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6225
    if ( CUR.GS.gep1 == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6226
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6227
      CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6228
                             TT_MulFix14( (FT_UInt32)cvt_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6229
                                          CUR.GS.freeVector.x );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6230
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6231
      CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6232
                             TT_MulFix14( (FT_UInt32)cvt_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6233
                                          CUR.GS.freeVector.y );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6234
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6235
      CUR.zp1.cur[point] = CUR.zp0.cur[point];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6236
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6237
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6238
    org_dist = CUR_Func_dualproj( &CUR.zp1.org[point],
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6239
                                  &CUR.zp0.org[CUR.GS.rp0] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6240
    cur_dist = CUR_Func_project ( &CUR.zp1.cur[point],
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6241
                                  &CUR.zp0.cur[CUR.GS.rp0] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6242
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6243
    /* auto-flip test */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6244
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6245
    if ( CUR.GS.auto_flip )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6246
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6247
      if ( ( org_dist ^ cvt_dist ) < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6248
        cvt_dist = -cvt_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6249
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6250
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6251
    /* control value cutin and round */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6252
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6253
    if ( ( CUR.opcode & 4 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6254
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6255
      /* XXX: UNDOCUMENTED!  Only perform cut-in test when both points */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6256
      /*      refer to the same zone.                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6257
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6258
      if ( CUR.GS.gep0 == CUR.GS.gep1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6259
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6260
        /* XXX: According to Greg Hitchcock, the following wording is */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6261
        /*      the right one:                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6262
        /*                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6263
        /*        When the absolute difference between the value in   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6264
        /*        the table [CVT] and the measurement directly from   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6265
        /*        the outline is _greater_ than the cut_in value, the */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6266
        /*        outline measurement is used.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6267
        /*                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6268
        /*      This is from `instgly.doc'.  The description in       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6269
        /*      `ttinst2.doc', version 1.66, is thus incorrect since  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6270
        /*      it implies `>=' instead of `>'.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6271
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6272
        if ( FT_ABS( cvt_dist - org_dist ) > CUR.GS.control_value_cutin )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6273
          cvt_dist = org_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6274
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6275
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6276
      distance = CUR_Func_round(
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6277
                   cvt_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6278
                   CUR.tt_metrics.compensations[CUR.opcode & 3] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6279
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6280
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6281
      distance = ROUND_None(
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6282
                   cvt_dist,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6283
                   CUR.tt_metrics.compensations[CUR.opcode & 3] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6284
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6285
    /* minimum distance test */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6286
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6287
    if ( ( CUR.opcode & 8 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6288
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6289
      if ( org_dist >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6290
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6291
        if ( distance < CUR.GS.minimum_distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6292
          distance = CUR.GS.minimum_distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6293
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6294
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6295
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6296
        if ( distance > -CUR.GS.minimum_distance )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6297
          distance = -CUR.GS.minimum_distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6298
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6299
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6300
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6301
    CUR_Func_move( &CUR.zp1, point, distance - cur_dist );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6302
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6303
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6304
    CUR.GS.rp1 = CUR.GS.rp0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6305
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6306
    if ( ( CUR.opcode & 16 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6307
      CUR.GS.rp0 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6308
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6309
    /* XXX: UNDOCUMENTED! */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6310
    CUR.GS.rp2 = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6311
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6312
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6313
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6314
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6315
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6316
  /* ALIGNRP[]:    ALIGN Relative Point                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6317
  /* Opcode range: 0x3C                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6318
  /* Stack:        uint32 uint32... -->                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6319
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6320
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6321
  Ins_ALIGNRP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6322
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6323
    FT_UShort   point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6324
    FT_F26Dot6  distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6325
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6326
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6327
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6328
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6329
    if ( CUR.top < CUR.GS.loop ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6330
         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6331
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6332
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6333
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6334
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6335
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6336
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6337
    while ( CUR.GS.loop > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6338
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6339
      CUR.args--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6340
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6341
      point = (FT_UShort)CUR.stack[CUR.args];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6342
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6343
      if ( BOUNDS( point, CUR.zp1.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6344
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6345
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6346
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6347
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6348
          return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6349
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6350
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6351
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6352
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6353
        distance = CUR_Func_project( CUR.zp1.cur + point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6354
                                     CUR.zp0.cur + CUR.GS.rp0 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6355
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6356
        CUR_Func_move( &CUR.zp1, point, -distance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6357
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6358
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6359
      CUR.GS.loop--;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6360
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6361
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6362
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6363
    CUR.GS.loop = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6364
    CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6365
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6366
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6367
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6368
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6369
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6370
  /* ISECT[]:      moves point to InterSECTion                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6371
  /* Opcode range: 0x0F                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6372
  /* Stack:        5 * uint32 -->                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6373
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6374
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6375
  Ins_ISECT( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6376
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6377
    FT_UShort   point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6378
                a0, a1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6379
                b0, b1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6380
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6381
    FT_F26Dot6  discriminant;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6382
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6383
    FT_F26Dot6  dx,  dy,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6384
                dax, day,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6385
                dbx, dby;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6386
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6387
    FT_F26Dot6  val;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6388
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6389
    FT_Vector   R;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6390
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6391
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6392
    point = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6393
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6394
    a0 = (FT_UShort)args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6395
    a1 = (FT_UShort)args[2];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6396
    b0 = (FT_UShort)args[3];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6397
    b1 = (FT_UShort)args[4];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6398
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6399
    if ( BOUNDS( b0, CUR.zp0.n_points )  ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6400
         BOUNDS( b1, CUR.zp0.n_points )  ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6401
         BOUNDS( a0, CUR.zp1.n_points )  ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6402
         BOUNDS( a1, CUR.zp1.n_points )  ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6403
         BOUNDS( point, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6404
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6405
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6406
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6407
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6408
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6409
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6410
    dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6411
    dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6412
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6413
    dax = CUR.zp1.cur[a1].x - CUR.zp1.cur[a0].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6414
    day = CUR.zp1.cur[a1].y - CUR.zp1.cur[a0].y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6415
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6416
    dx = CUR.zp0.cur[b0].x - CUR.zp1.cur[a0].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6417
    dy = CUR.zp0.cur[b0].y - CUR.zp1.cur[a0].y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6418
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6419
    CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6420
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6421
    discriminant = TT_MULDIV( dax, -dby, 0x40 ) +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6422
                   TT_MULDIV( day, dbx, 0x40 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6423
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6424
    if ( FT_ABS( discriminant ) >= 0x40 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6425
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6426
      val = TT_MULDIV( dx, -dby, 0x40 ) + TT_MULDIV( dy, dbx, 0x40 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6427
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6428
      R.x = TT_MULDIV( val, dax, discriminant );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6429
      R.y = TT_MULDIV( val, day, discriminant );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6430
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6431
      CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6432
      CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6433
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6434
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6435
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6436
      /* else, take the middle of the middles of A and B */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6437
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6438
      CUR.zp2.cur[point].x = ( CUR.zp1.cur[a0].x +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6439
                               CUR.zp1.cur[a1].x +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6440
                               CUR.zp0.cur[b0].x +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6441
                               CUR.zp0.cur[b1].x ) / 4;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6442
      CUR.zp2.cur[point].y = ( CUR.zp1.cur[a0].y +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6443
                               CUR.zp1.cur[a1].y +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6444
                               CUR.zp0.cur[b0].y +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6445
                               CUR.zp0.cur[b1].y ) / 4;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6446
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6447
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6448
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6449
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6450
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6451
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6452
  /* ALIGNPTS[]:   ALIGN PoinTS                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6453
  /* Opcode range: 0x27                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6454
  /* Stack:        uint32 uint32 -->                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6455
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6456
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6457
  Ins_ALIGNPTS( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6458
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6459
    FT_UShort   p1, p2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6460
    FT_F26Dot6  distance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6461
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6462
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6463
    p1 = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6464
    p2 = (FT_UShort)args[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6465
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6466
    if ( BOUNDS( p1, CUR.zp1.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6467
         BOUNDS( p2, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6468
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6469
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6470
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6471
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6472
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6473
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6474
    distance = CUR_Func_project( CUR.zp0.cur + p2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6475
                                 CUR.zp1.cur + p1 ) / 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6476
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6477
    CUR_Func_move( &CUR.zp1, p1, distance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6478
    CUR_Func_move( &CUR.zp0, p2, -distance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6479
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6480
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6481
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6482
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6483
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6484
  /* IP[]:         Interpolate Point                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6485
  /* Opcode range: 0x39                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6486
  /* Stack:        uint32... -->                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6487
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6488
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6489
  /* SOMETIMES, DUMBER CODE IS BETTER CODE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6490
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6491
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6492
  Ins_IP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6493
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6494
    FT_F26Dot6  old_range, cur_range;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6495
    FT_Vector*  orus_base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6496
    FT_Vector*  cur_base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6497
    FT_Int      twilight;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6498
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6499
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6500
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6501
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6502
    if ( CUR.top < CUR.GS.loop )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6503
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6504
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6505
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6506
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6507
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6508
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6509
    /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6510
     * We need to deal in a special way with the twilight zone.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6511
     * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6512
     * for every n.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6513
     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6514
    twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6515
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6516
    if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6517
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6518
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6519
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6520
      goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6521
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6522
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6523
    if ( twilight )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6524
      orus_base = &CUR.zp0.org[CUR.GS.rp1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6525
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6526
      orus_base = &CUR.zp0.orus[CUR.GS.rp1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6527
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6528
    cur_base = &CUR.zp0.cur[CUR.GS.rp1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6529
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6530
    /* XXX: There are some glyphs in some braindead but popular */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6531
    /*      fonts out there (e.g. [aeu]grave in monotype.ttf)   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6532
    /*      calling IP[] with bad values of rp[12].             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6533
    /*      Do something sane when this odd thing happens.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6534
    if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6535
         BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6536
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6537
      old_range = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6538
      cur_range = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6539
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6540
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6541
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6542
      if ( twilight )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6543
        old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2],
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6544
                                       orus_base );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6545
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6546
        old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2],
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6547
                                       orus_base );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6548
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6549
      cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6550
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6551
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6552
    for ( ; CUR.GS.loop > 0; --CUR.GS.loop )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6553
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6554
      FT_UInt     point = (FT_UInt)CUR.stack[--CUR.args];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6555
      FT_F26Dot6  org_dist, cur_dist, new_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6556
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6557
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6558
      /* check point bounds */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6559
      if ( BOUNDS( point, CUR.zp2.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6560
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6561
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6562
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6563
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6564
          return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6565
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6566
        continue;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6567
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6568
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6569
      if ( twilight )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6570
        org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6571
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6572
        org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6573
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6574
      cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6575
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6576
      if ( org_dist )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6577
        new_dist = ( old_range != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6578
                     ? TT_MULDIV( org_dist, cur_range, old_range )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6579
                     : cur_dist;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6580
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6581
        new_dist = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6582
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6583
      CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6584
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6585
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6586
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6587
    CUR.GS.loop = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6588
    CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6589
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6590
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6591
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6592
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6593
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6594
  /* UTP[a]:       UnTouch Point                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6595
  /* Opcode range: 0x29                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6596
  /* Stack:        uint32 -->                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6597
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6598
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6599
  Ins_UTP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6600
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6601
    FT_UShort  point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6602
    FT_Byte    mask;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6603
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6604
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6605
    point = (FT_UShort)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6606
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6607
    if ( BOUNDS( point, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6608
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6609
      if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6610
        CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6611
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6612
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6613
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6614
    mask = 0xFF;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6615
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6616
    if ( CUR.GS.freeVector.x != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6617
      mask &= ~FT_CURVE_TAG_TOUCH_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6618
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6619
    if ( CUR.GS.freeVector.y != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6620
      mask &= ~FT_CURVE_TAG_TOUCH_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6621
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6622
    CUR.zp0.tags[point] &= mask;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6623
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6624
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6625
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6626
  /* Local variables for Ins_IUP: */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6627
  typedef struct  IUP_WorkerRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6628
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6629
    FT_Vector*  orgs;   /* original and current coordinate */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6630
    FT_Vector*  curs;   /* arrays                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6631
    FT_Vector*  orus;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6632
    FT_UInt     max_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6633
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6634
  } IUP_WorkerRec, *IUP_Worker;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6635
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6636
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6637
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6638
  _iup_worker_shift( IUP_Worker  worker,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6639
                     FT_UInt     p1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6640
                     FT_UInt     p2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6641
                     FT_UInt     p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6642
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6643
    FT_UInt     i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6644
    FT_F26Dot6  dx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6645
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6646
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6647
    dx = worker->curs[p].x - worker->orgs[p].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6648
    if ( dx != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6649
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6650
      for ( i = p1; i < p; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6651
        worker->curs[i].x += dx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6652
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6653
      for ( i = p + 1; i <= p2; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6654
        worker->curs[i].x += dx;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6655
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6656
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6657
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6658
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6659
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6660
  _iup_worker_interpolate( IUP_Worker  worker,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6661
                           FT_UInt     p1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6662
                           FT_UInt     p2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6663
                           FT_UInt     ref1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6664
                           FT_UInt     ref2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6665
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6666
    FT_UInt     i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6667
    FT_F26Dot6  orus1, orus2, org1, org2, delta1, delta2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6668
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6669
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6670
    if ( p1 > p2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6671
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6672
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6673
    if ( BOUNDS( ref1, worker->max_points ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6674
         BOUNDS( ref2, worker->max_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6675
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6676
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6677
    orus1 = worker->orus[ref1].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6678
    orus2 = worker->orus[ref2].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6679
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6680
    if ( orus1 > orus2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6681
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6682
      FT_F26Dot6  tmp_o;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6683
      FT_UInt     tmp_r;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6684
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6685
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6686
      tmp_o = orus1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6687
      orus1 = orus2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6688
      orus2 = tmp_o;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6689
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6690
      tmp_r = ref1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6691
      ref1  = ref2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6692
      ref2  = tmp_r;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6693
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6694
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6695
    org1   = worker->orgs[ref1].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6696
    org2   = worker->orgs[ref2].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6697
    delta1 = worker->curs[ref1].x - org1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6698
    delta2 = worker->curs[ref2].x - org2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6699
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6700
    if ( orus1 == orus2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6701
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6702
      /* simple shift of untouched points */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6703
      for ( i = p1; i <= p2; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6704
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6705
        FT_F26Dot6  x = worker->orgs[i].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6706
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6707
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6708
        if ( x <= org1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6709
          x += delta1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6710
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6711
          x += delta2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6712
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6713
        worker->curs[i].x = x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6714
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6715
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6716
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6717
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6718
      FT_Fixed  scale       = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6719
      FT_Bool   scale_valid = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6720
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6721
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6722
      /* interpolation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6723
      for ( i = p1; i <= p2; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6724
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6725
        FT_F26Dot6  x = worker->orgs[i].x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6726
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6727
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6728
        if ( x <= org1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6729
          x += delta1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6730
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6731
        else if ( x >= org2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6732
          x += delta2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6733
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6734
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6735
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6736
          if ( !scale_valid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6737
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6738
            scale_valid = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6739
            scale       = TT_MULDIV( org2 + delta2 - ( org1 + delta1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6740
                                     0x10000L, orus2 - orus1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6741
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6742
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6743
          x = ( org1 + delta1 ) +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6744
              TT_MULFIX( worker->orus[i].x - orus1, scale );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6745
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6746
        worker->curs[i].x = x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6747
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6748
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6749
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6750
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6751
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6752
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6753
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6754
  /* IUP[a]:       Interpolate Untouched Points                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6755
  /* Opcode range: 0x30-0x31                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6756
  /* Stack:        -->                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6757
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6758
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6759
  Ins_IUP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6760
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6761
    IUP_WorkerRec  V;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6762
    FT_Byte        mask;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6763
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6764
    FT_UInt   first_point;   /* first point of contour        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6765
    FT_UInt   end_point;     /* end point (last+1) of contour */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6766
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6767
    FT_UInt   first_touched; /* first touched point in contour   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6768
    FT_UInt   cur_touched;   /* current touched point in contour */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6769
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6770
    FT_UInt   point;         /* current point   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6771
    FT_Short  contour;       /* current contour */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6772
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6773
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6774
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6775
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6776
    /* ignore empty outlines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6777
    if ( CUR.pts.n_contours == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6778
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6779
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6780
    if ( CUR.opcode & 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6781
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6782
      mask   = FT_CURVE_TAG_TOUCH_X;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6783
      V.orgs = CUR.pts.org;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6784
      V.curs = CUR.pts.cur;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6785
      V.orus = CUR.pts.orus;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6786
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6787
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6788
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6789
      mask   = FT_CURVE_TAG_TOUCH_Y;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6790
      V.orgs = (FT_Vector*)( (FT_Pos*)CUR.pts.org + 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6791
      V.curs = (FT_Vector*)( (FT_Pos*)CUR.pts.cur + 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6792
      V.orus = (FT_Vector*)( (FT_Pos*)CUR.pts.orus + 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6793
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6794
    V.max_points = CUR.pts.n_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6795
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6796
    contour = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6797
    point   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6798
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6799
    do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6800
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6801
      end_point   = CUR.pts.contours[contour] - CUR.pts.first_point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6802
      first_point = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6803
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6804
      if ( BOUNDS ( end_point, CUR.pts.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6805
        end_point = CUR.pts.n_points - 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6806
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6807
      while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6808
        point++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6809
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6810
      if ( point <= end_point )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6811
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6812
        first_touched = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6813
        cur_touched   = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6814
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6815
        point++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6816
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6817
        while ( point <= end_point )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6818
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6819
          if ( ( CUR.pts.tags[point] & mask ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6820
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6821
            _iup_worker_interpolate( &V,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6822
                                     cur_touched + 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6823
                                     point - 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6824
                                     cur_touched,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6825
                                     point );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6826
            cur_touched = point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6827
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6828
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6829
          point++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6830
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6831
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6832
        if ( cur_touched == first_touched )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6833
          _iup_worker_shift( &V, first_point, end_point, cur_touched );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6834
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6835
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6836
          _iup_worker_interpolate( &V,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6837
                                   (FT_UShort)( cur_touched + 1 ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6838
                                   end_point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6839
                                   cur_touched,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6840
                                   first_touched );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6841
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6842
          if ( first_touched > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6843
            _iup_worker_interpolate( &V,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6844
                                     first_point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6845
                                     first_touched - 1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6846
                                     cur_touched,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6847
                                     first_touched );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6848
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6849
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6850
      contour++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6851
    } while ( contour < CUR.pts.n_contours );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6852
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6853
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6854
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6855
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6856
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6857
  /* DELTAPn[]:    DELTA exceptions P1, P2, P3                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6858
  /* Opcode range: 0x5D,0x71,0x72                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6859
  /* Stack:        uint32 (2 * uint32)... -->                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6860
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6861
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6862
  Ins_DELTAP( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6863
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6864
    FT_ULong   k, nump;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6865
    FT_UShort  A;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6866
    FT_ULong   C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6867
    FT_Long    B;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6868
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6869
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6870
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6871
    /* Delta hinting is covered by US Patent 5159668. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6872
    if ( CUR.face->unpatented_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6873
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6874
      FT_Long  n = args[0] * 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6875
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6876
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6877
      if ( CUR.args < n )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6878
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6879
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6880
          CUR.error = TT_Err_Too_Few_Arguments;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6881
        n = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6882
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6883
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6884
      CUR.args -= n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6885
      CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6886
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6887
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6888
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6889
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6890
    nump = (FT_ULong)args[0];   /* some points theoretically may occur more
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6891
                                   than once, thus UShort isn't enough */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6892
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6893
    for ( k = 1; k <= nump; k++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6894
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6895
      if ( CUR.args < 2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6896
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6897
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6898
          CUR.error = TT_Err_Too_Few_Arguments;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6899
        CUR.args = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6900
        goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6901
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6902
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6903
      CUR.args -= 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6904
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6905
      A = (FT_UShort)CUR.stack[CUR.args + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6906
      B = CUR.stack[CUR.args];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6907
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6908
      /* XXX: Because some popular fonts contain some invalid DeltaP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6909
      /*      instructions, we simply ignore them when the stacked   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6910
      /*      point reference is off limit, rather than returning an */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6911
      /*      error.  As a delta instruction doesn't change a glyph  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6912
      /*      in great ways, this shouldn't be a problem.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6913
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6914
      if ( !BOUNDS( A, CUR.zp0.n_points ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6915
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6916
        C = ( (FT_ULong)B & 0xF0 ) >> 4;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6917
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6918
        switch ( CUR.opcode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6919
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6920
        case 0x5D:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6921
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6922
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6923
        case 0x71:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6924
          C += 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6925
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6926
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6927
        case 0x72:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6928
          C += 32;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6929
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6930
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6931
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6932
        C += CUR.GS.delta_base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6933
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6934
        if ( CURRENT_Ppem() == (FT_Long)C )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6935
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6936
          B = ( (FT_ULong)B & 0xF ) - 8;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6937
          if ( B >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6938
            B++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6939
          B = B * 64 / ( 1L << CUR.GS.delta_shift );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6940
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6941
          CUR_Func_move( &CUR.zp0, A, B );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6942
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6943
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6944
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6945
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6946
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6947
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6948
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6949
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6950
    CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6951
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6952
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6953
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6954
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6955
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6956
  /* DELTACn[]:    DELTA exceptions C1, C2, C3                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6957
  /* Opcode range: 0x73,0x74,0x75                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6958
  /* Stack:        uint32 (2 * uint32)... -->                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6959
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6960
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6961
  Ins_DELTAC( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6962
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6963
    FT_ULong  nump, k;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6964
    FT_ULong  A, C;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6965
    FT_Long   B;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6966
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6967
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6968
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6969
    /* Delta hinting is covered by US Patent 5159668. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6970
    if ( CUR.face->unpatented_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6971
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6972
      FT_Long  n = args[0] * 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6973
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6974
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6975
      if ( CUR.args < n )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6976
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6977
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6978
          CUR.error = TT_Err_Too_Few_Arguments;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6979
        n = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6980
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6981
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6982
      CUR.args -= n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6983
      CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6984
      return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6985
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6986
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6987
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6988
    nump = (FT_ULong)args[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6989
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6990
    for ( k = 1; k <= nump; k++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6991
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6992
      if ( CUR.args < 2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6993
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6994
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6995
          CUR.error = TT_Err_Too_Few_Arguments;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6996
        CUR.args = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6997
        goto Fail;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6998
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  6999
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7000
      CUR.args -= 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7001
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7002
      A = (FT_ULong)CUR.stack[CUR.args + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7003
      B = CUR.stack[CUR.args];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7004
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7005
      if ( BOUNDSL( A, CUR.cvtSize ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7006
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7007
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7008
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7009
          CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7010
          return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7011
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7012
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7013
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7014
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7015
        C = ( (FT_ULong)B & 0xF0 ) >> 4;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7016
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7017
        switch ( CUR.opcode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7018
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7019
        case 0x73:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7020
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7021
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7022
        case 0x74:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7023
          C += 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7024
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7025
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7026
        case 0x75:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7027
          C += 32;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7028
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7029
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7030
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7031
        C += CUR.GS.delta_base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7032
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7033
        if ( CURRENT_Ppem() == (FT_Long)C )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7034
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7035
          B = ( (FT_ULong)B & 0xF ) - 8;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7036
          if ( B >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7037
            B++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7038
          B = B * 64 / ( 1L << CUR.GS.delta_shift );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7039
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7040
          CUR_Func_move_cvt( A, B );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7041
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7042
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7043
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7044
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7045
  Fail:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7046
    CUR.new_top = CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7047
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7048
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7049
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7050
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7051
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7052
  /* MISC. INSTRUCTIONS                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7053
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7054
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7055
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7056
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7057
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7058
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7059
  /* GETINFO[]:    GET INFOrmation                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7060
  /* Opcode range: 0x88                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7061
  /* Stack:        uint32 --> uint32                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7062
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7063
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7064
  Ins_GETINFO( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7065
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7066
    FT_Long  K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7067
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7068
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7069
    K = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7070
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7071
    /* We return MS rasterizer version 1.7 for the font scaler. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7072
    if ( ( args[0] & 1 ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7073
      K = 35;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7074
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7075
    /* Has the glyph been rotated? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7076
    if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7077
      K |= 0x80;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7078
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7079
    /* Has the glyph been stretched? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7080
    if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7081
      K |= 1 << 8;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7082
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7083
    /* Are we hinting for grayscale? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7084
    if ( ( args[0] & 32 ) != 0 && CUR.grayscale )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7085
      K |= 1 << 12;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7086
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7087
    args[0] = K;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7088
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7089
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7090
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7091
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7092
  Ins_UNKNOWN( INS_ARG )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7093
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7094
    TT_DefRecord*  def   = CUR.IDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7095
    TT_DefRecord*  limit = def + CUR.numIDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7096
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7097
    FT_UNUSED_ARG;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7098
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7099
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7100
    for ( ; def < limit; def++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7101
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7102
      if ( (FT_Byte)def->opc == CUR.opcode && def->active )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7103
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7104
        TT_CallRec*  call;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7105
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7106
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7107
        if ( CUR.callTop >= CUR.callSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7108
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7109
          CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7110
          return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7111
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7112
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7113
        call = CUR.callStack + CUR.callTop++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7115
        call->Caller_Range = CUR.curRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7116
        call->Caller_IP    = CUR.IP + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7117
        call->Cur_Count    = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7118
        call->Cur_Restart  = def->start;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7119
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7120
        INS_Goto_CodeRange( def->range, def->start );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7121
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7122
        CUR.step_ins = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7123
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7124
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7125
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7126
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7127
    CUR.error = TT_Err_Invalid_Opcode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7128
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7130
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7131
#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7132
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7133
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7134
  static
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7135
  TInstruction_Function  Instruct_Dispatch[256] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7136
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7137
    /* Opcodes are gathered in groups of 16. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7138
    /* Please keep the spaces as they are.   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7139
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7140
    /*  SVTCA  y  */  Ins_SVTCA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7141
    /*  SVTCA  x  */  Ins_SVTCA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7142
    /*  SPvTCA y  */  Ins_SPVTCA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7143
    /*  SPvTCA x  */  Ins_SPVTCA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7144
    /*  SFvTCA y  */  Ins_SFVTCA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7145
    /*  SFvTCA x  */  Ins_SFVTCA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7146
    /*  SPvTL //  */  Ins_SPVTL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7147
    /*  SPvTL +   */  Ins_SPVTL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7148
    /*  SFvTL //  */  Ins_SFVTL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7149
    /*  SFvTL +   */  Ins_SFVTL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7150
    /*  SPvFS     */  Ins_SPVFS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7151
    /*  SFvFS     */  Ins_SFVFS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7152
    /*  GPV       */  Ins_GPV,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7153
    /*  GFV       */  Ins_GFV,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7154
    /*  SFvTPv    */  Ins_SFVTPV,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7155
    /*  ISECT     */  Ins_ISECT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7156
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7157
    /*  SRP0      */  Ins_SRP0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7158
    /*  SRP1      */  Ins_SRP1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7159
    /*  SRP2      */  Ins_SRP2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7160
    /*  SZP0      */  Ins_SZP0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7161
    /*  SZP1      */  Ins_SZP1,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7162
    /*  SZP2      */  Ins_SZP2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7163
    /*  SZPS      */  Ins_SZPS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7164
    /*  SLOOP     */  Ins_SLOOP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7165
    /*  RTG       */  Ins_RTG,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7166
    /*  RTHG      */  Ins_RTHG,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7167
    /*  SMD       */  Ins_SMD,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7168
    /*  ELSE      */  Ins_ELSE,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7169
    /*  JMPR      */  Ins_JMPR,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7170
    /*  SCvTCi    */  Ins_SCVTCI,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7171
    /*  SSwCi     */  Ins_SSWCI,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7172
    /*  SSW       */  Ins_SSW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7173
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7174
    /*  DUP       */  Ins_DUP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7175
    /*  POP       */  Ins_POP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7176
    /*  CLEAR     */  Ins_CLEAR,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7177
    /*  SWAP      */  Ins_SWAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7178
    /*  DEPTH     */  Ins_DEPTH,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7179
    /*  CINDEX    */  Ins_CINDEX,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7180
    /*  MINDEX    */  Ins_MINDEX,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7181
    /*  AlignPTS  */  Ins_ALIGNPTS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7182
    /*  INS_0x28  */  Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7183
    /*  UTP       */  Ins_UTP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7184
    /*  LOOPCALL  */  Ins_LOOPCALL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7185
    /*  CALL      */  Ins_CALL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7186
    /*  FDEF      */  Ins_FDEF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7187
    /*  ENDF      */  Ins_ENDF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7188
    /*  MDAP[0]   */  Ins_MDAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7189
    /*  MDAP[1]   */  Ins_MDAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7190
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7191
    /*  IUP[0]    */  Ins_IUP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7192
    /*  IUP[1]    */  Ins_IUP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7193
    /*  SHP[0]    */  Ins_SHP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7194
    /*  SHP[1]    */  Ins_SHP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7195
    /*  SHC[0]    */  Ins_SHC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7196
    /*  SHC[1]    */  Ins_SHC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7197
    /*  SHZ[0]    */  Ins_SHZ,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7198
    /*  SHZ[1]    */  Ins_SHZ,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7199
    /*  SHPIX     */  Ins_SHPIX,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7200
    /*  IP        */  Ins_IP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7201
    /*  MSIRP[0]  */  Ins_MSIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7202
    /*  MSIRP[1]  */  Ins_MSIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7203
    /*  AlignRP   */  Ins_ALIGNRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7204
    /*  RTDG      */  Ins_RTDG,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7205
    /*  MIAP[0]   */  Ins_MIAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7206
    /*  MIAP[1]   */  Ins_MIAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7207
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7208
    /*  NPushB    */  Ins_NPUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7209
    /*  NPushW    */  Ins_NPUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7210
    /*  WS        */  Ins_WS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7211
    /*  RS        */  Ins_RS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7212
    /*  WCvtP     */  Ins_WCVTP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7213
    /*  RCvt      */  Ins_RCVT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7214
    /*  GC[0]     */  Ins_GC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7215
    /*  GC[1]     */  Ins_GC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7216
    /*  SCFS      */  Ins_SCFS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7217
    /*  MD[0]     */  Ins_MD,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7218
    /*  MD[1]     */  Ins_MD,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7219
    /*  MPPEM     */  Ins_MPPEM,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7220
    /*  MPS       */  Ins_MPS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7221
    /*  FlipON    */  Ins_FLIPON,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7222
    /*  FlipOFF   */  Ins_FLIPOFF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7223
    /*  DEBUG     */  Ins_DEBUG,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7224
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7225
    /*  LT        */  Ins_LT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7226
    /*  LTEQ      */  Ins_LTEQ,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7227
    /*  GT        */  Ins_GT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7228
    /*  GTEQ      */  Ins_GTEQ,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7229
    /*  EQ        */  Ins_EQ,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7230
    /*  NEQ       */  Ins_NEQ,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7231
    /*  ODD       */  Ins_ODD,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7232
    /*  EVEN      */  Ins_EVEN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7233
    /*  IF        */  Ins_IF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7234
    /*  EIF       */  Ins_EIF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7235
    /*  AND       */  Ins_AND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7236
    /*  OR        */  Ins_OR,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7237
    /*  NOT       */  Ins_NOT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7238
    /*  DeltaP1   */  Ins_DELTAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7239
    /*  SDB       */  Ins_SDB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7240
    /*  SDS       */  Ins_SDS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7241
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7242
    /*  ADD       */  Ins_ADD,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7243
    /*  SUB       */  Ins_SUB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7244
    /*  DIV       */  Ins_DIV,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7245
    /*  MUL       */  Ins_MUL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7246
    /*  ABS       */  Ins_ABS,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7247
    /*  NEG       */  Ins_NEG,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7248
    /*  FLOOR     */  Ins_FLOOR,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7249
    /*  CEILING   */  Ins_CEILING,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7250
    /*  ROUND[0]  */  Ins_ROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7251
    /*  ROUND[1]  */  Ins_ROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7252
    /*  ROUND[2]  */  Ins_ROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7253
    /*  ROUND[3]  */  Ins_ROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7254
    /*  NROUND[0] */  Ins_NROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7255
    /*  NROUND[1] */  Ins_NROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7256
    /*  NROUND[2] */  Ins_NROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7257
    /*  NROUND[3] */  Ins_NROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7258
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7259
    /*  WCvtF     */  Ins_WCVTF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7260
    /*  DeltaP2   */  Ins_DELTAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7261
    /*  DeltaP3   */  Ins_DELTAP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7262
    /*  DeltaCn[0] */ Ins_DELTAC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7263
    /*  DeltaCn[1] */ Ins_DELTAC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7264
    /*  DeltaCn[2] */ Ins_DELTAC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7265
    /*  SROUND    */  Ins_SROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7266
    /*  S45Round  */  Ins_S45ROUND,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7267
    /*  JROT      */  Ins_JROT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7268
    /*  JROF      */  Ins_JROF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7269
    /*  ROFF      */  Ins_ROFF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7270
    /*  INS_0x7B  */  Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7271
    /*  RUTG      */  Ins_RUTG,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7272
    /*  RDTG      */  Ins_RDTG,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7273
    /*  SANGW     */  Ins_SANGW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7274
    /*  AA        */  Ins_AA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7275
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7276
    /*  FlipPT    */  Ins_FLIPPT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7277
    /*  FlipRgON  */  Ins_FLIPRGON,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7278
    /*  FlipRgOFF */  Ins_FLIPRGOFF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7279
    /*  INS_0x83  */  Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7280
    /*  INS_0x84  */  Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7281
    /*  ScanCTRL  */  Ins_SCANCTRL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7282
    /*  SDPVTL[0] */  Ins_SDPVTL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7283
    /*  SDPVTL[1] */  Ins_SDPVTL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7284
    /*  GetINFO   */  Ins_GETINFO,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7285
    /*  IDEF      */  Ins_IDEF,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7286
    /*  ROLL      */  Ins_ROLL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7287
    /*  MAX       */  Ins_MAX,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7288
    /*  MIN       */  Ins_MIN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7289
    /*  ScanTYPE  */  Ins_SCANTYPE,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7290
    /*  InstCTRL  */  Ins_INSTCTRL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7291
    /*  INS_0x8F  */  Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7292
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7293
    /*  INS_0x90  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7294
    /*  INS_0x91  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7295
    /*  INS_0x92  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7296
    /*  INS_0x93  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7297
    /*  INS_0x94  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7298
    /*  INS_0x95  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7299
    /*  INS_0x96  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7300
    /*  INS_0x97  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7301
    /*  INS_0x98  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7302
    /*  INS_0x99  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7303
    /*  INS_0x9A  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7304
    /*  INS_0x9B  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7305
    /*  INS_0x9C  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7306
    /*  INS_0x9D  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7307
    /*  INS_0x9E  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7308
    /*  INS_0x9F  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7309
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7310
    /*  INS_0xA0  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7311
    /*  INS_0xA1  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7312
    /*  INS_0xA2  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7313
    /*  INS_0xA3  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7314
    /*  INS_0xA4  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7315
    /*  INS_0xA5  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7316
    /*  INS_0xA6  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7317
    /*  INS_0xA7  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7318
    /*  INS_0xA8  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7319
    /*  INS_0xA9  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7320
    /*  INS_0xAA  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7321
    /*  INS_0xAB  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7322
    /*  INS_0xAC  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7323
    /*  INS_0xAD  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7324
    /*  INS_0xAE  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7325
    /*  INS_0xAF  */   Ins_UNKNOWN,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7326
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7327
    /*  PushB[0]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7328
    /*  PushB[1]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7329
    /*  PushB[2]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7330
    /*  PushB[3]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7331
    /*  PushB[4]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7332
    /*  PushB[5]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7333
    /*  PushB[6]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7334
    /*  PushB[7]  */  Ins_PUSHB,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7335
    /*  PushW[0]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7336
    /*  PushW[1]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7337
    /*  PushW[2]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7338
    /*  PushW[3]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7339
    /*  PushW[4]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7340
    /*  PushW[5]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7341
    /*  PushW[6]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7342
    /*  PushW[7]  */  Ins_PUSHW,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7343
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7344
    /*  MDRP[00]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7345
    /*  MDRP[01]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7346
    /*  MDRP[02]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7347
    /*  MDRP[03]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7348
    /*  MDRP[04]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7349
    /*  MDRP[05]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7350
    /*  MDRP[06]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7351
    /*  MDRP[07]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7352
    /*  MDRP[08]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7353
    /*  MDRP[09]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7354
    /*  MDRP[10]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7355
    /*  MDRP[11]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7356
    /*  MDRP[12]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7357
    /*  MDRP[13]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7358
    /*  MDRP[14]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7359
    /*  MDRP[15]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7360
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7361
    /*  MDRP[16]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7362
    /*  MDRP[17]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7363
    /*  MDRP[18]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7364
    /*  MDRP[19]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7365
    /*  MDRP[20]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7366
    /*  MDRP[21]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7367
    /*  MDRP[22]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7368
    /*  MDRP[23]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7369
    /*  MDRP[24]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7370
    /*  MDRP[25]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7371
    /*  MDRP[26]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7372
    /*  MDRP[27]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7373
    /*  MDRP[28]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7374
    /*  MDRP[29]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7375
    /*  MDRP[30]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7376
    /*  MDRP[31]  */  Ins_MDRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7377
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7378
    /*  MIRP[00]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7379
    /*  MIRP[01]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7380
    /*  MIRP[02]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7381
    /*  MIRP[03]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7382
    /*  MIRP[04]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7383
    /*  MIRP[05]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7384
    /*  MIRP[06]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7385
    /*  MIRP[07]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7386
    /*  MIRP[08]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7387
    /*  MIRP[09]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7388
    /*  MIRP[10]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7389
    /*  MIRP[11]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7390
    /*  MIRP[12]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7391
    /*  MIRP[13]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7392
    /*  MIRP[14]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7393
    /*  MIRP[15]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7394
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7395
    /*  MIRP[16]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7396
    /*  MIRP[17]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7397
    /*  MIRP[18]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7398
    /*  MIRP[19]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7399
    /*  MIRP[20]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7400
    /*  MIRP[21]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7401
    /*  MIRP[22]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7402
    /*  MIRP[23]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7403
    /*  MIRP[24]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7404
    /*  MIRP[25]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7405
    /*  MIRP[26]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7406
    /*  MIRP[27]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7407
    /*  MIRP[28]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7408
    /*  MIRP[29]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7409
    /*  MIRP[30]  */  Ins_MIRP,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7410
    /*  MIRP[31]  */  Ins_MIRP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7411
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7412
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7413
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7414
#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7415
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7416
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7417
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7418
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7419
  /* RUN                                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7420
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7421
  /*  This function executes a run of opcodes.  It will exit in the        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7422
  /*  following cases:                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7423
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7424
  /*  - Errors (in which case it returns FALSE).                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7425
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7426
  /*  - Reaching the end of the main code range (returns TRUE).            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7427
  /*    Reaching the end of a code range within a function call is an      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7428
  /*    error.                                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7429
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7430
  /*  - After executing one single opcode, if the flag `Instruction_Trap'  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7431
  /*    is set to TRUE (returns TRUE).                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7432
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7433
  /*  On exit with TRUE, test IP < CodeSize to know whether it comes from  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7434
  /*  an instruction trap or a normal termination.                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7435
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7436
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7437
  /*  Note: The documented DEBUG opcode pops a value from the stack.  This */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7438
  /*        behaviour is unsupported; here a DEBUG opcode is always an     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7439
  /*        error.                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7440
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7441
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7442
  /* THIS IS THE INTERPRETER'S MAIN LOOP.                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7443
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7444
  /*  Instructions appear in the specification's order.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7445
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7446
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7447
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7448
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7449
  /* documentation is in ttinterp.h */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7450
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7451
  FT_EXPORT_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7452
  TT_RunIns( TT_ExecContext  exc )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7453
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7454
    FT_Long  ins_counter = 0;  /* executed instructions counter */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7455
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7456
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7457
#ifdef TT_CONFIG_OPTION_STATIC_RASTER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7458
    cur = *exc;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7459
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7460
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7461
    /* set CVT functions */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7462
    CUR.tt_metrics.ratio = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7463
    if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7464
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7465
      /* non-square pixels, use the stretched routines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7466
      CUR.func_read_cvt  = Read_CVT_Stretched;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7467
      CUR.func_write_cvt = Write_CVT_Stretched;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7468
      CUR.func_move_cvt  = Move_CVT_Stretched;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7469
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7470
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7471
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7472
      /* square pixels, use normal routines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7473
      CUR.func_read_cvt  = Read_CVT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7474
      CUR.func_write_cvt = Write_CVT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7475
      CUR.func_move_cvt  = Move_CVT;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7476
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7477
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7478
    COMPUTE_Funcs();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7479
    COMPUTE_Round( (FT_Byte)exc->GS.round_state );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7480
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7481
    do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7482
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7483
      CUR.opcode = CUR.code[CUR.IP];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7484
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7485
      FT_TRACE7(( "  " ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7486
      FT_TRACE7(( opcode_name[CUR.opcode] ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7487
      FT_TRACE7(( "\n" ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7488
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7489
      if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7490
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7491
        if ( CUR.IP + 1 > CUR.codeSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7492
          goto LErrorCodeOverflow_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7493
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7494
        CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7495
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7496
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7497
      if ( CUR.IP + CUR.length > CUR.codeSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7498
        goto LErrorCodeOverflow_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7499
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7500
      /* First, let's check for empty stack and overflow */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7501
      CUR.args = CUR.top - ( Pop_Push_Count[CUR.opcode] >> 4 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7502
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7503
      /* `args' is the top of the stack once arguments have been popped. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7504
      /* One can also interpret it as the index of the last argument.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7505
      if ( CUR.args < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7506
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7507
        FT_UShort  i;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7508
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7509
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7510
        if ( CUR.pedantic_hinting )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7511
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7512
          CUR.error = TT_Err_Too_Few_Arguments;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7513
          goto LErrorLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7514
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7515
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7516
        /* push zeroes onto the stack */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7517
        for ( i = 0; i < Pop_Push_Count[CUR.opcode] >> 4; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7518
          CUR.stack[i] = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7519
        CUR.args = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7520
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7521
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7522
      CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7523
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7524
      /* `new_top' is the new top of the stack, after the instruction's */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7525
      /* execution.  `top' will be set to `new_top' after the `switch'  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7526
      /* statement.                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7527
      if ( CUR.new_top > CUR.stackSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7528
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7529
        CUR.error = TT_Err_Stack_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7530
        goto LErrorLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7531
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7532
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7533
      CUR.step_ins = TRUE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7534
      CUR.error    = TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7535
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7536
#ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7537
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7538
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7539
        FT_Long*  args   = CUR.stack + CUR.args;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7540
        FT_Byte   opcode = CUR.opcode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7541
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7542
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7543
#undef  ARRAY_BOUND_ERROR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7544
#define ARRAY_BOUND_ERROR  goto Set_Invalid_Ref
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7545
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7546
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7547
        switch ( opcode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7548
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7549
        case 0x00:  /* SVTCA y  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7550
        case 0x01:  /* SVTCA x  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7551
        case 0x02:  /* SPvTCA y */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7552
        case 0x03:  /* SPvTCA x */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7553
        case 0x04:  /* SFvTCA y */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7554
        case 0x05:  /* SFvTCA x */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7555
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7556
            FT_Short  AA, BB;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7557
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7558
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7559
            AA = (FT_Short)( ( opcode & 1 ) << 14 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7560
            BB = (FT_Short)( AA ^ 0x4000 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7561
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7562
            if ( opcode < 4 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7563
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7564
              CUR.GS.projVector.x = AA;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7565
              CUR.GS.projVector.y = BB;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7566
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7567
              CUR.GS.dualVector.x = AA;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7568
              CUR.GS.dualVector.y = BB;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7569
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7570
            else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7571
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7572
              GUESS_VECTOR( projVector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7573
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7574
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7575
            if ( ( opcode & 2 ) == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7576
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7577
              CUR.GS.freeVector.x = AA;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7578
              CUR.GS.freeVector.y = BB;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7579
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7580
            else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7581
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7582
              GUESS_VECTOR( freeVector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7583
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7584
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7585
            COMPUTE_Funcs();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7586
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7587
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7588
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7589
        case 0x06:  /* SPvTL // */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7590
        case 0x07:  /* SPvTL +  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7591
          DO_SPVTL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7592
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7593
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7594
        case 0x08:  /* SFvTL // */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7595
        case 0x09:  /* SFvTL +  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7596
          DO_SFVTL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7597
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7598
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7599
        case 0x0A:  /* SPvFS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7600
          DO_SPVFS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7601
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7602
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7603
        case 0x0B:  /* SFvFS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7604
          DO_SFVFS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7605
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7606
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7607
        case 0x0C:  /* GPV */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7608
          DO_GPV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7609
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7610
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7611
        case 0x0D:  /* GFV */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7612
          DO_GFV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7613
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7614
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7615
        case 0x0E:  /* SFvTPv */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7616
          DO_SFVTPV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7617
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7618
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7619
        case 0x0F:  /* ISECT  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7620
          Ins_ISECT( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7621
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7622
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7623
        case 0x10:  /* SRP0 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7624
          DO_SRP0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7625
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7626
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7627
        case 0x11:  /* SRP1 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7628
          DO_SRP1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7629
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7630
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7631
        case 0x12:  /* SRP2 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7632
          DO_SRP2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7633
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7634
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7635
        case 0x13:  /* SZP0 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7636
          Ins_SZP0( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7637
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7638
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7639
        case 0x14:  /* SZP1 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7640
          Ins_SZP1( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7641
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7642
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7643
        case 0x15:  /* SZP2 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7644
          Ins_SZP2( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7645
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7646
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7647
        case 0x16:  /* SZPS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7648
          Ins_SZPS( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7649
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7650
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7651
        case 0x17:  /* SLOOP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7652
          DO_SLOOP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7653
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7654
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7655
        case 0x18:  /* RTG */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7656
          DO_RTG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7657
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7658
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7659
        case 0x19:  /* RTHG */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7660
          DO_RTHG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7661
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7662
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7663
        case 0x1A:  /* SMD */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7664
          DO_SMD
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7665
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7666
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7667
        case 0x1B:  /* ELSE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7668
          Ins_ELSE( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7669
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7670
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7671
        case 0x1C:  /* JMPR */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7672
          DO_JMPR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7673
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7674
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7675
        case 0x1D:  /* SCVTCI */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7676
          DO_SCVTCI
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7677
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7678
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7679
        case 0x1E:  /* SSWCI */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7680
          DO_SSWCI
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7681
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7682
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7683
        case 0x1F:  /* SSW */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7684
          DO_SSW
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7685
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7686
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7687
        case 0x20:  /* DUP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7688
          DO_DUP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7689
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7690
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7691
        case 0x21:  /* POP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7692
          /* nothing :-) */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7693
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7694
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7695
        case 0x22:  /* CLEAR */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7696
          DO_CLEAR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7697
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7698
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7699
        case 0x23:  /* SWAP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7700
          DO_SWAP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7701
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7702
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7703
        case 0x24:  /* DEPTH */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7704
          DO_DEPTH
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7705
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7706
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7707
        case 0x25:  /* CINDEX */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7708
          DO_CINDEX
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7709
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7710
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7711
        case 0x26:  /* MINDEX */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7712
          Ins_MINDEX( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7713
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7714
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7715
        case 0x27:  /* ALIGNPTS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7716
          Ins_ALIGNPTS( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7717
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7718
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7719
        case 0x28:  /* ???? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7720
          Ins_UNKNOWN( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7721
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7722
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7723
        case 0x29:  /* UTP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7724
          Ins_UTP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7725
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7726
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7727
        case 0x2A:  /* LOOPCALL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7728
          Ins_LOOPCALL( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7729
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7730
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7731
        case 0x2B:  /* CALL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7732
          Ins_CALL( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7733
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7734
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7735
        case 0x2C:  /* FDEF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7736
          Ins_FDEF( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7737
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7738
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7739
        case 0x2D:  /* ENDF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7740
          Ins_ENDF( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7741
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7742
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7743
        case 0x2E:  /* MDAP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7744
        case 0x2F:  /* MDAP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7745
          Ins_MDAP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7746
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7747
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7748
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7749
        case 0x30:  /* IUP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7750
        case 0x31:  /* IUP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7751
          Ins_IUP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7752
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7753
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7754
        case 0x32:  /* SHP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7755
        case 0x33:  /* SHP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7756
          Ins_SHP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7757
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7758
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7759
        case 0x34:  /* SHC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7760
        case 0x35:  /* SHC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7761
          Ins_SHC( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7762
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7763
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7764
        case 0x36:  /* SHZ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7765
        case 0x37:  /* SHZ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7766
          Ins_SHZ( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7767
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7768
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7769
        case 0x38:  /* SHPIX */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7770
          Ins_SHPIX( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7771
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7772
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7773
        case 0x39:  /* IP    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7774
          Ins_IP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7775
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7776
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7777
        case 0x3A:  /* MSIRP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7778
        case 0x3B:  /* MSIRP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7779
          Ins_MSIRP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7780
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7781
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7782
        case 0x3C:  /* AlignRP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7783
          Ins_ALIGNRP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7784
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7785
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7786
        case 0x3D:  /* RTDG */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7787
          DO_RTDG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7788
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7789
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7790
        case 0x3E:  /* MIAP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7791
        case 0x3F:  /* MIAP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7792
          Ins_MIAP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7793
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7794
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7795
        case 0x40:  /* NPUSHB */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7796
          Ins_NPUSHB( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7797
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7798
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7799
        case 0x41:  /* NPUSHW */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7800
          Ins_NPUSHW( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7801
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7802
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7803
        case 0x42:  /* WS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7804
          DO_WS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7805
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7806
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7807
      Set_Invalid_Ref:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7808
            CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7809
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7810
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7811
        case 0x43:  /* RS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7812
          DO_RS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7813
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7814
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7815
        case 0x44:  /* WCVTP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7816
          DO_WCVTP
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7817
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7818
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7819
        case 0x45:  /* RCVT */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7820
          DO_RCVT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7821
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7822
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7823
        case 0x46:  /* GC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7824
        case 0x47:  /* GC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7825
          Ins_GC( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7826
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7827
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7828
        case 0x48:  /* SCFS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7829
          Ins_SCFS( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7830
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7831
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7832
        case 0x49:  /* MD */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7833
        case 0x4A:  /* MD */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7834
          Ins_MD( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7835
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7836
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7837
        case 0x4B:  /* MPPEM */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7838
          DO_MPPEM
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7839
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7840
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7841
        case 0x4C:  /* MPS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7842
          DO_MPS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7843
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7844
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7845
        case 0x4D:  /* FLIPON */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7846
          DO_FLIPON
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7847
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7848
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7849
        case 0x4E:  /* FLIPOFF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7850
          DO_FLIPOFF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7851
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7852
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7853
        case 0x4F:  /* DEBUG */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7854
          DO_DEBUG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7855
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7856
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7857
        case 0x50:  /* LT */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7858
          DO_LT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7859
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7860
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7861
        case 0x51:  /* LTEQ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7862
          DO_LTEQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7863
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7864
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7865
        case 0x52:  /* GT */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7866
          DO_GT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7867
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7868
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7869
        case 0x53:  /* GTEQ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7870
          DO_GTEQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7871
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7872
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7873
        case 0x54:  /* EQ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7874
          DO_EQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7875
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7876
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7877
        case 0x55:  /* NEQ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7878
          DO_NEQ
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7879
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7880
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7881
        case 0x56:  /* ODD */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7882
          DO_ODD
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7883
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7884
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7885
        case 0x57:  /* EVEN */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7886
          DO_EVEN
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7887
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7888
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7889
        case 0x58:  /* IF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7890
          Ins_IF( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7891
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7892
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7893
        case 0x59:  /* EIF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7894
          /* do nothing */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7895
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7896
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7897
        case 0x5A:  /* AND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7898
          DO_AND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7899
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7900
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7901
        case 0x5B:  /* OR */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7902
          DO_OR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7903
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7904
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7905
        case 0x5C:  /* NOT */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7906
          DO_NOT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7907
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7908
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7909
        case 0x5D:  /* DELTAP1 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7910
          Ins_DELTAP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7911
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7912
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7913
        case 0x5E:  /* SDB */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7914
          DO_SDB
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7915
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7916
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7917
        case 0x5F:  /* SDS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7918
          DO_SDS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7919
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7920
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7921
        case 0x60:  /* ADD */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7922
          DO_ADD
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7923
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7924
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7925
        case 0x61:  /* SUB */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7926
          DO_SUB
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7927
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7928
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7929
        case 0x62:  /* DIV */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7930
          DO_DIV
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7931
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7932
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7933
        case 0x63:  /* MUL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7934
          DO_MUL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7935
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7936
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7937
        case 0x64:  /* ABS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7938
          DO_ABS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7939
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7940
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7941
        case 0x65:  /* NEG */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7942
          DO_NEG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7943
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7944
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7945
        case 0x66:  /* FLOOR */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7946
          DO_FLOOR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7947
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7948
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7949
        case 0x67:  /* CEILING */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7950
          DO_CEILING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7951
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7952
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7953
        case 0x68:  /* ROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7954
        case 0x69:  /* ROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7955
        case 0x6A:  /* ROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7956
        case 0x6B:  /* ROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7957
          DO_ROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7958
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7959
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7960
        case 0x6C:  /* NROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7961
        case 0x6D:  /* NROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7962
        case 0x6E:  /* NRRUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7963
        case 0x6F:  /* NROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7964
          DO_NROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7965
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7966
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7967
        case 0x70:  /* WCVTF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7968
          DO_WCVTF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7969
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7970
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7971
        case 0x71:  /* DELTAP2 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7972
        case 0x72:  /* DELTAP3 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7973
          Ins_DELTAP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7974
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7975
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7976
        case 0x73:  /* DELTAC0 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7977
        case 0x74:  /* DELTAC1 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7978
        case 0x75:  /* DELTAC2 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7979
          Ins_DELTAC( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7980
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7981
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7982
        case 0x76:  /* SROUND */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7983
          DO_SROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7984
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7985
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7986
        case 0x77:  /* S45Round */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7987
          DO_S45ROUND
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7988
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7989
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7990
        case 0x78:  /* JROT */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7991
          DO_JROT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7992
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7993
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7994
        case 0x79:  /* JROF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7995
          DO_JROF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7996
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7997
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7998
        case 0x7A:  /* ROFF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  7999
          DO_ROFF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8000
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8001
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8002
        case 0x7B:  /* ???? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8003
          Ins_UNKNOWN( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8004
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8005
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8006
        case 0x7C:  /* RUTG */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8007
          DO_RUTG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8008
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8009
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8010
        case 0x7D:  /* RDTG */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8011
          DO_RDTG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8012
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8013
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8014
        case 0x7E:  /* SANGW */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8015
        case 0x7F:  /* AA    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8016
          /* nothing - obsolete */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8017
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8018
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8019
        case 0x80:  /* FLIPPT */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8020
          Ins_FLIPPT( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8021
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8022
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8023
        case 0x81:  /* FLIPRGON */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8024
          Ins_FLIPRGON( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8025
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8026
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8027
        case 0x82:  /* FLIPRGOFF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8028
          Ins_FLIPRGOFF( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8029
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8030
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8031
        case 0x83:  /* UNKNOWN */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8032
        case 0x84:  /* UNKNOWN */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8033
          Ins_UNKNOWN( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8034
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8035
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8036
        case 0x85:  /* SCANCTRL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8037
          Ins_SCANCTRL( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8038
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8039
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8040
        case 0x86:  /* SDPVTL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8041
        case 0x87:  /* SDPVTL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8042
          Ins_SDPVTL( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8043
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8044
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8045
        case 0x88:  /* GETINFO */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8046
          Ins_GETINFO( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8047
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8048
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8049
        case 0x89:  /* IDEF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8050
          Ins_IDEF( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8051
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8052
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8053
        case 0x8A:  /* ROLL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8054
          Ins_ROLL( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8055
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8056
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8057
        case 0x8B:  /* MAX */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8058
          DO_MAX
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8059
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8060
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8061
        case 0x8C:  /* MIN */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8062
          DO_MIN
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8063
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8064
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8065
        case 0x8D:  /* SCANTYPE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8066
          Ins_SCANTYPE( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8067
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8068
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8069
        case 0x8E:  /* INSTCTRL */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8070
          Ins_INSTCTRL( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8071
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8072
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8073
        case 0x8F:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8074
          Ins_UNKNOWN( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8075
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8076
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8077
        default:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8078
          if ( opcode >= 0xE0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8079
            Ins_MIRP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8080
          else if ( opcode >= 0xC0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8081
            Ins_MDRP( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8082
          else if ( opcode >= 0xB8 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8083
            Ins_PUSHW( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8084
          else if ( opcode >= 0xB0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8085
            Ins_PUSHB( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8086
          else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8087
            Ins_UNKNOWN( EXEC_ARG_ args );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8088
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8089
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8090
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8091
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8092
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8093
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8094
      Instruct_Dispatch[CUR.opcode]( EXEC_ARG_ &CUR.stack[CUR.args] );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8095
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8096
#endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8097
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8098
      if ( CUR.error != TT_Err_Ok )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8099
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8100
        switch ( CUR.error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8101
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8102
        case TT_Err_Invalid_Opcode: /* looking for redefined instructions */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8103
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8104
            TT_DefRecord*  def   = CUR.IDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8105
            TT_DefRecord*  limit = def + CUR.numIDefs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8106
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8107
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8108
            for ( ; def < limit; def++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8109
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8110
              if ( def->active && CUR.opcode == (FT_Byte)def->opc )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8111
              {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8112
                TT_CallRec*  callrec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8113
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8115
                if ( CUR.callTop >= CUR.callSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8116
                {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8117
                  CUR.error = TT_Err_Invalid_Reference;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8118
                  goto LErrorLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8119
                }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8120
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8121
                callrec = &CUR.callStack[CUR.callTop];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8122
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8123
                callrec->Caller_Range = CUR.curRange;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8124
                callrec->Caller_IP    = CUR.IP + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8125
                callrec->Cur_Count    = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8126
                callrec->Cur_Restart  = def->start;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8127
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8128
                if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8129
                  goto LErrorLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8130
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8131
                goto LSuiteLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8132
              }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8133
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8134
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8135
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8136
          CUR.error = TT_Err_Invalid_Opcode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8137
          goto LErrorLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8138
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8139
#if 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8140
          break;   /* Unreachable code warning suppression.             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8141
                   /* Leave to remind in case a later change the editor */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8142
                   /* to consider break;                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8143
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8144
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8145
        default:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8146
          goto LErrorLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8147
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8148
#if 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8149
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8150
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8151
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8152
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8153
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8154
      CUR.top = CUR.new_top;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8155
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8156
      if ( CUR.step_ins )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8157
        CUR.IP += CUR.length;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8158
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8159
      /* increment instruction counter and check if we didn't */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8160
      /* run this program for too long (e.g. infinite loops). */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8161
      if ( ++ins_counter > MAX_RUNNABLE_OPCODES )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8162
        return TT_Err_Execution_Too_Long;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8163
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8164
    LSuiteLabel_:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8165
      if ( CUR.IP >= CUR.codeSize )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8166
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8167
        if ( CUR.callTop > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8168
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8169
          CUR.error = TT_Err_Code_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8170
          goto LErrorLabel_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8171
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8172
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8173
          goto LNo_Error_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8174
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8175
    } while ( !CUR.instruction_trap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8176
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8177
  LNo_Error_:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8178
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8179
#ifdef TT_CONFIG_OPTION_STATIC_RASTER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8180
    *exc = cur;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8181
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8182
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8183
    return TT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8184
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8185
  LErrorCodeOverflow_:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8186
    CUR.error = TT_Err_Code_Overflow;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8187
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8188
  LErrorLabel_:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8189
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8190
#ifdef TT_CONFIG_OPTION_STATIC_RASTER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8191
    *exc = cur;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8192
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8193
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8194
    /* If any errors have occurred, function tables may be broken. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8195
    /* Force a re-execution of `prep' and `fpgm' tables if no      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8196
    /* bytecode debugger is run.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8197
    if ( CUR.error && !CUR.instruction_trap )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8198
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8199
      FT_TRACE1(( "  The interpreter returned error 0x%x\n", CUR.error ));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8200
      exc->size->cvt_ready      = FALSE;  
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8201
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8202
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8203
    return CUR.error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8204
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8205
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8206
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8207
#endif /* TT_USE_BYTECODE_INTERPRETER */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8208
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8209
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  8210
/* END */