vrshoot

diff libs/ft2static/freetype/internal/ftobjs.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/ftobjs.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,1428 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  ftobjs.h                                                               */
     1.7 +/*                                                                         */
     1.8 +/*    The FreeType private base classes (specification).                   */
     1.9 +/*                                                                         */
    1.10 +/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 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 +  /*************************************************************************/
    1.23 +  /*                                                                       */
    1.24 +  /*  This file contains the definition of all internal FreeType classes.  */
    1.25 +  /*                                                                       */
    1.26 +  /*************************************************************************/
    1.27 +
    1.28 +
    1.29 +#ifndef __FTOBJS_H__
    1.30 +#define __FTOBJS_H__
    1.31 +
    1.32 +#include <ft2build.h>
    1.33 +#include FT_RENDER_H
    1.34 +#include FT_SIZES_H
    1.35 +#include FT_LCD_FILTER_H
    1.36 +#include FT_INTERNAL_MEMORY_H
    1.37 +#include FT_INTERNAL_GLYPH_LOADER_H
    1.38 +#include FT_INTERNAL_DRIVER_H
    1.39 +#include FT_INTERNAL_AUTOHINT_H
    1.40 +#include FT_INTERNAL_SERVICE_H
    1.41 +#include FT_INTERNAL_PIC_H
    1.42 +
    1.43 +#ifdef FT_CONFIG_OPTION_INCREMENTAL
    1.44 +#include FT_INCREMENTAL_H
    1.45 +#endif
    1.46 +
    1.47 +
    1.48 +FT_BEGIN_HEADER
    1.49 +
    1.50 +
    1.51 +  /*************************************************************************/
    1.52 +  /*                                                                       */
    1.53 +  /* Some generic definitions.                                             */
    1.54 +  /*                                                                       */
    1.55 +#ifndef TRUE
    1.56 +#define TRUE  1
    1.57 +#endif
    1.58 +
    1.59 +#ifndef FALSE
    1.60 +#define FALSE  0
    1.61 +#endif
    1.62 +
    1.63 +#ifndef NULL
    1.64 +#define NULL  (void*)0
    1.65 +#endif
    1.66 +
    1.67 +
    1.68 +  /*************************************************************************/
    1.69 +  /*                                                                       */
    1.70 +  /* The min and max functions missing in C.  As usual, be careful not to  */
    1.71 +  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */
    1.72 +  /*                                                                       */
    1.73 +#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )
    1.74 +#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )
    1.75 +
    1.76 +#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )
    1.77 +
    1.78 +
    1.79 +#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )
    1.80 +#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )
    1.81 +#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )
    1.82 +
    1.83 +#define FT_PIX_FLOOR( x )     ( (x) & ~63 )
    1.84 +#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )
    1.85 +#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )
    1.86 +
    1.87 +
    1.88 +  /*
    1.89 +   *  Return the highest power of 2 that is <= value; this correspond to
    1.90 +   *  the highest bit in a given 32-bit value.
    1.91 +   */
    1.92 +  FT_BASE( FT_UInt32 )
    1.93 +  ft_highpow2( FT_UInt32  value );
    1.94 +
    1.95 +
    1.96 +  /*
    1.97 +   *  character classification functions -- since these are used to parse
    1.98 +   *  font files, we must not use those in <ctypes.h> which are
    1.99 +   *  locale-dependent
   1.100 +   */
   1.101 +#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )
   1.102 +
   1.103 +#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \
   1.104 +                             ( (unsigned)(x) - 'a' ) < 6U  || \
   1.105 +                             ( (unsigned)(x) - 'A' ) < 6U  )
   1.106 +
   1.107 +  /* the next two macros assume ASCII representation */
   1.108 +#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )
   1.109 +#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )
   1.110 +
   1.111 +#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )
   1.112 +#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )
   1.113 +
   1.114 +
   1.115 +  /*************************************************************************/
   1.116 +  /*************************************************************************/
   1.117 +  /*************************************************************************/
   1.118 +  /****                                                                 ****/
   1.119 +  /****                                                                 ****/
   1.120 +  /****                       C H A R M A P S                           ****/
   1.121 +  /****                                                                 ****/
   1.122 +  /****                                                                 ****/
   1.123 +  /*************************************************************************/
   1.124 +  /*************************************************************************/
   1.125 +  /*************************************************************************/
   1.126 +
   1.127 +  /* handle to internal charmap object */
   1.128 +  typedef struct FT_CMapRec_*              FT_CMap;
   1.129 +
   1.130 +  /* handle to charmap class structure */
   1.131 +  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;
   1.132 +
   1.133 +  /* internal charmap object structure */
   1.134 +  typedef struct  FT_CMapRec_
   1.135 +  {
   1.136 +    FT_CharMapRec  charmap;
   1.137 +    FT_CMap_Class  clazz;
   1.138 +
   1.139 +  } FT_CMapRec;
   1.140 +
   1.141 +  /* typecase any pointer to a charmap handle */
   1.142 +#define FT_CMAP( x )              ((FT_CMap)( x ))
   1.143 +
   1.144 +  /* obvious macros */
   1.145 +#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id
   1.146 +#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id
   1.147 +#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding
   1.148 +#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face
   1.149 +
   1.150 +
   1.151 +  /* class method definitions */
   1.152 +  typedef FT_Error
   1.153 +  (*FT_CMap_InitFunc)( FT_CMap     cmap,
   1.154 +                       FT_Pointer  init_data );
   1.155 +
   1.156 +  typedef void
   1.157 +  (*FT_CMap_DoneFunc)( FT_CMap  cmap );
   1.158 +
   1.159 +  typedef FT_UInt
   1.160 +  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,
   1.161 +                            FT_UInt32  char_code );
   1.162 +
   1.163 +  typedef FT_UInt
   1.164 +  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,
   1.165 +                           FT_UInt32  *achar_code );
   1.166 +
   1.167 +  typedef FT_UInt
   1.168 +  (*FT_CMap_CharVarIndexFunc)( FT_CMap    cmap,
   1.169 +                               FT_CMap    unicode_cmap,
   1.170 +                               FT_UInt32  char_code,
   1.171 +                               FT_UInt32  variant_selector );
   1.172 +
   1.173 +  typedef FT_Bool
   1.174 +  (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap    cmap,
   1.175 +                                   FT_UInt32  char_code,
   1.176 +                                   FT_UInt32  variant_selector );
   1.177 +
   1.178 +  typedef FT_UInt32 *
   1.179 +  (*FT_CMap_VariantListFunc)( FT_CMap    cmap,
   1.180 +                              FT_Memory  mem );
   1.181 +
   1.182 +  typedef FT_UInt32 *
   1.183 +  (*FT_CMap_CharVariantListFunc)( FT_CMap    cmap,
   1.184 +                                  FT_Memory  mem,
   1.185 +                                  FT_UInt32  char_code );
   1.186 +
   1.187 +  typedef FT_UInt32 *
   1.188 +  (*FT_CMap_VariantCharListFunc)( FT_CMap    cmap,
   1.189 +                                  FT_Memory  mem,
   1.190 +                                  FT_UInt32  variant_selector );
   1.191 +
   1.192 +
   1.193 +  typedef struct  FT_CMap_ClassRec_
   1.194 +  {
   1.195 +    FT_ULong               size;
   1.196 +    FT_CMap_InitFunc       init;
   1.197 +    FT_CMap_DoneFunc       done;
   1.198 +    FT_CMap_CharIndexFunc  char_index;
   1.199 +    FT_CMap_CharNextFunc   char_next;
   1.200 +
   1.201 +    /* Subsequent entries are special ones for format 14 -- the variant */
   1.202 +    /* selector subtable which behaves like no other                    */
   1.203 +
   1.204 +    FT_CMap_CharVarIndexFunc      char_var_index;
   1.205 +    FT_CMap_CharVarIsDefaultFunc  char_var_default;
   1.206 +    FT_CMap_VariantListFunc       variant_list;
   1.207 +    FT_CMap_CharVariantListFunc   charvariant_list;
   1.208 +    FT_CMap_VariantCharListFunc   variantchar_list;
   1.209 +
   1.210 +  } FT_CMap_ClassRec;
   1.211 +
   1.212 +#ifndef FT_CONFIG_OPTION_PIC
   1.213 +
   1.214 +#define FT_DECLARE_CMAP_CLASS(class_) \
   1.215 +    FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
   1.216 +
   1.217 +#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \
   1.218 +        char_next_, char_var_index_, char_var_default_, variant_list_,       \
   1.219 +        charvariant_list_, variantchar_list_)                                \
   1.220 +  FT_CALLBACK_TABLE_DEF                                                      \
   1.221 +  const FT_CMap_ClassRec class_ =                                            \
   1.222 +  {                                                                          \
   1.223 +    size_, init_, done_, char_index_, char_next_, char_var_index_,           \
   1.224 +    char_var_default_, variant_list_, charvariant_list_, variantchar_list_   \
   1.225 +  };
   1.226 +#else /* FT_CONFIG_OPTION_PIC */
   1.227 +
   1.228 +#define FT_DECLARE_CMAP_CLASS(class_) \
   1.229 +    void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec*  clazz);
   1.230 +
   1.231 +#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \
   1.232 +        char_next_, char_var_index_, char_var_default_, variant_list_,       \
   1.233 +        charvariant_list_, variantchar_list_)                                \
   1.234 +  void                                                                       \
   1.235 +  FT_Init_Class_##class_( FT_Library library,                                \
   1.236 +                          FT_CMap_ClassRec*  clazz)                          \
   1.237 +  {                                                                          \
   1.238 +    FT_UNUSED(library);                                                      \
   1.239 +    clazz->size = size_;                                                     \
   1.240 +    clazz->init = init_;                                                     \
   1.241 +    clazz->done = done_;                                                     \
   1.242 +    clazz->char_index = char_index_;                                         \
   1.243 +    clazz->char_next = char_next_;                                           \
   1.244 +    clazz->char_var_index = char_var_index_;                                 \
   1.245 +    clazz->char_var_default = char_var_default_;                             \
   1.246 +    clazz->variant_list = variant_list_;                                     \
   1.247 +    clazz->charvariant_list = charvariant_list_;                             \
   1.248 +    clazz->variantchar_list = variantchar_list_;                             \
   1.249 +  } 
   1.250 +#endif /* FT_CONFIG_OPTION_PIC */
   1.251 +
   1.252 +  /* create a new charmap and add it to charmap->face */
   1.253 +  FT_BASE( FT_Error )
   1.254 +  FT_CMap_New( FT_CMap_Class  clazz,
   1.255 +               FT_Pointer     init_data,
   1.256 +               FT_CharMap     charmap,
   1.257 +               FT_CMap       *acmap );
   1.258 +
   1.259 +  /* destroy a charmap and remove it from face's list */
   1.260 +  FT_BASE( void )
   1.261 +  FT_CMap_Done( FT_CMap  cmap );
   1.262 +
   1.263 +
   1.264 +  /*************************************************************************/
   1.265 +  /*                                                                       */
   1.266 +  /* <Struct>                                                              */
   1.267 +  /*    FT_Face_InternalRec                                                */
   1.268 +  /*                                                                       */
   1.269 +  /* <Description>                                                         */
   1.270 +  /*    This structure contains the internal fields of each FT_Face        */
   1.271 +  /*    object.  These fields may change between different releases of     */
   1.272 +  /*    FreeType.                                                          */
   1.273 +  /*                                                                       */
   1.274 +  /* <Fields>                                                              */
   1.275 +  /*    max_points ::                                                      */
   1.276 +  /*      The maximal number of points used to store the vectorial outline */
   1.277 +  /*      of any glyph in this face.  If this value cannot be known in     */
   1.278 +  /*      advance, or if the face isn't scalable, this should be set to 0. */
   1.279 +  /*      Only relevant for scalable formats.                              */
   1.280 +  /*                                                                       */
   1.281 +  /*    max_contours ::                                                    */
   1.282 +  /*      The maximal number of contours used to store the vectorial       */
   1.283 +  /*      outline of any glyph in this face.  If this value cannot be      */
   1.284 +  /*      known in advance, or if the face isn't scalable, this should be  */
   1.285 +  /*      set to 0.  Only relevant for scalable formats.                   */
   1.286 +  /*                                                                       */
   1.287 +  /*    transform_matrix ::                                                */
   1.288 +  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */
   1.289 +  /*      outlines after they are loaded from the font.  Only used by the  */
   1.290 +  /*      convenience functions.                                           */
   1.291 +  /*                                                                       */
   1.292 +  /*    transform_delta ::                                                 */
   1.293 +  /*      A translation vector used to transform glyph outlines after they */
   1.294 +  /*      are loaded from the font.  Only used by the convenience          */
   1.295 +  /*      functions.                                                       */
   1.296 +  /*                                                                       */
   1.297 +  /*    transform_flags ::                                                 */
   1.298 +  /*      Some flags used to classify the transform.  Only used by the     */
   1.299 +  /*      convenience functions.                                           */
   1.300 +  /*                                                                       */
   1.301 +  /*    services ::                                                        */
   1.302 +  /*      A cache for frequently used services.  It should be only         */
   1.303 +  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */
   1.304 +  /*                                                                       */
   1.305 +  /*    incremental_interface ::                                           */
   1.306 +  /*      If non-null, the interface through which glyph data and metrics  */
   1.307 +  /*      are loaded incrementally for faces that do not provide all of    */
   1.308 +  /*      this data when first opened.  This field exists only if          */
   1.309 +  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */
   1.310 +  /*                                                                       */
   1.311 +  /*    ignore_unpatented_hinter ::                                        */
   1.312 +  /*      This boolean flag instructs the glyph loader to ignore the       */
   1.313 +  /*      native font hinter, if one is found.  This is exclusively used   */
   1.314 +  /*      in the case when the unpatented hinter is compiled within the    */
   1.315 +  /*      library.                                                         */
   1.316 +  /*                                                                       */
   1.317 +  /*    refcount ::                                                        */
   1.318 +  /*      A counter initialized to~1 at the time an @FT_Face structure is  */
   1.319 +  /*      created.  @FT_Reference_Face increments this counter, and        */
   1.320 +  /*      @FT_Done_Face only destroys a face if the counter is~1,          */
   1.321 +  /*      otherwise it simply decrements it.                               */
   1.322 +  /*                                                                       */
   1.323 +  typedef struct  FT_Face_InternalRec_
   1.324 +  {
   1.325 +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
   1.326 +    FT_UShort           reserved1;
   1.327 +    FT_Short            reserved2;
   1.328 +#endif
   1.329 +    FT_Matrix           transform_matrix;
   1.330 +    FT_Vector           transform_delta;
   1.331 +    FT_Int              transform_flags;
   1.332 +
   1.333 +    FT_ServiceCacheRec  services;
   1.334 +
   1.335 +#ifdef FT_CONFIG_OPTION_INCREMENTAL
   1.336 +    FT_Incremental_InterfaceRec*  incremental_interface;
   1.337 +#endif
   1.338 +
   1.339 +    FT_Bool             ignore_unpatented_hinter;
   1.340 +    FT_UInt             refcount;
   1.341 +
   1.342 +  } FT_Face_InternalRec;
   1.343 +
   1.344 +
   1.345 +  /*************************************************************************/
   1.346 +  /*                                                                       */
   1.347 +  /* <Struct>                                                              */
   1.348 +  /*    FT_Slot_InternalRec                                                */
   1.349 +  /*                                                                       */
   1.350 +  /* <Description>                                                         */
   1.351 +  /*    This structure contains the internal fields of each FT_GlyphSlot   */
   1.352 +  /*    object.  These fields may change between different releases of     */
   1.353 +  /*    FreeType.                                                          */
   1.354 +  /*                                                                       */
   1.355 +  /* <Fields>                                                              */
   1.356 +  /*    loader            :: The glyph loader object used to load outlines */
   1.357 +  /*                         into the glyph slot.                          */
   1.358 +  /*                                                                       */
   1.359 +  /*    flags             :: Possible values are zero or                   */
   1.360 +  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */
   1.361 +  /*                         that the FT_GlyphSlot structure owns the      */
   1.362 +  /*                         bitmap buffer.                                */
   1.363 +  /*                                                                       */
   1.364 +  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */
   1.365 +  /*                         must be transformed through a specific        */
   1.366 +  /*                         font transformation.  This is _not_ the same  */
   1.367 +  /*                         as the face transform set through             */
   1.368 +  /*                         FT_Set_Transform().                           */
   1.369 +  /*                                                                       */
   1.370 +  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */
   1.371 +  /*                         transformation, if necessary.                 */
   1.372 +  /*                                                                       */
   1.373 +  /*    glyph_delta       :: The 2d translation vector corresponding to    */
   1.374 +  /*                         the glyph transformation, if necessary.       */
   1.375 +  /*                                                                       */
   1.376 +  /*    glyph_hints       :: Format-specific glyph hints management.       */
   1.377 +  /*                                                                       */
   1.378 +
   1.379 +#define FT_GLYPH_OWN_BITMAP  0x1
   1.380 +
   1.381 +  typedef struct  FT_Slot_InternalRec_
   1.382 +  {
   1.383 +    FT_GlyphLoader  loader;
   1.384 +    FT_UInt         flags;
   1.385 +    FT_Bool         glyph_transformed;
   1.386 +    FT_Matrix       glyph_matrix;
   1.387 +    FT_Vector       glyph_delta;
   1.388 +    void*           glyph_hints;
   1.389 +
   1.390 +  } FT_GlyphSlot_InternalRec;
   1.391 +
   1.392 +
   1.393 +#if 0
   1.394 +
   1.395 +  /*************************************************************************/
   1.396 +  /*                                                                       */
   1.397 +  /* <Struct>                                                              */
   1.398 +  /*    FT_Size_InternalRec                                                */
   1.399 +  /*                                                                       */
   1.400 +  /* <Description>                                                         */
   1.401 +  /*    This structure contains the internal fields of each FT_Size        */
   1.402 +  /*    object.  Currently, it's empty.                                    */
   1.403 +  /*                                                                       */
   1.404 +  /*************************************************************************/
   1.405 +
   1.406 +  typedef struct  FT_Size_InternalRec_
   1.407 +  {
   1.408 +    /* empty */
   1.409 +
   1.410 +  } FT_Size_InternalRec;
   1.411 +
   1.412 +#endif
   1.413 +
   1.414 +
   1.415 +  /*************************************************************************/
   1.416 +  /*************************************************************************/
   1.417 +  /****                                                                 ****/
   1.418 +  /****                                                                 ****/
   1.419 +  /****                         M O D U L E S                           ****/
   1.420 +  /****                                                                 ****/
   1.421 +  /****                                                                 ****/
   1.422 +  /*************************************************************************/
   1.423 +  /*************************************************************************/
   1.424 +  /*************************************************************************/
   1.425 +
   1.426 +
   1.427 +  /*************************************************************************/
   1.428 +  /*                                                                       */
   1.429 +  /* <Struct>                                                              */
   1.430 +  /*    FT_ModuleRec                                                       */
   1.431 +  /*                                                                       */
   1.432 +  /* <Description>                                                         */
   1.433 +  /*    A module object instance.                                          */
   1.434 +  /*                                                                       */
   1.435 +  /* <Fields>                                                              */
   1.436 +  /*    clazz   :: A pointer to the module's class.                        */
   1.437 +  /*                                                                       */
   1.438 +  /*    library :: A handle to the parent library object.                  */
   1.439 +  /*                                                                       */
   1.440 +  /*    memory  :: A handle to the memory manager.                         */
   1.441 +  /*                                                                       */
   1.442 +  /*    generic :: A generic structure for user-level extensibility (?).   */
   1.443 +  /*                                                                       */
   1.444 +  typedef struct  FT_ModuleRec_
   1.445 +  {
   1.446 +    FT_Module_Class*  clazz;
   1.447 +    FT_Library        library;
   1.448 +    FT_Memory         memory;
   1.449 +    FT_Generic        generic;
   1.450 +
   1.451 +  } FT_ModuleRec;
   1.452 +
   1.453 +
   1.454 +  /* typecast an object to a FT_Module */
   1.455 +#define FT_MODULE( x )          ((FT_Module)( x ))
   1.456 +#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz
   1.457 +#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library
   1.458 +#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory
   1.459 +
   1.460 +
   1.461 +#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
   1.462 +                                    FT_MODULE_FONT_DRIVER )
   1.463 +
   1.464 +#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
   1.465 +                                      FT_MODULE_RENDERER )
   1.466 +
   1.467 +#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
   1.468 +                                    FT_MODULE_HINTER )
   1.469 +
   1.470 +#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
   1.471 +                                    FT_MODULE_STYLER )
   1.472 +
   1.473 +#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \
   1.474 +                                      FT_MODULE_DRIVER_SCALABLE )
   1.475 +
   1.476 +#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \
   1.477 +                                         FT_MODULE_DRIVER_NO_OUTLINES )
   1.478 +
   1.479 +#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
   1.480 +                                     FT_MODULE_DRIVER_HAS_HINTER )
   1.481 +
   1.482 +
   1.483 +  /*************************************************************************/
   1.484 +  /*                                                                       */
   1.485 +  /* <Function>                                                            */
   1.486 +  /*    FT_Get_Module_Interface                                            */
   1.487 +  /*                                                                       */
   1.488 +  /* <Description>                                                         */
   1.489 +  /*    Finds a module and returns its specific interface as a typeless    */
   1.490 +  /*    pointer.                                                           */
   1.491 +  /*                                                                       */
   1.492 +  /* <Input>                                                               */
   1.493 +  /*    library     :: A handle to the library object.                     */
   1.494 +  /*                                                                       */
   1.495 +  /*    module_name :: The module's name (as an ASCII string).             */
   1.496 +  /*                                                                       */
   1.497 +  /* <Return>                                                              */
   1.498 +  /*    A module-specific interface if available, 0 otherwise.             */
   1.499 +  /*                                                                       */
   1.500 +  /* <Note>                                                                */
   1.501 +  /*    You should better be familiar with FreeType internals to know      */
   1.502 +  /*    which module to look for, and what its interface is :-)            */
   1.503 +  /*                                                                       */
   1.504 +  FT_BASE( const void* )
   1.505 +  FT_Get_Module_Interface( FT_Library   library,
   1.506 +                           const char*  mod_name );
   1.507 +
   1.508 +  FT_BASE( FT_Pointer )
   1.509 +  ft_module_get_service( FT_Module    module,
   1.510 +                         const char*  service_id );
   1.511 +
   1.512 + /* */
   1.513 +
   1.514 +
   1.515 +  /*************************************************************************/
   1.516 +  /*************************************************************************/
   1.517 +  /*************************************************************************/
   1.518 +  /****                                                                 ****/
   1.519 +  /****                                                                 ****/
   1.520 +  /****               FACE, SIZE & GLYPH SLOT OBJECTS                   ****/
   1.521 +  /****                                                                 ****/
   1.522 +  /****                                                                 ****/
   1.523 +  /*************************************************************************/
   1.524 +  /*************************************************************************/
   1.525 +  /*************************************************************************/
   1.526 +
   1.527 +  /* a few macros used to perform easy typecasts with minimal brain damage */
   1.528 +
   1.529 +#define FT_FACE( x )          ((FT_Face)(x))
   1.530 +#define FT_SIZE( x )          ((FT_Size)(x))
   1.531 +#define FT_SLOT( x )          ((FT_GlyphSlot)(x))
   1.532 +
   1.533 +#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver
   1.534 +#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library
   1.535 +#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory
   1.536 +#define FT_FACE_STREAM( x )   FT_FACE( x )->stream
   1.537 +
   1.538 +#define FT_SIZE_FACE( x )     FT_SIZE( x )->face
   1.539 +#define FT_SLOT_FACE( x )     FT_SLOT( x )->face
   1.540 +
   1.541 +#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph
   1.542 +#define FT_FACE_SIZE( x )     FT_FACE( x )->size
   1.543 +
   1.544 +
   1.545 +  /*************************************************************************/
   1.546 +  /*                                                                       */
   1.547 +  /* <Function>                                                            */
   1.548 +  /*    FT_New_GlyphSlot                                                   */
   1.549 +  /*                                                                       */
   1.550 +  /* <Description>                                                         */
   1.551 +  /*    It is sometimes useful to have more than one glyph slot for a      */
   1.552 +  /*    given face object.  This function is used to create additional     */
   1.553 +  /*    slots.  All of them are automatically discarded when the face is   */
   1.554 +  /*    destroyed.                                                         */
   1.555 +  /*                                                                       */
   1.556 +  /* <Input>                                                               */
   1.557 +  /*    face  :: A handle to a parent face object.                         */
   1.558 +  /*                                                                       */
   1.559 +  /* <Output>                                                              */
   1.560 +  /*    aslot :: A handle to a new glyph slot object.                      */
   1.561 +  /*                                                                       */
   1.562 +  /* <Return>                                                              */
   1.563 +  /*    FreeType error code.  0 means success.                             */
   1.564 +  /*                                                                       */
   1.565 +  FT_BASE( FT_Error )
   1.566 +  FT_New_GlyphSlot( FT_Face        face,
   1.567 +                    FT_GlyphSlot  *aslot );
   1.568 +
   1.569 +
   1.570 +  /*************************************************************************/
   1.571 +  /*                                                                       */
   1.572 +  /* <Function>                                                            */
   1.573 +  /*    FT_Done_GlyphSlot                                                  */
   1.574 +  /*                                                                       */
   1.575 +  /* <Description>                                                         */
   1.576 +  /*    Destroys a given glyph slot.  Remember however that all slots are  */
   1.577 +  /*    automatically destroyed with its parent.  Using this function is   */
   1.578 +  /*    not always mandatory.                                              */
   1.579 +  /*                                                                       */
   1.580 +  /* <Input>                                                               */
   1.581 +  /*    slot :: A handle to a target glyph slot.                           */
   1.582 +  /*                                                                       */
   1.583 +  FT_BASE( void )
   1.584 +  FT_Done_GlyphSlot( FT_GlyphSlot  slot );
   1.585 +
   1.586 + /* */
   1.587 +
   1.588 +#define FT_REQUEST_WIDTH( req )                                            \
   1.589 +          ( (req)->horiResolution                                          \
   1.590 +              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
   1.591 +              : (req)->width )
   1.592 +
   1.593 +#define FT_REQUEST_HEIGHT( req )                                            \
   1.594 +          ( (req)->vertResolution                                           \
   1.595 +              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
   1.596 +              : (req)->height )
   1.597 +
   1.598 +
   1.599 +  /* Set the metrics according to a bitmap strike. */
   1.600 +  FT_BASE( void )
   1.601 +  FT_Select_Metrics( FT_Face   face,
   1.602 +                     FT_ULong  strike_index );
   1.603 +
   1.604 +
   1.605 +  /* Set the metrics according to a size request. */
   1.606 +  FT_BASE( void )
   1.607 +  FT_Request_Metrics( FT_Face          face,
   1.608 +                      FT_Size_Request  req );
   1.609 +
   1.610 +
   1.611 +  /* Match a size request against `available_sizes'. */
   1.612 +  FT_BASE( FT_Error )
   1.613 +  FT_Match_Size( FT_Face          face,
   1.614 +                 FT_Size_Request  req,
   1.615 +                 FT_Bool          ignore_width,
   1.616 +                 FT_ULong*        size_index );
   1.617 +
   1.618 +
   1.619 +  /* Use the horizontal metrics to synthesize the vertical metrics. */
   1.620 +  /* If `advance' is zero, it is also synthesized.                  */
   1.621 +  FT_BASE( void )
   1.622 +  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,
   1.623 +                                  FT_Pos             advance );
   1.624 +
   1.625 +
   1.626 +  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */
   1.627 +  /* was allocated with ft_glyphslot_alloc_bitmap).                       */
   1.628 +  FT_BASE( void )
   1.629 +  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );
   1.630 +
   1.631 +
   1.632 +  /* Allocate a new bitmap buffer in a glyph slot. */
   1.633 +  FT_BASE( FT_Error )
   1.634 +  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,
   1.635 +                             FT_ULong      size );
   1.636 +
   1.637 +
   1.638 +  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */
   1.639 +  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */
   1.640 +  FT_BASE( void )
   1.641 +  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,
   1.642 +                           FT_Byte*      buffer );
   1.643 +
   1.644 +
   1.645 +  /*************************************************************************/
   1.646 +  /*************************************************************************/
   1.647 +  /*************************************************************************/
   1.648 +  /****                                                                 ****/
   1.649 +  /****                                                                 ****/
   1.650 +  /****                        R E N D E R E R S                        ****/
   1.651 +  /****                                                                 ****/
   1.652 +  /****                                                                 ****/
   1.653 +  /*************************************************************************/
   1.654 +  /*************************************************************************/
   1.655 +  /*************************************************************************/
   1.656 +
   1.657 +
   1.658 +#define FT_RENDERER( x )      ((FT_Renderer)( x ))
   1.659 +#define FT_GLYPH( x )         ((FT_Glyph)( x ))
   1.660 +#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))
   1.661 +#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
   1.662 +
   1.663 +
   1.664 +  typedef struct  FT_RendererRec_
   1.665 +  {
   1.666 +    FT_ModuleRec            root;
   1.667 +    FT_Renderer_Class*      clazz;
   1.668 +    FT_Glyph_Format         glyph_format;
   1.669 +    FT_Glyph_Class          glyph_class;
   1.670 +
   1.671 +    FT_Raster               raster;
   1.672 +    FT_Raster_Render_Func   raster_render;
   1.673 +    FT_Renderer_RenderFunc  render;
   1.674 +
   1.675 +  } FT_RendererRec;
   1.676 +
   1.677 +
   1.678 +  /*************************************************************************/
   1.679 +  /*************************************************************************/
   1.680 +  /*************************************************************************/
   1.681 +  /****                                                                 ****/
   1.682 +  /****                                                                 ****/
   1.683 +  /****                    F O N T   D R I V E R S                      ****/
   1.684 +  /****                                                                 ****/
   1.685 +  /****                                                                 ****/
   1.686 +  /*************************************************************************/
   1.687 +  /*************************************************************************/
   1.688 +  /*************************************************************************/
   1.689 +
   1.690 +
   1.691 +  /* typecast a module into a driver easily */
   1.692 +#define FT_DRIVER( x )        ((FT_Driver)(x))
   1.693 +
   1.694 +  /* typecast a module as a driver, and get its driver class */
   1.695 +#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz
   1.696 +
   1.697 +
   1.698 +  /*************************************************************************/
   1.699 +  /*                                                                       */
   1.700 +  /* <Struct>                                                              */
   1.701 +  /*    FT_DriverRec                                                       */
   1.702 +  /*                                                                       */
   1.703 +  /* <Description>                                                         */
   1.704 +  /*    The root font driver class.  A font driver is responsible for      */
   1.705 +  /*    managing and loading font files of a given format.                 */
   1.706 +  /*                                                                       */
   1.707 +  /*  <Fields>                                                             */
   1.708 +  /*     root         :: Contains the fields of the root module class.     */
   1.709 +  /*                                                                       */
   1.710 +  /*     clazz        :: A pointer to the font driver's class.  Note that  */
   1.711 +  /*                     this is NOT root.clazz.  `class' wasn't used      */
   1.712 +  /*                     as it is a reserved word in C++.                  */
   1.713 +  /*                                                                       */
   1.714 +  /*     faces_list   :: The list of faces currently opened by this        */
   1.715 +  /*                     driver.                                           */
   1.716 +  /*                                                                       */
   1.717 +  /*     extensions   :: A typeless pointer to the driver's extensions     */
   1.718 +  /*                     registry, if they are supported through the       */
   1.719 +  /*                     configuration macro FT_CONFIG_OPTION_EXTENSIONS.  */
   1.720 +  /*                                                                       */
   1.721 +  /*     glyph_loader :: The glyph loader for all faces managed by this    */
   1.722 +  /*                     driver.  This object isn't defined for unscalable */
   1.723 +  /*                     formats.                                          */
   1.724 +  /*                                                                       */
   1.725 +  typedef struct  FT_DriverRec_
   1.726 +  {
   1.727 +    FT_ModuleRec     root;
   1.728 +    FT_Driver_Class  clazz;
   1.729 +
   1.730 +    FT_ListRec       faces_list;
   1.731 +    void*            extensions;
   1.732 +
   1.733 +    FT_GlyphLoader   glyph_loader;
   1.734 +
   1.735 +  } FT_DriverRec;
   1.736 +
   1.737 +
   1.738 +  /*************************************************************************/
   1.739 +  /*************************************************************************/
   1.740 +  /*************************************************************************/
   1.741 +  /****                                                                 ****/
   1.742 +  /****                                                                 ****/
   1.743 +  /****                       L I B R A R I E S                         ****/
   1.744 +  /****                                                                 ****/
   1.745 +  /****                                                                 ****/
   1.746 +  /*************************************************************************/
   1.747 +  /*************************************************************************/
   1.748 +  /*************************************************************************/
   1.749 +
   1.750 +
   1.751 +  /* This hook is used by the TrueType debugger.  It must be set to an */
   1.752 +  /* alternate truetype bytecode interpreter function.                 */
   1.753 +#define FT_DEBUG_HOOK_TRUETYPE            0
   1.754 +
   1.755 +
   1.756 +  /* Set this debug hook to a non-null pointer to force unpatented hinting */
   1.757 +  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */
   1.758 +  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */
   1.759 +  /* during debugging.                                                     */
   1.760 +#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1
   1.761 +
   1.762 +
   1.763 +  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,
   1.764 +                                            FT_Render_Mode  render_mode,
   1.765 +                                            FT_Library      library );
   1.766 +
   1.767 +
   1.768 +  /*************************************************************************/
   1.769 +  /*                                                                       */
   1.770 +  /* <Struct>                                                              */
   1.771 +  /*    FT_LibraryRec                                                      */
   1.772 +  /*                                                                       */
   1.773 +  /* <Description>                                                         */
   1.774 +  /*    The FreeType library class.  This is the root of all FreeType      */
   1.775 +  /*    data.  Use FT_New_Library() to create a library object, and        */
   1.776 +  /*    FT_Done_Library() to discard it and all child objects.             */
   1.777 +  /*                                                                       */
   1.778 +  /* <Fields>                                                              */
   1.779 +  /*    memory           :: The library's memory object.  Manages memory   */
   1.780 +  /*                        allocation.                                    */
   1.781 +  /*                                                                       */
   1.782 +  /*    generic          :: Client data variable.  Used to extend the      */
   1.783 +  /*                        Library class by higher levels and clients.    */
   1.784 +  /*                                                                       */
   1.785 +  /*    version_major    :: The major version number of the library.       */
   1.786 +  /*                                                                       */
   1.787 +  /*    version_minor    :: The minor version number of the library.       */
   1.788 +  /*                                                                       */
   1.789 +  /*    version_patch    :: The current patch level of the library.        */
   1.790 +  /*                                                                       */
   1.791 +  /*    num_modules      :: The number of modules currently registered     */
   1.792 +  /*                        within this library.  This is set to 0 for new */
   1.793 +  /*                        libraries.  New modules are added through the  */
   1.794 +  /*                        FT_Add_Module() API function.                  */
   1.795 +  /*                                                                       */
   1.796 +  /*    modules          :: A table used to store handles to the currently */
   1.797 +  /*                        registered modules. Note that each font driver */
   1.798 +  /*                        contains a list of its opened faces.           */
   1.799 +  /*                                                                       */
   1.800 +  /*    renderers        :: The list of renderers currently registered     */
   1.801 +  /*                        within the library.                            */
   1.802 +  /*                                                                       */
   1.803 +  /*    cur_renderer     :: The current outline renderer.  This is a       */
   1.804 +  /*                        shortcut used to avoid parsing the list on     */
   1.805 +  /*                        each call to FT_Outline_Render().  It is a     */
   1.806 +  /*                        handle to the current renderer for the         */
   1.807 +  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */
   1.808 +  /*                                                                       */
   1.809 +  /*    auto_hinter      :: XXX                                            */
   1.810 +  /*                                                                       */
   1.811 +  /*    raster_pool      :: The raster object's render pool.  This can     */
   1.812 +  /*                        ideally be changed dynamically at run-time.    */
   1.813 +  /*                                                                       */
   1.814 +  /*    raster_pool_size :: The size of the render pool in bytes.          */
   1.815 +  /*                                                                       */
   1.816 +  /*    debug_hooks      :: XXX                                            */
   1.817 +  /*                                                                       */
   1.818 +  /*    lcd_filter       :: If subpixel rendering is activated, the        */
   1.819 +  /*                        selected LCD filter mode.                      */
   1.820 +  /*                                                                       */
   1.821 +  /*    lcd_extra        :: If subpixel rendering is activated, the number */
   1.822 +  /*                        of extra pixels needed for the LCD filter.     */
   1.823 +  /*                                                                       */
   1.824 +  /*    lcd_weights      :: If subpixel rendering is activated, the LCD    */
   1.825 +  /*                        filter weights, if any.                        */
   1.826 +  /*                                                                       */
   1.827 +  /*    lcd_filter_func  :: If subpixel rendering is activated, the LCD    */
   1.828 +  /*                        filtering callback function.                   */
   1.829 +  /*                                                                       */
   1.830 +  /*    pic_container    :: Contains global structs and tables, instead    */
   1.831 +  /*                        of defining them globallly.                    */
   1.832 +  /*                                                                       */
   1.833 +  /*    refcount         :: A counter initialized to~1 at the time an      */
   1.834 +  /*                        @FT_Library structure is created.              */
   1.835 +  /*                        @FT_Reference_Library increments this counter, */
   1.836 +  /*                        and @FT_Done_Library only destroys a library   */
   1.837 +  /*                        if the counter is~1, otherwise it simply       */
   1.838 +  /*                        decrements it.                                 */
   1.839 +  /*                                                                       */
   1.840 +  typedef struct  FT_LibraryRec_
   1.841 +  {
   1.842 +    FT_Memory          memory;           /* library's memory manager */
   1.843 +
   1.844 +    FT_Generic         generic;
   1.845 +
   1.846 +    FT_Int             version_major;
   1.847 +    FT_Int             version_minor;
   1.848 +    FT_Int             version_patch;
   1.849 +
   1.850 +    FT_UInt            num_modules;
   1.851 +    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */
   1.852 +
   1.853 +    FT_ListRec         renderers;        /* list of renderers        */
   1.854 +    FT_Renderer        cur_renderer;     /* current outline renderer */
   1.855 +    FT_Module          auto_hinter;
   1.856 +
   1.857 +    FT_Byte*           raster_pool;      /* scan-line conversion */
   1.858 +                                         /* render pool          */
   1.859 +    FT_ULong           raster_pool_size; /* size of render pool in bytes */
   1.860 +
   1.861 +    FT_DebugHook_Func  debug_hooks[4];
   1.862 +
   1.863 +#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
   1.864 +    FT_LcdFilter             lcd_filter;
   1.865 +    FT_Int                   lcd_extra;        /* number of extra pixels */
   1.866 +    FT_Byte                  lcd_weights[7];   /* filter weights, if any */
   1.867 +    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */
   1.868 +#endif
   1.869 +
   1.870 +#ifdef FT_CONFIG_OPTION_PIC
   1.871 +    FT_PIC_Container   pic_container;
   1.872 +#endif
   1.873 +
   1.874 +    FT_UInt            refcount;
   1.875 +
   1.876 +  } FT_LibraryRec;
   1.877 +
   1.878 +
   1.879 +  FT_BASE( FT_Renderer )
   1.880 +  FT_Lookup_Renderer( FT_Library       library,
   1.881 +                      FT_Glyph_Format  format,
   1.882 +                      FT_ListNode*     node );
   1.883 +
   1.884 +  FT_BASE( FT_Error )
   1.885 +  FT_Render_Glyph_Internal( FT_Library      library,
   1.886 +                            FT_GlyphSlot    slot,
   1.887 +                            FT_Render_Mode  render_mode );
   1.888 +
   1.889 +  typedef const char*
   1.890 +  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );
   1.891 +
   1.892 +  typedef FT_Error
   1.893 +  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,
   1.894 +                               FT_UInt     glyph_index,
   1.895 +                               FT_Pointer  buffer,
   1.896 +                               FT_UInt     buffer_max );
   1.897 +
   1.898 +  typedef FT_UInt
   1.899 +  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,
   1.900 +                                    FT_String*  glyph_name );
   1.901 +
   1.902 +
   1.903 +#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
   1.904 +
   1.905 +  /*************************************************************************/
   1.906 +  /*                                                                       */
   1.907 +  /* <Function>                                                            */
   1.908 +  /*    FT_New_Memory                                                      */
   1.909 +  /*                                                                       */
   1.910 +  /* <Description>                                                         */
   1.911 +  /*    Creates a new memory object.                                       */
   1.912 +  /*                                                                       */
   1.913 +  /* <Return>                                                              */
   1.914 +  /*    A pointer to the new memory object.  0 in case of error.           */
   1.915 +  /*                                                                       */
   1.916 +  FT_BASE( FT_Memory )
   1.917 +  FT_New_Memory( void );
   1.918 +
   1.919 +
   1.920 +  /*************************************************************************/
   1.921 +  /*                                                                       */
   1.922 +  /* <Function>                                                            */
   1.923 +  /*    FT_Done_Memory                                                     */
   1.924 +  /*                                                                       */
   1.925 +  /* <Description>                                                         */
   1.926 +  /*    Discards memory manager.                                           */
   1.927 +  /*                                                                       */
   1.928 +  /* <Input>                                                               */
   1.929 +  /*    memory :: A handle to the memory manager.                          */
   1.930 +  /*                                                                       */
   1.931 +  FT_BASE( void )
   1.932 +  FT_Done_Memory( FT_Memory  memory );
   1.933 +
   1.934 +#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
   1.935 +
   1.936 +
   1.937 +  /* Define default raster's interface.  The default raster is located in  */
   1.938 +  /* `src/base/ftraster.c'.                                                */
   1.939 +  /*                                                                       */
   1.940 +  /* Client applications can register new rasters through the              */
   1.941 +  /* FT_Set_Raster() API.                                                  */
   1.942 +
   1.943 +#ifndef FT_NO_DEFAULT_RASTER
   1.944 +  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;
   1.945 +#endif
   1.946 +
   1.947 +  /*************************************************************************/
   1.948 +  /*************************************************************************/
   1.949 +  /*************************************************************************/
   1.950 +  /****                                                                 ****/
   1.951 +  /****                                                                 ****/
   1.952 +  /****              PIC-Support Macros for ftimage.h                   ****/
   1.953 +  /****                                                                 ****/
   1.954 +  /****                                                                 ****/
   1.955 +  /*************************************************************************/
   1.956 +  /*************************************************************************/
   1.957 +  /*************************************************************************/
   1.958 +
   1.959 +
   1.960 +  /*************************************************************************/
   1.961 +  /*                                                                       */
   1.962 +  /* <Macro>                                                               */
   1.963 +  /*    FT_DEFINE_OUTLINE_FUNCS                                            */
   1.964 +  /*                                                                       */
   1.965 +  /* <Description>                                                         */
   1.966 +  /*    Used to initialize an instance of FT_Outline_Funcs struct.         */
   1.967 +  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
   1.968 +  /*    called with a pre-allocated stracture to be filled.                */
   1.969 +  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
   1.970 +  /*    allocated in the global scope (or the scope where the macro        */
   1.971 +  /*    is used).                                                          */
   1.972 +  /*                                                                       */
   1.973 +#ifndef FT_CONFIG_OPTION_PIC
   1.974 +
   1.975 +#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \
   1.976 +                                cubic_to_, shift_, delta_)                   \
   1.977 +  static const FT_Outline_Funcs class_ =                                     \
   1.978 +  {                                                                          \
   1.979 +    move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_                 \
   1.980 +  };
   1.981 +
   1.982 +#else /* FT_CONFIG_OPTION_PIC */ 
   1.983 +
   1.984 +#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \
   1.985 +                                cubic_to_, shift_, delta_)                   \
   1.986 +  static FT_Error                                                            \
   1.987 +  Init_Class_##class_( FT_Outline_Funcs*  clazz )                            \
   1.988 +  {                                                                          \
   1.989 +    clazz->move_to = move_to_;                                               \
   1.990 +    clazz->line_to = line_to_;                                               \
   1.991 +    clazz->conic_to = conic_to_;                                             \
   1.992 +    clazz->cubic_to = cubic_to_;                                             \
   1.993 +    clazz->shift = shift_;                                                   \
   1.994 +    clazz->delta = delta_;                                                   \
   1.995 +    return FT_Err_Ok;                                                        \
   1.996 +  } 
   1.997 +
   1.998 +#endif /* FT_CONFIG_OPTION_PIC */ 
   1.999 +
  1.1000 +  /*************************************************************************/
  1.1001 +  /*                                                                       */
  1.1002 +  /* <Macro>                                                               */
  1.1003 +  /*    FT_DEFINE_RASTER_FUNCS                                             */
  1.1004 +  /*                                                                       */
  1.1005 +  /* <Description>                                                         */
  1.1006 +  /*    Used to initialize an instance of FT_Raster_Funcs struct.          */
  1.1007 +  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
  1.1008 +  /*    called with a pre-allocated stracture to be filled.                */
  1.1009 +  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
  1.1010 +  /*    allocated in the global scope (or the scope where the macro        */
  1.1011 +  /*    is used).                                                          */
  1.1012 +  /*                                                                       */
  1.1013 +#ifndef FT_CONFIG_OPTION_PIC
  1.1014 +
  1.1015 +#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \
  1.1016 +                               raster_reset_, raster_set_mode_,              \
  1.1017 +                               raster_render_, raster_done_)                 \
  1.1018 +  const FT_Raster_Funcs class_ =                                      \
  1.1019 +  {                                                                          \
  1.1020 +    glyph_format_, raster_new_, raster_reset_,                               \
  1.1021 +    raster_set_mode_, raster_render_, raster_done_                           \
  1.1022 +  };
  1.1023 +
  1.1024 +#else /* FT_CONFIG_OPTION_PIC */ 
  1.1025 +
  1.1026 +#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \
  1.1027 +    raster_reset_, raster_set_mode_, raster_render_, raster_done_)           \
  1.1028 +  void                                                                       \
  1.1029 +  FT_Init_Class_##class_( FT_Raster_Funcs*  clazz )                          \
  1.1030 +  {                                                                          \
  1.1031 +    clazz->glyph_format = glyph_format_;                                     \
  1.1032 +    clazz->raster_new = raster_new_;                                         \
  1.1033 +    clazz->raster_reset = raster_reset_;                                     \
  1.1034 +    clazz->raster_set_mode = raster_set_mode_;                               \
  1.1035 +    clazz->raster_render = raster_render_;                                   \
  1.1036 +    clazz->raster_done = raster_done_;                                       \
  1.1037 +  } 
  1.1038 +
  1.1039 +#endif /* FT_CONFIG_OPTION_PIC */ 
  1.1040 +
  1.1041 +  /*************************************************************************/
  1.1042 +  /*************************************************************************/
  1.1043 +  /*************************************************************************/
  1.1044 +  /****                                                                 ****/
  1.1045 +  /****                                                                 ****/
  1.1046 +  /****              PIC-Support Macros for ftrender.h                  ****/
  1.1047 +  /****                                                                 ****/
  1.1048 +  /****                                                                 ****/
  1.1049 +  /*************************************************************************/
  1.1050 +  /*************************************************************************/
  1.1051 +  /*************************************************************************/
  1.1052 +
  1.1053 +
  1.1054 +
  1.1055 +  /*************************************************************************/
  1.1056 +  /*                                                                       */
  1.1057 +  /* <Macro>                                                               */
  1.1058 +  /*    FT_DEFINE_GLYPH                                                    */
  1.1059 +  /*                                                                       */
  1.1060 +  /* <Description>                                                         */
  1.1061 +  /*    Used to initialize an instance of FT_Glyph_Class struct.           */
  1.1062 +  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
  1.1063 +  /*    called with a pre-allocated stracture to be filled.                */
  1.1064 +  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
  1.1065 +  /*    allocated in the global scope (or the scope where the macro        */
  1.1066 +  /*    is used).                                                          */
  1.1067 +  /*                                                                       */
  1.1068 +#ifndef FT_CONFIG_OPTION_PIC
  1.1069 +
  1.1070 +#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \
  1.1071 +                        transform_, bbox_, prepare_)                         \
  1.1072 +  FT_CALLBACK_TABLE_DEF                                                      \
  1.1073 +  const FT_Glyph_Class class_ =                                              \
  1.1074 +  {                                                                          \
  1.1075 +    size_, format_, init_, done_, copy_, transform_, bbox_, prepare_         \
  1.1076 +  };
  1.1077 +
  1.1078 +#else /* FT_CONFIG_OPTION_PIC */ 
  1.1079 +
  1.1080 +#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \
  1.1081 +                        transform_, bbox_, prepare_)                         \
  1.1082 +  void                                                                       \
  1.1083 +  FT_Init_Class_##class_( FT_Glyph_Class*  clazz )                           \
  1.1084 +  {                                                                          \
  1.1085 +    clazz->glyph_size = size_;                                               \
  1.1086 +    clazz->glyph_format = format_;                                           \
  1.1087 +    clazz->glyph_init = init_;                                               \
  1.1088 +    clazz->glyph_done = done_;                                               \
  1.1089 +    clazz->glyph_copy = copy_;                                               \
  1.1090 +    clazz->glyph_transform = transform_;                                     \
  1.1091 +    clazz->glyph_bbox = bbox_;                                               \
  1.1092 +    clazz->glyph_prepare = prepare_;                                         \
  1.1093 +  } 
  1.1094 +
  1.1095 +#endif /* FT_CONFIG_OPTION_PIC */ 
  1.1096 +
  1.1097 +  /*************************************************************************/
  1.1098 +  /*                                                                       */
  1.1099 +  /* <Macro>                                                               */
  1.1100 +  /*    FT_DECLARE_RENDERER                                                */
  1.1101 +  /*                                                                       */
  1.1102 +  /* <Description>                                                         */
  1.1103 +  /*    Used to create a forward declaration of a                          */
  1.1104 +  /*    FT_Renderer_Class stract instance.                                 */
  1.1105 +  /*                                                                       */
  1.1106 +  /* <Macro>                                                               */
  1.1107 +  /*    FT_DEFINE_RENDERER                                                 */
  1.1108 +  /*                                                                       */
  1.1109 +  /* <Description>                                                         */
  1.1110 +  /*    Used to initialize an instance of FT_Renderer_Class struct.        */
  1.1111 +  /*                                                                       */
  1.1112 +  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
  1.1113 +  /*    to called with a pointer where the allocated stracture is returned.*/
  1.1114 +  /*    And when it is no longer needed a Destroy function needs           */
  1.1115 +  /*    to be called to release that allocation.                           */
  1.1116 +  /*    fcinit.c (ft_create_default_module_classes) already contains       */
  1.1117 +  /*    a mechanism to call these functions for the default modules        */
  1.1118 +  /*    described in ftmodule.h                                            */
  1.1119 +  /*                                                                       */
  1.1120 +  /*    Notice that the created Create and Destroy functions call          */
  1.1121 +  /*    pic_init and pic_free function to allow you to manually allocate   */
  1.1122 +  /*    and initialize any additional global data, like module specific    */
  1.1123 +  /*    interface, and put them in the global pic container defined in     */
  1.1124 +  /*    ftpic.h. if you don't need them just implement the functions as    */
  1.1125 +  /*    empty to resolve the link error.                                   */
  1.1126 +  /*                                                                       */
  1.1127 +  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
  1.1128 +  /*    allocated in the global scope (or the scope where the macro        */
  1.1129 +  /*    is used).                                                          */
  1.1130 +  /*                                                                       */
  1.1131 +#ifndef FT_CONFIG_OPTION_PIC
  1.1132 +
  1.1133 +#define FT_DECLARE_RENDERER(class_)                                          \
  1.1134 +    FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
  1.1135 +
  1.1136 +#define FT_DEFINE_RENDERER(class_,                                           \
  1.1137 +                           flags_, size_, name_, version_, requires_,        \
  1.1138 +                           interface_, init_, done_, get_interface_,         \
  1.1139 +                           glyph_format_, render_glyph_, transform_glyph_,   \
  1.1140 +                           get_glyph_cbox_, set_mode_, raster_class_ )       \
  1.1141 +  FT_CALLBACK_TABLE_DEF                                                      \
  1.1142 +  const FT_Renderer_Class  class_ =                                          \
  1.1143 +  {                                                                          \
  1.1144 +    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \
  1.1145 +                          interface_,init_,done_,get_interface_)             \
  1.1146 +    glyph_format_,                                                           \
  1.1147 +                                                                             \
  1.1148 +    render_glyph_,                                                           \
  1.1149 +    transform_glyph_,                                                        \
  1.1150 +    get_glyph_cbox_,                                                         \
  1.1151 +    set_mode_,                                                               \
  1.1152 +                                                                             \
  1.1153 +    raster_class_                                                            \
  1.1154 +  };
  1.1155 +
  1.1156 +#else /* FT_CONFIG_OPTION_PIC */ 
  1.1157 +
  1.1158 +#define FT_DECLARE_RENDERER(class_)  FT_DECLARE_MODULE(class_)
  1.1159 +
  1.1160 +#define FT_DEFINE_RENDERER(class_, \
  1.1161 +                           flags_, size_, name_, version_, requires_,        \
  1.1162 +                           interface_, init_, done_, get_interface_,         \
  1.1163 +                           glyph_format_, render_glyph_, transform_glyph_,   \
  1.1164 +                           get_glyph_cbox_, set_mode_, raster_class_ )       \
  1.1165 +  void class_##_pic_free( FT_Library library );                              \
  1.1166 +  FT_Error class_##_pic_init( FT_Library library );                          \
  1.1167 +                                                                             \
  1.1168 +  void                                                                       \
  1.1169 +  FT_Destroy_Class_##class_( FT_Library        library,                      \
  1.1170 +                        FT_Module_Class*  clazz )                            \
  1.1171 +  {                                                                          \
  1.1172 +    FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz;                   \
  1.1173 +    FT_Memory         memory = library->memory;                              \
  1.1174 +    class_##_pic_free( library );                                            \
  1.1175 +    if ( rclazz )                                                            \
  1.1176 +      FT_FREE( rclazz );                                                     \
  1.1177 +  }                                                                          \
  1.1178 +                                                                             \
  1.1179 +  FT_Error                                                                   \
  1.1180 +  FT_Create_Class_##class_( FT_Library         library,                      \
  1.1181 +                            FT_Module_Class**  output_class )                \
  1.1182 +  {                                                                          \
  1.1183 +    FT_Renderer_Class*  clazz;                                               \
  1.1184 +    FT_Error            error;                                               \
  1.1185 +    FT_Memory           memory = library->memory;                            \
  1.1186 +                                                                             \
  1.1187 +    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \
  1.1188 +      return error;                                                          \
  1.1189 +                                                                             \
  1.1190 +    error = class_##_pic_init( library );                                    \
  1.1191 +    if(error)                                                                \
  1.1192 +    {                                                                        \
  1.1193 +      FT_FREE( clazz );                                                      \
  1.1194 +      return error;                                                          \
  1.1195 +    }                                                                        \
  1.1196 +                                                                             \
  1.1197 +    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \
  1.1198 +                          interface_,init_,done_,get_interface_)             \
  1.1199 +                                                                             \
  1.1200 +    clazz->glyph_format       = glyph_format_;                               \
  1.1201 +                                                                             \
  1.1202 +    clazz->render_glyph       = render_glyph_;                               \
  1.1203 +    clazz->transform_glyph    = transform_glyph_;                            \
  1.1204 +    clazz->get_glyph_cbox     = get_glyph_cbox_;                             \
  1.1205 +    clazz->set_mode           = set_mode_;                                   \
  1.1206 +                                                                             \
  1.1207 +    clazz->raster_class       = raster_class_;                               \
  1.1208 +                                                                             \
  1.1209 +    *output_class = (FT_Module_Class*)clazz;                                 \
  1.1210 +    return FT_Err_Ok;                                                        \
  1.1211 +  } 
  1.1212 +
  1.1213 +
  1.1214 +
  1.1215 +#endif /* FT_CONFIG_OPTION_PIC */ 
  1.1216 +
  1.1217 +  /*************************************************************************/
  1.1218 +  /*************************************************************************/
  1.1219 +  /*************************************************************************/
  1.1220 +  /****                                                                 ****/
  1.1221 +  /****                                                                 ****/
  1.1222 +  /****              PIC-Support Macros for ftmodapi.h                  ****/
  1.1223 +  /****                                                                 ****/
  1.1224 +  /****                                                                 ****/
  1.1225 +  /*************************************************************************/
  1.1226 +  /*************************************************************************/
  1.1227 +  /*************************************************************************/
  1.1228 +
  1.1229 +
  1.1230 +#ifdef FT_CONFIG_OPTION_PIC
  1.1231 +
  1.1232 +  /*************************************************************************/
  1.1233 +  /*                                                                       */
  1.1234 +  /* <FuncType>                                                            */
  1.1235 +  /*    FT_Module_Creator                                                  */
  1.1236 +  /*                                                                       */
  1.1237 +  /* <Description>                                                         */
  1.1238 +  /*    A function used to create (allocate) a new module class object.    */
  1.1239 +  /*    The object's members are initialized, but the module itself is     */
  1.1240 +  /*    not.                                                               */
  1.1241 +  /*                                                                       */
  1.1242 +  /* <Input>                                                               */
  1.1243 +  /*    memory       :: A handle to the memory manager.                    */
  1.1244 +  /*    output_class :: Initialized with the newly allocated class.        */
  1.1245 +  /*                                                                       */
  1.1246 +  typedef FT_Error
  1.1247 +  (*FT_Module_Creator)( FT_Memory          memory,
  1.1248 +                        FT_Module_Class**  output_class );
  1.1249 +
  1.1250 +  /*************************************************************************/
  1.1251 +  /*                                                                       */
  1.1252 +  /* <FuncType>                                                            */
  1.1253 +  /*    FT_Module_Destroyer                                                */
  1.1254 +  /*                                                                       */
  1.1255 +  /* <Description>                                                         */
  1.1256 +  /*    A function used to destroy (deallocate) a module class object.     */
  1.1257 +  /*                                                                       */
  1.1258 +  /* <Input>                                                               */
  1.1259 +  /*    memory :: A handle to the memory manager.                          */
  1.1260 +  /*    clazz  :: Module class to destroy.                                 */
  1.1261 +  /*                                                                       */
  1.1262 +  typedef void
  1.1263 +  (*FT_Module_Destroyer)( FT_Memory         memory,
  1.1264 +                          FT_Module_Class*  clazz );
  1.1265 +
  1.1266 +#endif
  1.1267 +
  1.1268 +  /*************************************************************************/
  1.1269 +  /*                                                                       */
  1.1270 +  /* <Macro>                                                               */
  1.1271 +  /*    FT_DECLARE_MODULE                                                  */
  1.1272 +  /*                                                                       */
  1.1273 +  /* <Description>                                                         */
  1.1274 +  /*    Used to create a forward declaration of a                          */
  1.1275 +  /*    FT_Module_Class stract instance.                                   */
  1.1276 +  /*                                                                       */
  1.1277 +  /* <Macro>                                                               */
  1.1278 +  /*    FT_DEFINE_MODULE                                                   */
  1.1279 +  /*                                                                       */
  1.1280 +  /* <Description>                                                         */
  1.1281 +  /*    Used to initialize an instance of FT_Module_Class struct.          */
  1.1282 +  /*                                                                       */
  1.1283 +  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
  1.1284 +  /*    to called with a pointer where the allocated stracture is returned.*/
  1.1285 +  /*    And when it is no longer needed a Destroy function needs           */
  1.1286 +  /*    to be called to release that allocation.                           */
  1.1287 +  /*    fcinit.c (ft_create_default_module_classes) already contains       */
  1.1288 +  /*    a mechanism to call these functions for the default modules        */
  1.1289 +  /*    described in ftmodule.h                                            */
  1.1290 +  /*                                                                       */
  1.1291 +  /*    Notice that the created Create and Destroy functions call          */
  1.1292 +  /*    pic_init and pic_free function to allow you to manually allocate   */
  1.1293 +  /*    and initialize any additional global data, like module specific    */
  1.1294 +  /*    interface, and put them in the global pic container defined in     */
  1.1295 +  /*    ftpic.h. if you don't need them just implement the functions as    */
  1.1296 +  /*    empty to resolve the link error.                                   */
  1.1297 +  /*                                                                       */
  1.1298 +  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
  1.1299 +  /*    allocated in the global scope (or the scope where the macro        */
  1.1300 +  /*    is used).                                                          */
  1.1301 +  /*                                                                       */
  1.1302 +  /* <Macro>                                                               */
  1.1303 +  /*    FT_DEFINE_ROOT_MODULE                                              */
  1.1304 +  /*                                                                       */
  1.1305 +  /* <Description>                                                         */
  1.1306 +  /*    Used to initialize an instance of FT_Module_Class struct inside    */
  1.1307 +  /*    another stract that contains it or in a function that initializes  */
  1.1308 +  /*    that containing stract                                             */
  1.1309 +  /*                                                                       */
  1.1310 +#ifndef FT_CONFIG_OPTION_PIC
  1.1311 +
  1.1312 +#define FT_DECLARE_MODULE(class_)                                            \
  1.1313 +  FT_CALLBACK_TABLE                                                          \
  1.1314 +  const FT_Module_Class  class_;                                             \
  1.1315 +
  1.1316 +#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \
  1.1317 +                              interface_, init_, done_, get_interface_)      \
  1.1318 +  {                                                                          \
  1.1319 +    flags_,                                                                  \
  1.1320 +    size_,                                                                   \
  1.1321 +                                                                             \
  1.1322 +    name_,                                                                   \
  1.1323 +    version_,                                                                \
  1.1324 +    requires_,                                                               \
  1.1325 +                                                                             \
  1.1326 +    interface_,                                                              \
  1.1327 +                                                                             \
  1.1328 +    init_,                                                                   \
  1.1329 +    done_,                                                                   \
  1.1330 +    get_interface_,                                                          \
  1.1331 +  },
  1.1332 +
  1.1333 +#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \
  1.1334 +                         interface_, init_, done_, get_interface_)           \
  1.1335 +  FT_CALLBACK_TABLE_DEF                                                      \
  1.1336 +  const FT_Module_Class class_ =                                             \
  1.1337 +  {                                                                          \
  1.1338 +    flags_,                                                                  \
  1.1339 +    size_,                                                                   \
  1.1340 +                                                                             \
  1.1341 +    name_,                                                                   \
  1.1342 +    version_,                                                                \
  1.1343 +    requires_,                                                               \
  1.1344 +                                                                             \
  1.1345 +    interface_,                                                              \
  1.1346 +                                                                             \
  1.1347 +    init_,                                                                   \
  1.1348 +    done_,                                                                   \
  1.1349 +    get_interface_,                                                          \
  1.1350 +  };
  1.1351 +
  1.1352 +
  1.1353 +#else /* FT_CONFIG_OPTION_PIC */
  1.1354 +
  1.1355 +#define FT_DECLARE_MODULE(class_)                                            \
  1.1356 +  FT_Error FT_Create_Class_##class_( FT_Library library,                     \
  1.1357 +                                     FT_Module_Class** output_class );       \
  1.1358 +  void     FT_Destroy_Class_##class_( FT_Library library,                    \
  1.1359 +                                      FT_Module_Class*  clazz );
  1.1360 +
  1.1361 +#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \
  1.1362 +                              interface_, init_, done_, get_interface_)      \
  1.1363 +    clazz->root.module_flags       = flags_;                                 \
  1.1364 +    clazz->root.module_size        = size_;                                  \
  1.1365 +    clazz->root.module_name        = name_;                                  \
  1.1366 +    clazz->root.module_version     = version_;                               \
  1.1367 +    clazz->root.module_requires    = requires_;                              \
  1.1368 +                                                                             \
  1.1369 +    clazz->root.module_interface   = interface_;                             \
  1.1370 +                                                                             \
  1.1371 +    clazz->root.module_init        = init_;                                  \
  1.1372 +    clazz->root.module_done        = done_;                                  \
  1.1373 +    clazz->root.get_interface      = get_interface_;               
  1.1374 +
  1.1375 +#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \
  1.1376 +                         interface_, init_, done_, get_interface_)           \
  1.1377 +  void class_##_pic_free( FT_Library library );                              \
  1.1378 +  FT_Error class_##_pic_init( FT_Library library );                          \
  1.1379 +                                                                             \
  1.1380 +  void                                                                       \
  1.1381 +  FT_Destroy_Class_##class_( FT_Library library,                             \
  1.1382 +                             FT_Module_Class*  clazz )                       \
  1.1383 +  {                                                                          \
  1.1384 +    FT_Memory memory = library->memory;                                      \
  1.1385 +    class_##_pic_free( library );                                            \
  1.1386 +    if ( clazz )                                                             \
  1.1387 +      FT_FREE( clazz );                                                      \
  1.1388 +  }                                                                          \
  1.1389 +                                                                             \
  1.1390 +  FT_Error                                                                   \
  1.1391 +  FT_Create_Class_##class_( FT_Library library,                              \
  1.1392 +                            FT_Module_Class**  output_class )                \
  1.1393 +  {                                                                          \
  1.1394 +    FT_Memory memory = library->memory;                                      \
  1.1395 +    FT_Module_Class*  clazz;                                                 \
  1.1396 +    FT_Error          error;                                                 \
  1.1397 +                                                                             \
  1.1398 +    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \
  1.1399 +      return error;                                                          \
  1.1400 +    error = class_##_pic_init( library );                                    \
  1.1401 +    if(error)                                                                \
  1.1402 +    {                                                                        \
  1.1403 +      FT_FREE( clazz );                                                      \
  1.1404 +      return error;                                                          \
  1.1405 +    }                                                                        \
  1.1406 +                                                                             \
  1.1407 +    clazz->module_flags       = flags_;                                      \
  1.1408 +    clazz->module_size        = size_;                                       \
  1.1409 +    clazz->module_name        = name_;                                       \
  1.1410 +    clazz->module_version     = version_;                                    \
  1.1411 +    clazz->module_requires    = requires_;                                   \
  1.1412 +                                                                             \
  1.1413 +    clazz->module_interface   = interface_;                                  \
  1.1414 +                                                                             \
  1.1415 +    clazz->module_init        = init_;                                       \
  1.1416 +    clazz->module_done        = done_;                                       \
  1.1417 +    clazz->get_interface      = get_interface_;                              \
  1.1418 +                                                                             \
  1.1419 +    *output_class = clazz;                                                   \
  1.1420 +    return FT_Err_Ok;                                                        \
  1.1421 +  } 
  1.1422 +
  1.1423 +#endif /* FT_CONFIG_OPTION_PIC */
  1.1424 +
  1.1425 +
  1.1426 +FT_END_HEADER
  1.1427 +
  1.1428 +#endif /* __FTOBJS_H__ */
  1.1429 +
  1.1430 +
  1.1431 +/* END */