Delete all Trailing spaces in code.
[reactos.git] / reactos / dll / 3rdparty / freetype / include / freetype / ftincrem.h
index 46bc8bd..a8b5004 100644 (file)
-/***************************************************************************/
-/*                                                                         */
-/*  ftincrem.h                                                             */
-/*                                                                         */
-/*    FreeType incremental loading (specification).                        */
-/*                                                                         */
-/*  Copyright 2002, 2003, 2006, 2007 by                                    */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __FTINCREM_H__
-#define __FTINCREM_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-
-FT_BEGIN_HEADER
-
- /***************************************************************************
-  *
-  * @section:
-  *    incremental
-  *
-  * @title:
-  *    Incremental Loading
-  *
-  * @abstract:
-  *    Custom Glyph Loading.
-  *
-  * @description:
-  *   This section contains various functions used to perform so-called
-  *   `incremental' glyph loading.  This is a mode where all glyphs loaded
-  *   from a given @FT_Face are provided by the client application,
-  *
-  *   Apart from that, all other tables are loaded normally from the font
-  *   file.  This mode is useful when FreeType is used within another
-  *   engine, e.g., a Postscript Imaging Processor.
-  *
-  *   To enable this mode, you must use @FT_Open_Face, passing an
-  *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
-  *   @FT_Incremental_Interface value.  See the comments for
-  *   @FT_Incremental_InterfaceRec for an example.
-  *
-  */
-
-
- /***************************************************************************
-  *
-  * @type:
-  *   FT_Incremental
-  *
-  * @description:
-  *   An opaque type describing a user-provided object used to implement
-  *   `incremental' glyph loading within FreeType.  This is used to support
-  *   embedded fonts in certain environments (e.g., Postscript interpreters),
-  *   where the glyph data isn't in the font file, or must be overridden by
-  *   different values.
-  *
-  * @note:
-  *   It is up to client applications to create and implement @FT_Incremental
-  *   objects, as long as they provide implementations for the methods
-  *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
-  *   and @FT_Incremental_GetGlyphMetricsFunc.
-  *
-  *   See the description of @FT_Incremental_InterfaceRec to understand how
-  *   to use incremental objects with FreeType.
-  */
-  typedef struct FT_IncrementalRec_*  FT_Incremental;
-
-
- /***************************************************************************
-  *
-  * @struct:
-  *   FT_Incremental_Metrics
-  *
-  * @description:
-  *   A small structure used to contain the basic glyph metrics returned
-  *   by the @FT_Incremental_GetGlyphMetricsFunc method.
-  *
-  * @fields:
-  *   bearing_x ::
-  *     Left bearing, in font units.
-  *
-  *   bearing_y ::
-  *     Top bearing, in font units.
-  *
-  *   advance ::
-  *     Glyph advance, in font units.
-  *
-  * @note:
-  *   These correspond to horizontal or vertical metrics depending on the
-  *   value of the `vertical' argument to the function
-  *   @FT_Incremental_GetGlyphMetricsFunc.
-  */
-  typedef struct  FT_Incremental_MetricsRec_
-  {
-    FT_Long  bearing_x;
-    FT_Long  bearing_y;
-    FT_Long  advance;
-
-  } FT_Incremental_MetricsRec, *FT_Incremental_Metrics;
-
-
- /***************************************************************************
-  *
-  * @type:
-  *   FT_Incremental_GetGlyphDataFunc
-  *
-  * @description:
-  *   A function called by FreeType to access a given glyph's data bytes
-  *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
-  *   enabled.
-  *
-  *   Note that the format of the glyph's data bytes depends on the font
-  *   file format.  For TrueType, it must correspond to the raw bytes within
-  *   the `glyf' table.  For Postscript formats, it must correspond to the
-  *   *unencrypted* charstring bytes, without any `lenIV' header.  It is
-  *   undefined for any other format.
-  *
-  * @input:
-  *   incremental ::
-  *     Handle to an opaque @FT_Incremental handle provided by the client
-  *     application.
-  *
-  *   glyph_index ::
-  *     Index of relevant glyph.
-  *
-  * @output:
-  *   adata ::
-  *     A structure describing the returned glyph data bytes (which will be
-  *     accessed as a read-only byte block).
-  *
-  * @return:
-  *   FreeType error code.  0 means success.
-  *
-  * @note:
-  *   If this function returns successfully the method
-  *   @FT_Incremental_FreeGlyphDataFunc will be called later to release
-  *   the data bytes.
-  *
-  *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
-  *   compound glyphs.
-  */
-  typedef FT_Error
-  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,
-                                      FT_UInt         glyph_index,
-                                      FT_Data*        adata );
-
-
- /***************************************************************************
-  *
-  * @type:
-  *   FT_Incremental_FreeGlyphDataFunc
-  *
-  * @description:
-  *   A function used to release the glyph data bytes returned by a
-  *   successful call to @FT_Incremental_GetGlyphDataFunc.
-  *
-  * @input:
-  *   incremental ::
-  *     A handle to an opaque @FT_Incremental handle provided by the client
-  *     application.
-  *
-  *   data ::
-  *     A structure describing the glyph data bytes (which will be accessed
-  *     as a read-only byte block).
-  */
-  typedef void
-  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,
-                                       FT_Data*        data );
-
-
- /***************************************************************************
-  *
-  * @type:
-  *   FT_Incremental_GetGlyphMetricsFunc
-  *
-  * @description:
-  *   A function used to retrieve the basic metrics of a given glyph index
-  *   before accessing its data.  This is necessary because, in certain
-  *   formats like TrueType, the metrics are stored in a different place from
-  *   the glyph images proper.
-  *
-  * @input:
-  *   incremental ::
-  *     A handle to an opaque @FT_Incremental handle provided by the client
-  *     application.
-  *
-  *   glyph_index ::
-  *     Index of relevant glyph.
-  *
-  *   vertical ::
-  *     If true, return vertical metrics.
-  *
-  *   ametrics ::
-  *     This parameter is used for both input and output.
-  *     The original glyph metrics, if any, in font units.  If metrics are
-  *     not available all the values must be set to zero.
-  *
-  * @output:
-  *   ametrics ::
-  *     The replacement glyph metrics in font units.
-  *
-  */
-  typedef FT_Error
-  (*FT_Incremental_GetGlyphMetricsFunc)
-                      ( FT_Incremental              incremental,
-                        FT_UInt                     glyph_index,
-                        FT_Bool                     vertical,
-                        FT_Incremental_MetricsRec  *ametrics );
-
-
-  /**************************************************************************
-   *
-   * @struct:
-   *   FT_Incremental_FuncsRec
-   *
-   * @description:
-   *   A table of functions for accessing fonts that load data
-   *   incrementally.  Used in @FT_Incremental_InterfaceRec.
-   *
-   * @fields:
-   *   get_glyph_data ::
-   *     The function to get glyph data.  Must not be null.
-   *
-   *   free_glyph_data ::
-   *     The function to release glyph data.  Must not be null.
-   *
-   *   get_glyph_metrics ::
-   *     The function to get glyph metrics.  May be null if the font does
-   *     not provide overriding glyph metrics.
-   */
-  typedef struct  FT_Incremental_FuncsRec_
-  {
-    FT_Incremental_GetGlyphDataFunc     get_glyph_data;
-    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;
-    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;
-
-  } FT_Incremental_FuncsRec;
-
-
- /***************************************************************************
-  *
-  * @struct:
-  *   FT_Incremental_InterfaceRec
-  *
-  * @description:
-  *   A structure to be used with @FT_Open_Face to indicate that the user
-  *   wants to support incremental glyph loading.  You should use it with
-  *   @FT_PARAM_TAG_INCREMENTAL as in the following example:
-  *
-  *     {
-  *       FT_Incremental_InterfaceRec  inc_int;
-  *       FT_Parameter                 parameter;
-  *       FT_Open_Args                 open_args;
-  *
-  *
-  *       // set up incremental descriptor
-  *       inc_int.funcs  = my_funcs;
-  *       inc_int.object = my_object;
-  *
-  *       // set up optional parameter
-  *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;
-  *       parameter.data = &inc_int;
-  *
-  *       // set up FT_Open_Args structure
-  *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
-  *       open_args.pathname   = my_font_pathname;
-  *       open_args.num_params = 1;
-  *       open_args.params     = &parameter; // we use one optional argument
-  *
-  *       // open the font
-  *       error = FT_Open_Face( library, &open_args, index, &face );
-  *       ...
-  *     }
-  */
-  typedef struct  FT_Incremental_InterfaceRec_
-  {
-    const FT_Incremental_FuncsRec*  funcs;
-    FT_Incremental                  object;
-
-  } FT_Incremental_InterfaceRec;
-
-
- /***************************************************************************
-  *
-  * @type:
-  *   FT_Incremental_Interface
-  *
-  * @description:
-  *   A pointer to an @FT_Incremental_InterfaceRec structure.
-  *
-  */
-  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;
-
-
- /***************************************************************************
-  *
-  * @constant:
-  *   FT_PARAM_TAG_INCREMENTAL
-  *
-  * @description:
-  *   A constant used as the tag of @FT_Parameter structures to indicate
-  *   an incremental loading object to be used by FreeType.
-  *
-  */
-#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __FTINCREM_H__ */
-
-
-/* END */
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  ftincrem.h                                                             */\r
+/*                                                                         */\r
+/*    FreeType incremental loading (specification).                        */\r
+/*                                                                         */\r
+/*  Copyright 2002, 2003, 2006, 2007 by                                    */\r
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r
+/*                                                                         */\r
+/*  This file is part of the FreeType project, and may only be used,       */\r
+/*  modified, and distributed under the terms of the FreeType project      */\r
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r
+/*  this file you indicate that you have read the license and              */\r
+/*  understand and accept it fully.                                        */\r
+/*                                                                         */\r
+/***************************************************************************/\r
+\r
+\r
+#ifndef __FTINCREM_H__\r
+#define __FTINCREM_H__\r
+\r
+#include <ft2build.h>\r
+#include FT_FREETYPE_H\r
+\r
+#ifdef FREETYPE_H\r
+#error "freetype.h of FreeType 1 has been loaded!"\r
+#error "Please fix the directory search order for header files"\r
+#error "so that freetype.h of FreeType 2 is found first."\r
+#endif\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @section:\r
+  *    incremental\r
+  *\r
+  * @title:\r
+  *    Incremental Loading\r
+  *\r
+  * @abstract:\r
+  *    Custom Glyph Loading.\r
+  *\r
+  * @description:\r
+  *   This section contains various functions used to perform so-called\r
+  *   `incremental' glyph loading.  This is a mode where all glyphs loaded\r
+  *   from a given @FT_Face are provided by the client application,\r
+  *\r
+  *   Apart from that, all other tables are loaded normally from the font\r
+  *   file.  This mode is useful when FreeType is used within another\r
+  *   engine, e.g., a Postscript Imaging Processor.\r
+  *\r
+  *   To enable this mode, you must use @FT_Open_Face, passing an\r
+  *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\r
+  *   @FT_Incremental_Interface value.  See the comments for\r
+  *   @FT_Incremental_InterfaceRec for an example.\r
+  *\r
+  */\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @type:\r
+  *   FT_Incremental\r
+  *\r
+  * @description:\r
+  *   An opaque type describing a user-provided object used to implement\r
+  *   `incremental' glyph loading within FreeType.  This is used to support\r
+  *   embedded fonts in certain environments (e.g., Postscript interpreters),\r
+  *   where the glyph data isn't in the font file, or must be overridden by\r
+  *   different values.\r
+  *\r
+  * @note:\r
+  *   It is up to client applications to create and implement @FT_Incremental\r
+  *   objects, as long as they provide implementations for the methods\r
+  *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\r
+  *   and @FT_Incremental_GetGlyphMetricsFunc.\r
+  *\r
+  *   See the description of @FT_Incremental_InterfaceRec to understand how\r
+  *   to use incremental objects with FreeType.\r
+  */\r
+  typedef struct FT_IncrementalRec_*  FT_Incremental;\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @struct:\r
+  *   FT_Incremental_Metrics\r
+  *\r
+  * @description:\r
+  *   A small structure used to contain the basic glyph metrics returned\r
+  *   by the @FT_Incremental_GetGlyphMetricsFunc method.\r
+  *\r
+  * @fields:\r
+  *   bearing_x ::\r
+  *     Left bearing, in font units.\r
+  *\r
+  *   bearing_y ::\r
+  *     Top bearing, in font units.\r
+  *\r
+  *   advance ::\r
+  *     Glyph advance, in font units.\r
+  *\r
+  * @note:\r
+  *   These correspond to horizontal or vertical metrics depending on the\r
+  *   value of the `vertical' argument to the function\r
+  *   @FT_Incremental_GetGlyphMetricsFunc.\r
+  */\r
+  typedef struct  FT_Incremental_MetricsRec_\r
+  {\r
+    FT_Long  bearing_x;\r
+    FT_Long  bearing_y;\r
+    FT_Long  advance;\r
+\r
+  } FT_Incremental_MetricsRec, *FT_Incremental_Metrics;\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @type:\r
+  *   FT_Incremental_GetGlyphDataFunc\r
+  *\r
+  * @description:\r
+  *   A function called by FreeType to access a given glyph's data bytes\r
+  *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\r
+  *   enabled.\r
+  *\r
+  *   Note that the format of the glyph's data bytes depends on the font\r
+  *   file format.  For TrueType, it must correspond to the raw bytes within\r
+  *   the `glyf' table.  For Postscript formats, it must correspond to the\r
+  *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\r
+  *   undefined for any other format.\r
+  *\r
+  * @input:\r
+  *   incremental ::\r
+  *     Handle to an opaque @FT_Incremental handle provided by the client\r
+  *     application.\r
+  *\r
+  *   glyph_index ::\r
+  *     Index of relevant glyph.\r
+  *\r
+  * @output:\r
+  *   adata ::\r
+  *     A structure describing the returned glyph data bytes (which will be\r
+  *     accessed as a read-only byte block).\r
+  *\r
+  * @return:\r
+  *   FreeType error code.  0 means success.\r
+  *\r
+  * @note:\r
+  *   If this function returns successfully the method\r
+  *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\r
+  *   the data bytes.\r
+  *\r
+  *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\r
+  *   compound glyphs.\r
+  */\r
+  typedef FT_Error\r
+  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\r
+                                      FT_UInt         glyph_index,\r
+                                      FT_Data*        adata );\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @type:\r
+  *   FT_Incremental_FreeGlyphDataFunc\r
+  *\r
+  * @description:\r
+  *   A function used to release the glyph data bytes returned by a\r
+  *   successful call to @FT_Incremental_GetGlyphDataFunc.\r
+  *\r
+  * @input:\r
+  *   incremental ::\r
+  *     A handle to an opaque @FT_Incremental handle provided by the client\r
+  *     application.\r
+  *\r
+  *   data ::\r
+  *     A structure describing the glyph data bytes (which will be accessed\r
+  *     as a read-only byte block).\r
+  */\r
+  typedef void\r
+  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\r
+                                       FT_Data*        data );\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @type:\r
+  *   FT_Incremental_GetGlyphMetricsFunc\r
+  *\r
+  * @description:\r
+  *   A function used to retrieve the basic metrics of a given glyph index\r
+  *   before accessing its data.  This is necessary because, in certain\r
+  *   formats like TrueType, the metrics are stored in a different place from\r
+  *   the glyph images proper.\r
+  *\r
+  * @input:\r
+  *   incremental ::\r
+  *     A handle to an opaque @FT_Incremental handle provided by the client\r
+  *     application.\r
+  *\r
+  *   glyph_index ::\r
+  *     Index of relevant glyph.\r
+  *\r
+  *   vertical ::\r
+  *     If true, return vertical metrics.\r
+  *\r
+  *   ametrics ::\r
+  *     This parameter is used for both input and output.\r
+  *     The original glyph metrics, if any, in font units.  If metrics are\r
+  *     not available all the values must be set to zero.\r
+  *\r
+  * @output:\r
+  *   ametrics ::\r
+  *     The replacement glyph metrics in font units.\r
+  *\r
+  */\r
+  typedef FT_Error\r
+  (*FT_Incremental_GetGlyphMetricsFunc)\r
+                      ( FT_Incremental              incremental,\r
+                        FT_UInt                     glyph_index,\r
+                        FT_Bool                     vertical,\r
+                        FT_Incremental_MetricsRec  *ametrics );\r
+\r
+\r
+  /**************************************************************************\r
+   *\r
+   * @struct:\r
+   *   FT_Incremental_FuncsRec\r
+   *\r
+   * @description:\r
+   *   A table of functions for accessing fonts that load data\r
+   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\r
+   *\r
+   * @fields:\r
+   *   get_glyph_data ::\r
+   *     The function to get glyph data.  Must not be null.\r
+   *\r
+   *   free_glyph_data ::\r
+   *     The function to release glyph data.  Must not be null.\r
+   *\r
+   *   get_glyph_metrics ::\r
+   *     The function to get glyph metrics.  May be null if the font does\r
+   *     not provide overriding glyph metrics.\r
+   */\r
+  typedef struct  FT_Incremental_FuncsRec_\r
+  {\r
+    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\r
+    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\r
+    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\r
+\r
+  } FT_Incremental_FuncsRec;\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @struct:\r
+  *   FT_Incremental_InterfaceRec\r
+  *\r
+  * @description:\r
+  *   A structure to be used with @FT_Open_Face to indicate that the user\r
+  *   wants to support incremental glyph loading.  You should use it with\r
+  *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\r
+  *\r
+  *     {\r
+  *       FT_Incremental_InterfaceRec  inc_int;\r
+  *       FT_Parameter                 parameter;\r
+  *       FT_Open_Args                 open_args;\r
+  *\r
+  *\r
+  *       // set up incremental descriptor\r
+  *       inc_int.funcs  = my_funcs;\r
+  *       inc_int.object = my_object;\r
+  *\r
+  *       // set up optional parameter\r
+  *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\r
+  *       parameter.data = &inc_int;\r
+  *\r
+  *       // set up FT_Open_Args structure\r
+  *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\r
+  *       open_args.pathname   = my_font_pathname;\r
+  *       open_args.num_params = 1;\r
+  *       open_args.params     = &parameter; // we use one optional argument\r
+  *\r
+  *       // open the font\r
+  *       error = FT_Open_Face( library, &open_args, index, &face );\r
+  *       ...\r
+  *     }\r
+  */\r
+  typedef struct  FT_Incremental_InterfaceRec_\r
+  {\r
+    const FT_Incremental_FuncsRec*  funcs;\r
+    FT_Incremental                  object;\r
+\r
+  } FT_Incremental_InterfaceRec;\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @type:\r
+  *   FT_Incremental_Interface\r
+  *\r
+  * @description:\r
+  *   A pointer to an @FT_Incremental_InterfaceRec structure.\r
+  *\r
+  */\r
+  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\r
+\r
+\r
+ /***************************************************************************\r
+  *\r
+  * @constant:\r
+  *   FT_PARAM_TAG_INCREMENTAL\r
+  *\r
+  * @description:\r
+  *   A constant used as the tag of @FT_Parameter structures to indicate\r
+  *   an incremental loading object to be used by FreeType.\r
+  *\r
+  */\r
+#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\r
+\r
+ /* */\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __FTINCREM_H__ */\r
+\r
+\r
+/* END */\r