misc/libfreetype/src/truetype/ttgxvar.h
author koda
Mon, 25 Apr 2011 01:46:54 +0200
changeset 5172 88f2e05288ba
permissions -rw-r--r--
aaand let's add freetype as well while we are at it other smaller changes
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
/*  ttgxvar.h                                                              */
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 GX Font Variation loader (specification)                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 2004 by                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, Werner Lemberg and George Williams.      */
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
#ifndef __TTGXVAR_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#define __TTGXVAR_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
#include "ttobjs.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
FT_BEGIN_HEADER
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
  /*************************************************************************/
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
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
  /*    GX_AVarCorrespondenceRec                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
  /*    A data structure representing `shortFracCorrespondence' in `avar'  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
  /*    table according to the specifications from Apple.                  */
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
  typedef struct  GX_AVarCorrespondenceRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
    FT_Fixed  fromCoord;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
    FT_Fixed  toCoord;
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
  } GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  /*    GX_AVarRec                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
  /*    Data from the segment field of `avar' table.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
  /*    There is one of these for each axis.                               */
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
  typedef struct  GX_AVarSegmentRec_
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
    FT_UShort              pairCount;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
    GX_AVarCorrespondence  correspondence; /* array with pairCount entries */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
  } GX_AVarSegmentRec, *GX_AVarSegment;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
  /*    GX_BlendRec                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
  /*    Data for interpolating a font from a distortable font specified    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  /*    by the GX *var tables ([fgca]var).                                 */
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
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
  /*    num_axis         :: The number of axes along which interpolation   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
  /*                         may happen                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
  /*    normalizedcoords :: A normalized value (between [-1,1]) indicating */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
  /*                        the contribution along each axis to the final  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
  /*                        interpolated font.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
  typedef struct  GX_BlendRec_
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
    FT_UInt         num_axis;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
    FT_Fixed*       normalizedcoords;
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
    FT_MM_Var*      mmvar;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
    FT_Offset       mmvar_len;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
    FT_Bool         avar_checked;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
    GX_AVarSegment  avar_segment;
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
    FT_UInt         tuplecount;      /* shared tuples in `gvar'           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
    FT_Fixed*       tuplecoords;     /* tuplecoords[tuplecount][num_axis] */
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
    FT_UInt         gv_glyphcnt;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
    FT_ULong*       glyphoffsets;
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
  } GX_BlendRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
  /* <enum>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  /*    GX_TupleCountFlags                                                 */
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
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
  /*    Flags used within the `TupleCount' field of the `gvar' table.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
  typedef enum  GX_TupleCountFlags_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
    GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
    GX_TC_RESERVED_TUPLE_FLAGS       = 0x7000,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
    GX_TC_TUPLE_COUNT_MASK           = 0x0FFF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
  } GX_TupleCountFlags;
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
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
  /* <enum>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
  /*    GX_TupleIndexFlags                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
  /*    Flags used within the `TupleIndex' field of the `gvar' and `cvar'  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
  /*    tables.                                                            */
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
  typedef enum  GX_TupleIndexFlags_
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
    GX_TI_EMBEDDED_TUPLE_COORD  = 0x8000,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
    GX_TI_INTERMEDIATE_TUPLE    = 0x4000,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
    GX_TI_PRIVATE_POINT_NUMBERS = 0x2000,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
    GX_TI_RESERVED_TUPLE_FLAG   = 0x1000,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
    GX_TI_TUPLE_INDEX_MASK      = 0x0FFF
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
  } GX_TupleIndexFlags;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
#define TTAG_wght  FT_MAKE_TAG( 'w', 'g', 'h', 't' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
#define TTAG_wdth  FT_MAKE_TAG( 'w', 'd', 't', 'h' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
#define TTAG_opsz  FT_MAKE_TAG( 'o', 'p', 's', 'z' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
#define TTAG_slnt  FT_MAKE_TAG( 's', 'l', 'n', 't' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
  TT_Set_MM_Blend( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
                   FT_UInt    num_coords,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
                   FT_Fixed*  coords );
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
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
  TT_Set_Var_Design( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
                     FT_UInt    num_coords,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
                     FT_Fixed*  coords );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
  TT_Get_MM_Var( TT_Face      face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
                 FT_MM_Var*  *master );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
  tt_face_vary_cvt( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
                    FT_Stream  stream );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
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
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
  TT_Vary_Get_Glyph_Deltas( TT_Face      face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
                            FT_UInt      glyph_index,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
                            FT_Vector*  *deltas,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
                            FT_UInt      n_points );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
  FT_LOCAL( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
  tt_done_blend( FT_Memory  memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
                 GX_Blend   blend );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
#endif /* __TTGXVAR_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
/* END */