vrshoot

diff libs/ft2static/freetype/internal/ftgloadr.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/ft2static/freetype/internal/ftgloadr.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,168 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  ftgloadr.h                                                             */
     1.7 +/*                                                                         */
     1.8 +/*    The FreeType glyph loader (specification).                           */
     1.9 +/*                                                                         */
    1.10 +/*  Copyright 2002, 2003, 2005, 2006 by                                    */
    1.11 +/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
    1.12 +/*                                                                         */
    1.13 +/*  This file is part of the FreeType project, and may only be used,       */
    1.14 +/*  modified, and distributed under the terms of the FreeType project      */
    1.15 +/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    1.16 +/*  this file you indicate that you have read the license and              */
    1.17 +/*  understand and accept it fully.                                        */
    1.18 +/*                                                                         */
    1.19 +/***************************************************************************/
    1.20 +
    1.21 +
    1.22 +#ifndef __FTGLOADR_H__
    1.23 +#define __FTGLOADR_H__
    1.24 +
    1.25 +
    1.26 +#include <ft2build.h>
    1.27 +#include FT_FREETYPE_H
    1.28 +
    1.29 +
    1.30 +FT_BEGIN_HEADER
    1.31 +
    1.32 +
    1.33 +  /*************************************************************************/
    1.34 +  /*                                                                       */
    1.35 +  /* <Struct>                                                              */
    1.36 +  /*    FT_GlyphLoader                                                     */
    1.37 +  /*                                                                       */
    1.38 +  /* <Description>                                                         */
    1.39 +  /*    The glyph loader is an internal object used to load several glyphs */
    1.40 +  /*    together (for example, in the case of composites).                 */
    1.41 +  /*                                                                       */
    1.42 +  /* <Note>                                                                */
    1.43 +  /*    The glyph loader implementation is not part of the high-level API, */
    1.44 +  /*    hence the forward structure declaration.                           */
    1.45 +  /*                                                                       */
    1.46 +  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;
    1.47 +
    1.48 +
    1.49 +#if 0  /* moved to freetype.h in version 2.2 */
    1.50 +#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1
    1.51 +#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2
    1.52 +#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4
    1.53 +#define FT_SUBGLYPH_FLAG_SCALE                   8
    1.54 +#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40
    1.55 +#define FT_SUBGLYPH_FLAG_2X2                  0x80
    1.56 +#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200
    1.57 +#endif
    1.58 +
    1.59 +
    1.60 +  typedef struct  FT_SubGlyphRec_
    1.61 +  {
    1.62 +    FT_Int     index;
    1.63 +    FT_UShort  flags;
    1.64 +    FT_Int     arg1;
    1.65 +    FT_Int     arg2;
    1.66 +    FT_Matrix  transform;
    1.67 +
    1.68 +  } FT_SubGlyphRec;
    1.69 +
    1.70 +
    1.71 +  typedef struct  FT_GlyphLoadRec_
    1.72 +  {
    1.73 +    FT_Outline   outline;       /* outline                   */
    1.74 +    FT_Vector*   extra_points;  /* extra points table        */
    1.75 +    FT_Vector*   extra_points2; /* second extra points table */
    1.76 +    FT_UInt      num_subglyphs; /* number of subglyphs       */
    1.77 +    FT_SubGlyph  subglyphs;     /* subglyphs                 */
    1.78 +
    1.79 +  } FT_GlyphLoadRec, *FT_GlyphLoad;
    1.80 +
    1.81 +
    1.82 +  typedef struct  FT_GlyphLoaderRec_
    1.83 +  {
    1.84 +    FT_Memory        memory;
    1.85 +    FT_UInt          max_points;
    1.86 +    FT_UInt          max_contours;
    1.87 +    FT_UInt          max_subglyphs;
    1.88 +    FT_Bool          use_extra;
    1.89 +
    1.90 +    FT_GlyphLoadRec  base;
    1.91 +    FT_GlyphLoadRec  current;
    1.92 +
    1.93 +    void*            other;            /* for possible future extension? */
    1.94 +
    1.95 +  } FT_GlyphLoaderRec;
    1.96 +
    1.97 +
    1.98 +  /* create new empty glyph loader */
    1.99 +  FT_BASE( FT_Error )
   1.100 +  FT_GlyphLoader_New( FT_Memory        memory,
   1.101 +                      FT_GlyphLoader  *aloader );
   1.102 +
   1.103 +  /* add an extra points table to a glyph loader */
   1.104 +  FT_BASE( FT_Error )
   1.105 +  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );
   1.106 +
   1.107 +  /* destroy a glyph loader */
   1.108 +  FT_BASE( void )
   1.109 +  FT_GlyphLoader_Done( FT_GlyphLoader  loader );
   1.110 +
   1.111 +  /* reset a glyph loader (frees everything int it) */
   1.112 +  FT_BASE( void )
   1.113 +  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );
   1.114 +
   1.115 +  /* rewind a glyph loader */
   1.116 +  FT_BASE( void )
   1.117 +  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );
   1.118 +
   1.119 +  /* check that there is enough space to add `n_points' and `n_contours' */
   1.120 +  /* to the glyph loader                                                 */
   1.121 +  FT_BASE( FT_Error )
   1.122 +  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,
   1.123 +                              FT_UInt         n_points,
   1.124 +                              FT_UInt         n_contours );
   1.125 +
   1.126 +
   1.127 +#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                         \
   1.128 +   ( (_count) == 0 || ((_loader)->base.outline.n_points    +              \
   1.129 +                       (_loader)->current.outline.n_points +              \
   1.130 +                       (unsigned long)(_count)) <= (_loader)->max_points )
   1.131 +
   1.132 +#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                          \
   1.133 +  ( (_count) == 0 || ((_loader)->base.outline.n_contours    +              \
   1.134 +                      (_loader)->current.outline.n_contours +              \
   1.135 +                      (unsigned long)(_count)) <= (_loader)->max_contours )
   1.136 +
   1.137 +#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \
   1.138 +  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \
   1.139 +      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \
   1.140 +    ? 0                                                                \
   1.141 +    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
   1.142 +
   1.143 +
   1.144 +  /* check that there is enough space to add `n_subs' sub-glyphs to */
   1.145 +  /* a glyph loader                                                 */
   1.146 +  FT_BASE( FT_Error )
   1.147 +  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,
   1.148 +                                 FT_UInt         n_subs );
   1.149 +
   1.150 +  /* prepare a glyph loader, i.e. empty the current glyph */
   1.151 +  FT_BASE( void )
   1.152 +  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );
   1.153 +
   1.154 +  /* add the current glyph to the base glyph */
   1.155 +  FT_BASE( void )
   1.156 +  FT_GlyphLoader_Add( FT_GlyphLoader  loader );
   1.157 +
   1.158 +  /* copy points from one glyph loader to another */
   1.159 +  FT_BASE( FT_Error )
   1.160 +  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,
   1.161 +                             FT_GlyphLoader  source );
   1.162 +
   1.163 + /* */
   1.164 +
   1.165 +
   1.166 +FT_END_HEADER
   1.167 +
   1.168 +#endif /* __FTGLOADR_H__ */
   1.169 +
   1.170 +
   1.171 +/* END */