ttgxvar.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:8k
源码类别:

其他游戏

开发平台:

Visual C++

  1. /***************************************************************************/
  2. /*                                                                         */
  3. /*  ttgxvar.h                                                              */
  4. /*                                                                         */
  5. /*    TrueType GX Font Variation loader (specification)                    */
  6. /*                                                                         */
  7. /*  Copyright 2004 by                                                      */
  8. /*  David Turner, Robert Wilhelm, Werner Lemberg and George Williams.      */
  9. /*                                                                         */
  10. /*  This file is part of the FreeType project, and may only be used,       */
  11. /*  modified, and distributed under the terms of the FreeType project      */
  12. /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
  13. /*  this file you indicate that you have read the license and              */
  14. /*  understand and accept it fully.                                        */
  15. /*                                                                         */
  16. /***************************************************************************/
  17. #ifndef __TTGXVAR_H__
  18. #define __TTGXVAR_H__
  19. #include <ft2build.h>
  20. #include "ttobjs.h"
  21. FT_BEGIN_HEADER
  22.   /*************************************************************************/
  23.   /*                                                                       */
  24.   /* <Struct>                                                              */
  25.   /*    GX_AVarCorrespondenceRec                                           */
  26.   /*                                                                       */
  27.   /* <Description>                                                         */
  28.   /*    A data structure representing `shortFracCorrespondence' in `avar'  */
  29.   /*    table according to the specifications from Apple.                  */
  30.   /*                                                                       */
  31.   typedef struct  GX_AVarCorrespondenceRec_
  32.   {
  33.     FT_Fixed  fromCoord;
  34.     FT_Fixed  toCoord;
  35.   } GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence;
  36.   /*************************************************************************/
  37.   /*                                                                       */
  38.   /* <Struct>                                                              */
  39.   /*    GX_AVarRec                                                         */
  40.   /*                                                                       */
  41.   /* <Description>                                                         */
  42.   /*    Data from the segment field of `avar' table.                       */
  43.   /*    There is one of these for each axis.                               */
  44.   /*                                                                       */
  45.   typedef struct  GX_AVarSegmentRec_
  46.   {
  47.     FT_UShort              pairCount;
  48.     GX_AVarCorrespondence  correspondence; /* array with pairCount entries */
  49.   } GX_AVarSegmentRec, *GX_AVarSegment;
  50.   /*************************************************************************/
  51.   /*                                                                       */
  52.   /* <Struct>                                                              */
  53.   /*    GX_BlendRec                                                        */
  54.   /*                                                                       */
  55.   /* <Description>                                                         */
  56.   /*    Data for interpolating a font from a distortable font specified    */
  57.   /*    by the GX *var tables ([fgca]var).                                 */
  58.   /*                                                                       */
  59.   /* <Fields>                                                              */
  60.   /*    num_axis         :: The number of axes along which interpolation   */
  61.   /*                         may happen                                    */
  62.   /*                                                                       */
  63.   /*    normalizedcoords :: A normalized value (between [-1,1]) indicating */
  64.   /*                        the contribution along each axis to the final  */
  65.   /*                        interpolated font.                             */
  66.   /*                                                                       */
  67.   typedef struct  GX_BlendRec_
  68.   {
  69.     FT_UInt         num_axis;
  70.     FT_Fixed*       normalizedcoords;
  71.     FT_MM_Var*      mmvar;
  72.     FT_Int          mmvar_len;
  73.     FT_Bool         avar_checked;
  74.     GX_AVarSegment  avar_segment;
  75.     FT_UInt         tuplecount;      /* shared tuples in `gvar'           */
  76.     FT_Fixed*       tuplecoords;     /* tuplecoords[tuplecount][num_axis] */
  77.     FT_UInt         gv_glyphcnt;
  78.     FT_ULong*       glyphoffsets;
  79.   } GX_BlendRec;
  80.   /*************************************************************************/
  81.   /*                                                                       */
  82.   /* <enum>                                                                */
  83.   /*    GX_TupleCountFlags                                                 */
  84.   /*                                                                       */
  85.   /* <Description>                                                         */
  86.   /*    Flags used within the `TupleCount' field of the `gvar' table.      */
  87.   /*                                                                       */
  88.   typedef enum  GX_TupleCountFlags_
  89.   {
  90.     GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000,
  91.     GX_TC_RESERVED_TUPLE_FLAGS       = 0x7000,
  92.     GX_TC_TUPLE_COUNT_MASK           = 0x0FFF
  93.   } GX_TupleCountFlags;
  94.   /*************************************************************************/
  95.   /*                                                                       */
  96.   /* <enum>                                                                */
  97.   /*    GX_TupleIndexFlags                                                 */
  98.   /*                                                                       */
  99.   /* <Description>                                                         */
  100.   /*    Flags used within the `TupleIndex' field of the `gvar' and `cvar'  */
  101.   /*    tables.                                                            */
  102.   /*                                                                       */
  103.   typedef enum  GX_TupleIndexFlags_
  104.   {
  105.     GX_TI_EMBEDDED_TUPLE_COORD  = 0x8000,
  106.     GX_TI_INTERMEDIATE_TUPLE    = 0x4000,
  107.     GX_TI_PRIVATE_POINT_NUMBERS = 0x2000,
  108.     GX_TI_RESERVED_TUPLE_FLAG   = 0x1000,
  109.     GX_TI_TUPLE_INDEX_MASK      = 0x0FFF
  110.   } GX_TupleIndexFlags;
  111. #define TTAG_wght  FT_MAKE_TAG( 'w', 'g', 'h', 't' )
  112. #define TTAG_wdth  FT_MAKE_TAG( 'w', 'd', 't', 'h' )
  113. #define TTAG_opsz  FT_MAKE_TAG( 'o', 'p', 's', 'z' )
  114. #define TTAG_slnt  FT_MAKE_TAG( 's', 'l', 'n', 't' )
  115.   FT_LOCAL( FT_Error )
  116.   TT_Set_MM_Blend( TT_Face    face,
  117.                    FT_UInt    num_coords,
  118.                    FT_Fixed*  coords );
  119.   FT_LOCAL( FT_Error )
  120.   TT_Set_Var_Design( TT_Face    face,
  121.                      FT_UInt    num_coords,
  122.                      FT_Fixed*  coords );
  123.   FT_LOCAL( FT_Error )
  124.   TT_Get_MM_Var( TT_Face      face,
  125.                  FT_MM_Var*  *master );
  126.   FT_LOCAL( FT_Error )
  127.   tt_face_vary_cvt( TT_Face    face,
  128.                     FT_Stream  stream );
  129.   FT_LOCAL( FT_Error )
  130.   TT_Vary_Get_Glyph_Deltas( TT_Face      face,
  131.                             FT_UInt      glyph_index,
  132.                             FT_Vector*  *deltas,
  133.                             FT_UInt      n_points );
  134.   FT_LOCAL( void )
  135.   tt_done_blend( FT_Memory  memory,
  136.                  GX_Blend   blend );
  137. FT_END_HEADER
  138. #endif /* __TTGXVAR_H__ */
  139. /* END */