misc/libfreetype/include/freetype/internal/ftgloadr.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
/*  ftgloadr.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
/*    The FreeType glyph 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 2002, 2003, 2005, 2006 by                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
#ifndef __FTGLOADR_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#define __FTGLOADR_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 FT_FREETYPE_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
  /*    FT_GlyphLoader                                                     */
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
  /*    The glyph loader is an internal object used to load several glyphs */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
  /*    together (for example, in the case of composites).                 */
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
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
  /*    The glyph loader implementation is not part of the high-level API, */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  /*    hence the forward structure declaration.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
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
#if 0  /* moved to freetype.h in version 2.2 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
#define FT_SUBGLYPH_FLAG_SCALE                   8
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
#define FT_SUBGLYPH_FLAG_2X2                  0x80
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
#endif
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
  typedef struct  FT_SubGlyphRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
    FT_Int     index;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
    FT_UShort  flags;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
    FT_Int     arg1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
    FT_Int     arg2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
    FT_Matrix  transform;
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
  } FT_SubGlyphRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  typedef struct  FT_GlyphLoadRec_
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
    FT_Outline   outline;       /* outline                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
    FT_Vector*   extra_points;  /* extra points table        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
    FT_Vector*   extra_points2; /* second extra points table */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
    FT_UInt      num_subglyphs; /* number of subglyphs       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
    FT_SubGlyph  subglyphs;     /* subglyphs                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
  } FT_GlyphLoadRec, *FT_GlyphLoad;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
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
  typedef struct  FT_GlyphLoaderRec_
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
    FT_Memory        memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
    FT_UInt          max_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
    FT_UInt          max_contours;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
    FT_UInt          max_subglyphs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
    FT_Bool          use_extra;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
    FT_GlyphLoadRec  base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
    FT_GlyphLoadRec  current;
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
    void*            other;            /* for possible future extension? */
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_GlyphLoaderRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
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
  /* create new empty glyph loader */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
  FT_GlyphLoader_New( FT_Memory        memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
                      FT_GlyphLoader  *aloader );
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
  /* add an extra points table to a glyph loader */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );
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
  /* destroy a glyph loader */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
  FT_GlyphLoader_Done( FT_GlyphLoader  loader );
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
  /* reset a glyph loader (frees everything int it) */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
  /* rewind a glyph loader */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
  /* check that there is enough space to add `n_points' and `n_contours' */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
  /* to the glyph loader                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
                              FT_UInt         n_points,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
                              FT_UInt         n_contours );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
   ( (_count) == 0 || ((_loader)->base.outline.n_points    +              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
                       (_loader)->current.outline.n_points +              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
                       (unsigned long)(_count)) <= (_loader)->max_points )
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
#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
  ( (_count) == 0 || ((_loader)->base.outline.n_contours    +              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
                      (_loader)->current.outline.n_contours +              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
                      (unsigned long)(_count)) <= (_loader)->max_contours )
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
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
    ? 0                                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
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
  /* check that there is enough space to add `n_subs' sub-glyphs to */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
  /* a glyph loader                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
                                 FT_UInt         n_subs );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
  /* prepare a glyph loader, i.e. empty the current glyph */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
  /* add the current glyph to the base glyph */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
  FT_GlyphLoader_Add( FT_GlyphLoader  loader );
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
  /* copy points from one glyph loader to another */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
                             FT_GlyphLoader  source );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
 /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
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
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
#endif /* __FTGLOADR_H__ */
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
/* END */