misc/libfreetype/src/base/ftgloadr.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
/*  ftgloadr.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
/*    The FreeType glyph loader (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 2002, 2003, 2004, 2005, 2006, 2010 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
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#include FT_INTERNAL_GLYPH_LOADER_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#include FT_INTERNAL_MEMORY_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#include FT_INTERNAL_OBJECTS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
#undef  FT_COMPONENT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#define FT_COMPONENT  trace_gloader
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
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
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
  /*****                    G L Y P H   L O A D E R                    *****/
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
  /*****                                                               *****/
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
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  /* The glyph loader is a simple object which is used to load a set of    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
  /* glyphs easily.  It is critical for the correct loading of composites. */
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
  /* Ideally, one can see it as a stack of abstract `glyph' objects.       */
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
  /*   loader.base     Is really the bottom of the stack.  It describes a  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
  /*                   single glyph image made of the juxtaposition of     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  /*                   several glyphs (those `in the stack').              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
  /*   loader.current  Describes the top of the stack, on which a new      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
  /*                   glyph can be loaded.                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
  /*   Rewind          Clears the stack.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
  /*   Prepare         Set up `loader.current' for addition of a new glyph */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
  /*                   image.                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
  /*   Add             Add the `current' glyph image to the `base' one,    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
  /*                   and prepare for another one.                        */
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
  /* The glyph loader is now a base object.  Each driver used to           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
  /* re-implement it in one way or the other, which wasted code and        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
  /* energy.                                                               */
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
  /* create a new glyph loader */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  FT_BASE_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  FT_GlyphLoader_New( FT_Memory        memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
                      FT_GlyphLoader  *aloader )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
    FT_GlyphLoader  loader = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
    FT_Error        error;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
    if ( !FT_NEW( loader ) )
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
      loader->memory = memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
      *aloader       = loader;
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
    return error;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
  /* rewind the glyph loader - reset counters to 0 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader )
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_GlyphLoad  base    = &loader->base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
    FT_GlyphLoad  current = &loader->current;
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
    base->outline.n_points   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
    base->outline.n_contours = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
    base->num_subglyphs      = 0;
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
    *current = *base;
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
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
  /* reset the glyph loader, frees all allocated tables */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
  /* and starts from zero                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  FT_GlyphLoader_Reset( FT_GlyphLoader  loader )
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
    FT_Memory memory = loader->memory;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
    FT_FREE( loader->base.outline.points );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
    FT_FREE( loader->base.outline.tags );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
    FT_FREE( loader->base.outline.contours );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
    FT_FREE( loader->base.extra_points );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
    FT_FREE( loader->base.subglyphs );
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
    loader->base.extra_points2 = NULL;
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
    loader->max_points    = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
    loader->max_contours  = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
    loader->max_subglyphs = 0;
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
    FT_GlyphLoader_Rewind( loader );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
  /* delete a glyph loader */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
  FT_GlyphLoader_Done( FT_GlyphLoader  loader )
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
    if ( loader )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
      FT_Memory memory = loader->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
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
      FT_GlyphLoader_Reset( loader );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
      FT_FREE( loader );
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
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
  /* re-adjust the `current' outline fields */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
  FT_GlyphLoader_Adjust_Points( FT_GlyphLoader  loader )
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_Outline*  base    = &loader->base.outline;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
    FT_Outline*  current = &loader->current.outline;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
    current->points   = base->points   + base->n_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
    current->tags     = base->tags     + base->n_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
    current->contours = base->contours + base->n_contours;
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
    /* handle extra points table - if any */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
    if ( loader->use_extra )
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
      loader->current.extra_points  = loader->base.extra_points +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
                                      base->n_points;
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
      loader->current.extra_points2 = loader->base.extra_points2 +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
                                      base->n_points;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
  FT_BASE_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader )
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
    FT_Error   error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
    FT_Memory  memory = loader->memory;
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
    if ( !FT_NEW_ARRAY( loader->base.extra_points, 2 * loader->max_points ) )
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
      loader->use_extra          = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
      loader->base.extra_points2 = loader->base.extra_points +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
                                   loader->max_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
      FT_GlyphLoader_Adjust_Points( loader );
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
    return error;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
  /* re-adjust the `current' subglyphs field */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
  FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader  loader )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
    FT_GlyphLoad  base    = &loader->base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
    FT_GlyphLoad  current = &loader->current;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
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
    current->subglyphs = base->subglyphs + base->num_subglyphs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
  }
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
  /* Ensure that we can add `n_points' and `n_contours' to our glyph.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
  /* This function reallocates its outline tables if necessary.  Note that */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
  /* it DOESN'T change the number of points within the loader!             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
  FT_BASE_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
                              FT_UInt         n_points,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
                              FT_UInt         n_contours )
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
    FT_Memory    memory  = loader->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
    FT_Error     error   = FT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
    FT_Outline*  base    = &loader->base.outline;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
    FT_Outline*  current = &loader->current.outline;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
    FT_Bool      adjust  = 0;
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
    FT_UInt      new_max, old_max;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
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
    /* check points & tags */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
    new_max = base->n_points + current->n_points + n_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
    old_max = loader->max_points;
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
    if ( new_max > old_max )
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
      new_max = FT_PAD_CEIL( new_max, 8 );
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
      if ( new_max > FT_OUTLINE_POINTS_MAX )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
        return FT_Err_Array_Too_Large;
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
      if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
           FT_RENEW_ARRAY( base->tags,   old_max, new_max ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
        goto Exit;
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
      if ( loader->use_extra )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
        if ( FT_RENEW_ARRAY( loader->base.extra_points,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
                             old_max * 2, new_max * 2 ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
          goto Exit;
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
        FT_ARRAY_MOVE( loader->base.extra_points + new_max,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
                       loader->base.extra_points + old_max,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
                       old_max );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
        loader->base.extra_points2 = loader->base.extra_points + new_max;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
      }
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
      adjust = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
      loader->max_points = new_max;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
    /* check contours */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
    old_max = loader->max_contours;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
    new_max = base->n_contours + current->n_contours +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
              n_contours;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
    if ( new_max > old_max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
      new_max = FT_PAD_CEIL( new_max, 4 );
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
      if ( new_max > FT_OUTLINE_CONTOURS_MAX )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
        return FT_Err_Array_Too_Large;
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
      if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
        goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
      adjust = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
      loader->max_contours = new_max;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
    if ( adjust )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
      FT_GlyphLoader_Adjust_Points( loader );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
    return error;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
  /* Ensure that we can add `n_subglyphs' to our glyph. this function */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
  /* reallocates its subglyphs table if necessary.  Note that it DOES */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
  /* NOT change the number of subglyphs within the loader!            */
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_BASE_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
                                 FT_UInt         n_subs )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
    FT_Memory     memory = loader->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
    FT_Error      error  = FT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
    FT_UInt       new_max, old_max;
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_GlyphLoad  base    = &loader->base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   284
    FT_GlyphLoad  current = &loader->current;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
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
    new_max = base->num_subglyphs + current->num_subglyphs + n_subs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
    old_max = loader->max_subglyphs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
    if ( new_max > old_max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   290
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   291
      new_max = FT_PAD_CEIL( new_max, 2 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
      if ( FT_RENEW_ARRAY( base->subglyphs, old_max, new_max ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   293
        goto Exit;
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
      loader->max_subglyphs = new_max;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
      FT_GlyphLoader_Adjust_Subglyphs( loader );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
    }
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
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
    return error;
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
  /* prepare loader for the addition of a new glyph on top of the base one */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   307
  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader )
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
    FT_GlyphLoad  current = &loader->current;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
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
    current->outline.n_points   = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
    current->outline.n_contours = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
    current->num_subglyphs      = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
    FT_GlyphLoader_Adjust_Points   ( loader );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
    FT_GlyphLoader_Adjust_Subglyphs( loader );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
  /* add current glyph to the base image - and prepare for another */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
  FT_GlyphLoader_Add( FT_GlyphLoader  loader )
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_GlyphLoad  base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   326
    FT_GlyphLoad  current;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
    FT_UInt       n_curr_contours;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   329
    FT_UInt       n_base_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   330
    FT_UInt       n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   331
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
    if ( !loader )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
      return;
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
    base    = &loader->base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
    current = &loader->current;
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
    n_curr_contours = current->outline.n_contours;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
    n_base_points   = base->outline.n_points;
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
    base->outline.n_points =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
      (short)( base->outline.n_points + current->outline.n_points );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
    base->outline.n_contours =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
      (short)( base->outline.n_contours + current->outline.n_contours );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
    base->num_subglyphs += current->num_subglyphs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   349
    /* adjust contours count in newest outline */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
    for ( n = 0; n < n_curr_contours; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
      current->outline.contours[n] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
        (short)( current->outline.contours[n] + n_base_points );
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
    /* prepare for another new glyph image */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
    FT_GlyphLoader_Prepare( loader );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
  FT_BASE_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
                             FT_GlyphLoader  source )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
    FT_UInt   num_points   = source->base.outline.n_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
    FT_UInt   num_contours = source->base.outline.n_contours;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
    error = FT_GlyphLoader_CheckPoints( target, num_points, num_contours );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
    if ( !error )
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
      FT_Outline*  out = &target->base.outline;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
      FT_Outline*  in  = &source->base.outline;
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
      FT_ARRAY_COPY( out->points, in->points,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   376
                     num_points );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
      FT_ARRAY_COPY( out->tags, in->tags,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
                     num_points );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
      FT_ARRAY_COPY( out->contours, in->contours,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
                     num_contours );
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
      /* do we need to copy the extra points? */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
      if ( target->use_extra && source->use_extra )
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
        FT_ARRAY_COPY( target->base.extra_points, source->base.extra_points,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
                       num_points );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
        FT_ARRAY_COPY( target->base.extra_points2, source->base.extra_points2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
                       num_points );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
      }
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
      out->n_points   = (short)num_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
      out->n_contours = (short)num_contours;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
      FT_GlyphLoader_Adjust_Points( target );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
    return error;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
/* END */