Delete all Trailing spaces in code.
[reactos.git] / reactos / dll / 3rdparty / freetype / include / freetype / internal / pshints.h
index 48452c0..161eaff 100644 (file)
-/***************************************************************************/
-/*                                                                         */
-/*  pshints.h                                                              */
-/*                                                                         */
-/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */
-/*    recorders (specification only).  These are used to support native    */
-/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */
-/*                                                                         */
-/*  Copyright 2001, 2002, 2003, 2005, 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 __PSHINTS_H__
-#define __PSHINTS_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_TYPE1_TABLES_H
-
-
-FT_BEGIN_HEADER
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*****                                                               *****/
-  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/
-  /*****                                                               *****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  typedef struct PSH_GlobalsRec_*  PSH_Globals;
-
-  typedef FT_Error
-  (*PSH_Globals_NewFunc)( FT_Memory     memory,
-                          T1_Private*   private_dict,
-                          PSH_Globals*  aglobals );
-
-  typedef FT_Error
-  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,
-                               FT_Fixed     x_scale,
-                               FT_Fixed     y_scale,
-                               FT_Fixed     x_delta,
-                               FT_Fixed     y_delta );
-
-  typedef void
-  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );
-
-
-  typedef struct  PSH_Globals_FuncsRec_
-  {
-    PSH_Globals_NewFunc       create;
-    PSH_Globals_SetScaleFunc  set_scale;
-    PSH_Globals_DestroyFunc   destroy;
-
-  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*****                                                               *****/
-  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/
-  /*****                                                               *****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /*************************************************************************
-   *
-   * @type:
-   *   T1_Hints
-   *
-   * @description:
-   *   This is a handle to an opaque structure used to record glyph hints
-   *   from a Type 1 character glyph character string.
-   *
-   *   The methods used to operate on this object are defined by the
-   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally
-   *   achieved through the following scheme:
-   *
-   *   - Open a new hint recording session by calling the `open' method.
-   *     This rewinds the recorder and prepare it for new input.
-   *
-   *   - For each hint found in the glyph charstring, call the corresponding
-   *     method (`stem', `stem3', or `reset').  Note that these functions do
-   *     not return an error code.
-   *
-   *   - Close the recording session by calling the `close' method.  It
-   *     returns an error code if the hints were invalid or something
-   *     strange happened (e.g., memory shortage).
-   *
-   *   The hints accumulated in the object can later be used by the
-   *   PostScript hinter.
-   *
-   */
-  typedef struct T1_HintsRec_*  T1_Hints;
-
-
-  /*************************************************************************
-   *
-   * @type:
-   *   T1_Hints_Funcs
-   *
-   * @description:
-   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of
-   *   a given @T1_Hints object.
-   *
-   */
-  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T1_Hints_OpenFunc
-   *
-   * @description:
-   *   A method of the @T1_Hints class used to prepare it for a new Type 1
-   *   hints recording session.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 1 hints recorder.
-   *
-   * @note:
-   *   You should always call the @T1_Hints_CloseFunc method in order to
-   *   close an opened recording session.
-   *
-   */
-  typedef void
-  (*T1_Hints_OpenFunc)( T1_Hints  hints );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T1_Hints_SetStemFunc
-   *
-   * @description:
-   *   A method of the @T1_Hints class used to record a new horizontal or
-   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'
-   *   operators.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 1 hints recorder.
-   *
-   *   dimension ::
-   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).
-   *
-   *   coords ::
-   *     Array of 2 integers, used as (position,length) stem descriptor.
-   *
-   * @note:
-   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use
-   *   horizontal coordinates (x) for vertical stems (dim=1).
-   *
-   *   `coords[0]' is the absolute stem position (lowest coordinate);
-   *   `coords[1]' is the length.
-   *
-   *   The length can be negative, in which case it must be either -20 or
-   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1
-   *   specification.
-   *
-   *   If the length is -21 (corresponding to a bottom ghost stem), then
-   *   the real stem position is `coords[0]+coords[1]'.
-   *
-   */
-  typedef void
-  (*T1_Hints_SetStemFunc)( T1_Hints  hints,
-                           FT_UInt   dimension,
-                           FT_Long*  coords );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T1_Hints_SetStem3Func
-   *
-   * @description:
-   *   A method of the @T1_Hints class used to record three
-   *   counter-controlled horizontal or vertical stems at once.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 1 hints recorder.
-   *
-   *   dimension ::
-   *     0 for horizontal stems, 1 for vertical ones.
-   *
-   *   coords ::
-   *     An array of 6 integers, holding 3 (position,length) pairs for the
-   *     counter-controlled stems.
-   *
-   * @note:
-   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use
-   *   horizontal coordinates (x) for vertical stems (dim=1).
-   *
-   *   The lengths cannot be negative (ghost stems are never
-   *   counter-controlled).
-   *
-   */
-  typedef void
-  (*T1_Hints_SetStem3Func)( T1_Hints  hints,
-                            FT_UInt   dimension,
-                            FT_Long*  coords );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T1_Hints_ResetFunc
-   *
-   * @description:
-   *   A method of the @T1_Hints class used to reset the stems hints in a
-   *   recording session.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 1 hints recorder.
-   *
-   *   end_point ::
-   *     The index of the last point in the input glyph in which the
-   *     previously defined hints apply.
-   *
-   */
-  typedef void
-  (*T1_Hints_ResetFunc)( T1_Hints  hints,
-                         FT_UInt   end_point );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T1_Hints_CloseFunc
-   *
-   * @description:
-   *   A method of the @T1_Hints class used to close a hint recording
-   *   session.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 1 hints recorder.
-   *
-   *   end_point ::
-   *     The index of the last point in the input glyph.
-   *
-   * @return:
-   *   FreeType error code.  0 means success.
-   *
-   * @note:
-   *   The error code is set to indicate that an error occurred during the
-   *   recording session.
-   *
-   */
-  typedef FT_Error
-  (*T1_Hints_CloseFunc)( T1_Hints  hints,
-                         FT_UInt   end_point );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T1_Hints_ApplyFunc
-   *
-   * @description:
-   *   A method of the @T1_Hints class used to apply hints to the
-   *   corresponding glyph outline.  Must be called once all hints have been
-   *   recorded.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 1 hints recorder.
-   *
-   *   outline ::
-   *     A pointer to the target outline descriptor.
-   *
-   *   globals ::
-   *     The hinter globals for this font.
-   *
-   *   hint_mode ::
-   *     Hinting information.
-   *
-   * @return:
-   *   FreeType error code.  0 means success.
-   *
-   * @note:
-   *   On input, all points within the outline are in font coordinates. On
-   *   output, they are in 1/64th of pixels.
-   *
-   *   The scaling transformation is taken from the `globals' object which
-   *   must correspond to the same font as the glyph.
-   *
-   */
-  typedef FT_Error
-  (*T1_Hints_ApplyFunc)( T1_Hints        hints,
-                         FT_Outline*     outline,
-                         PSH_Globals     globals,
-                         FT_Render_Mode  hint_mode );
-
-
-  /*************************************************************************
-   *
-   * @struct:
-   *   T1_Hints_FuncsRec
-   *
-   * @description:
-   *   The structure used to provide the API to @T1_Hints objects.
-   *
-   * @fields:
-   *   hints ::
-   *     A handle to the T1 Hints recorder.
-   *
-   *   open ::
-   *     The function to open a recording session.
-   *
-   *   close ::
-   *     The function to close a recording session.
-   *
-   *   stem ::
-   *     The function to set a simple stem.
-   *
-   *   stem3 ::
-   *     The function to set counter-controlled stems.
-   *
-   *   reset ::
-   *     The function to reset stem hints.
-   *
-   *   apply ::
-   *     The function to apply the hints to the corresponding glyph outline.
-   *
-   */
-  typedef struct  T1_Hints_FuncsRec_
-  {
-    T1_Hints               hints;
-    T1_Hints_OpenFunc      open;
-    T1_Hints_CloseFunc     close;
-    T1_Hints_SetStemFunc   stem;
-    T1_Hints_SetStem3Func  stem3;
-    T1_Hints_ResetFunc     reset;
-    T1_Hints_ApplyFunc     apply;
-
-  } T1_Hints_FuncsRec;
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*****                                                               *****/
-  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/
-  /*****                                                               *****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /*************************************************************************
-   *
-   * @type:
-   *   T2_Hints
-   *
-   * @description:
-   *   This is a handle to an opaque structure used to record glyph hints
-   *   from a Type 2 character glyph character string.
-   *
-   *   The methods used to operate on this object are defined by the
-   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally
-   *   achieved through the following scheme:
-   *
-   *   - Open a new hint recording session by calling the `open' method.
-   *     This rewinds the recorder and prepare it for new input.
-   *
-   *   - For each hint found in the glyph charstring, call the corresponding
-   *     method (`stems', `hintmask', `counters').  Note that these
-   *     functions do not return an error code.
-   *
-   *   - Close the recording session by calling the `close' method.  It
-   *     returns an error code if the hints were invalid or something
-   *     strange happened (e.g., memory shortage).
-   *
-   *   The hints accumulated in the object can later be used by the
-   *   Postscript hinter.
-   *
-   */
-  typedef struct T2_HintsRec_*  T2_Hints;
-
-
-  /*************************************************************************
-   *
-   * @type:
-   *   T2_Hints_Funcs
-   *
-   * @description:
-   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of
-   *   a given @T2_Hints object.
-   *
-   */
-  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T2_Hints_OpenFunc
-   *
-   * @description:
-   *   A method of the @T2_Hints class used to prepare it for a new Type 2
-   *   hints recording session.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 2 hints recorder.
-   *
-   * @note:
-   *   You should always call the @T2_Hints_CloseFunc method in order to
-   *   close an opened recording session.
-   *
-   */
-  typedef void
-  (*T2_Hints_OpenFunc)( T2_Hints  hints );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T2_Hints_StemsFunc
-   *
-   * @description:
-   *   A method of the @T2_Hints class used to set the table of stems in
-   *   either the vertical or horizontal dimension.  Equivalent to the
-   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 2 hints recorder.
-   *
-   *   dimension ::
-   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).
-   *
-   *   count ::
-   *     The number of stems.
-   *
-   *   coords ::
-   *     An array of `count' (position,length) pairs.
-   *
-   * @note:
-   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use
-   *   horizontal coordinates (x) for vertical stems (dim=1).
-   *
-   *   There are `2*count' elements in the `coords' array.  Each even
-   *   element is an absolute position in font units, each odd element is a
-   *   length in font units.
-   *
-   *   A length can be negative, in which case it must be either -20 or
-   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1
-   *   specification.
-   *
-   */
-  typedef void
-  (*T2_Hints_StemsFunc)( T2_Hints   hints,
-                         FT_UInt    dimension,
-                         FT_UInt    count,
-                         FT_Fixed*  coordinates );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T2_Hints_MaskFunc
-   *
-   * @description:
-   *   A method of the @T2_Hints class used to set a given hintmask (this
-   *   corresponds to the `hintmask' Type 2 operator).
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 2 hints recorder.
-   *
-   *   end_point ::
-   *     The glyph index of the last point to which the previously defined
-   *     or activated hints apply.
-   *
-   *   bit_count ::
-   *     The number of bits in the hint mask.
-   *
-   *   bytes ::
-   *     An array of bytes modelling the hint mask.
-   *
-   * @note:
-   *   If the hintmask starts the charstring (before any glyph point
-   *   definition), the value of `end_point' should be 0.
-   *
-   *   `bit_count' is the number of meaningful bits in the `bytes' array; it
-   *   must be equal to the total number of hints defined so far (i.e.,
-   *   horizontal+verticals).
-   *
-   *   The `bytes' array can come directly from the Type 2 charstring and
-   *   respects the same format.
-   *
-   */
-  typedef void
-  (*T2_Hints_MaskFunc)( T2_Hints        hints,
-                        FT_UInt         end_point,
-                        FT_UInt         bit_count,
-                        const FT_Byte*  bytes );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T2_Hints_CounterFunc
-   *
-   * @description:
-   *   A method of the @T2_Hints class used to set a given counter mask
-   *   (this corresponds to the `hintmask' Type 2 operator).
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 2 hints recorder.
-   *
-   *   end_point ::
-   *     A glyph index of the last point to which the previously defined or
-   *     active hints apply.
-   *
-   *   bit_count ::
-   *     The number of bits in the hint mask.
-   *
-   *   bytes ::
-   *     An array of bytes modelling the hint mask.
-   *
-   * @note:
-   *   If the hintmask starts the charstring (before any glyph point
-   *   definition), the value of `end_point' should be 0.
-   *
-   *   `bit_count' is the number of meaningful bits in the `bytes' array; it
-   *   must be equal to the total number of hints defined so far (i.e.,
-   *   horizontal+verticals).
-   *
-   *    The `bytes' array can come directly from the Type 2 charstring and
-   *    respects the same format.
-   *
-   */
-  typedef void
-  (*T2_Hints_CounterFunc)( T2_Hints        hints,
-                           FT_UInt         bit_count,
-                           const FT_Byte*  bytes );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T2_Hints_CloseFunc
-   *
-   * @description:
-   *   A method of the @T2_Hints class used to close a hint recording
-   *   session.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 2 hints recorder.
-   *
-   *   end_point ::
-   *     The index of the last point in the input glyph.
-   *
-   * @return:
-   *   FreeType error code.  0 means success.
-   *
-   * @note:
-   *   The error code is set to indicate that an error occurred during the
-   *   recording session.
-   *
-   */
-  typedef FT_Error
-  (*T2_Hints_CloseFunc)( T2_Hints  hints,
-                         FT_UInt   end_point );
-
-
-  /*************************************************************************
-   *
-   * @functype:
-   *   T2_Hints_ApplyFunc
-   *
-   * @description:
-   *   A method of the @T2_Hints class used to apply hints to the
-   *   corresponding glyph outline.  Must be called after the `close'
-   *   method.
-   *
-   * @input:
-   *   hints ::
-   *     A handle to the Type 2 hints recorder.
-   *
-   *   outline ::
-   *     A pointer to the target outline descriptor.
-   *
-   *   globals ::
-   *     The hinter globals for this font.
-   *
-   *   hint_mode ::
-   *     Hinting information.
-   *
-   * @return:
-   *   FreeType error code.  0 means success.
-   *
-   * @note:
-   *   On input, all points within the outline are in font coordinates. On
-   *   output, they are in 1/64th of pixels.
-   *
-   *   The scaling transformation is taken from the `globals' object which
-   *   must correspond to the same font than the glyph.
-   *
-   */
-  typedef FT_Error
-  (*T2_Hints_ApplyFunc)( T2_Hints        hints,
-                         FT_Outline*     outline,
-                         PSH_Globals     globals,
-                         FT_Render_Mode  hint_mode );
-
-
-  /*************************************************************************
-   *
-   * @struct:
-   *   T2_Hints_FuncsRec
-   *
-   * @description:
-   *   The structure used to provide the API to @T2_Hints objects.
-   *
-   * @fields:
-   *   hints ::
-   *     A handle to the T2 hints recorder object.
-   *
-   *   open ::
-   *     The function to open a recording session.
-   *
-   *   close ::
-   *     The function to close a recording session.
-   *
-   *   stems ::
-   *     The function to set the dimension's stems table.
-   *
-   *   hintmask ::
-   *     The function to set hint masks.
-   *
-   *   counter ::
-   *     The function to set counter masks.
-   *
-   *   apply ::
-   *     The function to apply the hints on the corresponding glyph outline.
-   *
-   */
-  typedef struct  T2_Hints_FuncsRec_
-  {
-    T2_Hints              hints;
-    T2_Hints_OpenFunc     open;
-    T2_Hints_CloseFunc    close;
-    T2_Hints_StemsFunc    stems;
-    T2_Hints_MaskFunc     hintmask;
-    T2_Hints_CounterFunc  counter;
-    T2_Hints_ApplyFunc    apply;
-
-  } T2_Hints_FuncsRec;
-
-
-  /* */
-
-
-  typedef struct  PSHinter_Interface_
-  {
-    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );
-    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );
-    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );
-
-  } PSHinter_Interface;
-
-  typedef PSHinter_Interface*  PSHinter_Service;
-
-
-FT_END_HEADER
-
-#endif /* __PSHINTS_H__ */
-
-
-/* END */
+/***************************************************************************/\r
+/*                                                                         */\r
+/*  pshints.h                                                              */\r
+/*                                                                         */\r
+/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */\r
+/*    recorders (specification only).  These are used to support native    */\r
+/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */\r
+/*                                                                         */\r
+/*  Copyright 2001, 2002, 2003, 2005, 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 __PSHINTS_H__\r
+#define __PSHINTS_H__\r
+\r
+\r
+#include <ft2build.h>\r
+#include FT_FREETYPE_H\r
+#include FT_TYPE1_TABLES_H\r
+\r
+\r
+FT_BEGIN_HEADER\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  typedef struct PSH_GlobalsRec_*  PSH_Globals;\r
+\r
+  typedef FT_Error\r
+  (*PSH_Globals_NewFunc)( FT_Memory     memory,\r
+                          T1_Private*   private_dict,\r
+                          PSH_Globals*  aglobals );\r
+\r
+  typedef FT_Error\r
+  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,\r
+                               FT_Fixed     x_scale,\r
+                               FT_Fixed     y_scale,\r
+                               FT_Fixed     x_delta,\r
+                               FT_Fixed     y_delta );\r
+\r
+  typedef void\r
+  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );\r
+\r
+\r
+  typedef struct  PSH_Globals_FuncsRec_\r
+  {\r
+    PSH_Globals_NewFunc       create;\r
+    PSH_Globals_SetScaleFunc  set_scale;\r
+    PSH_Globals_DestroyFunc   destroy;\r
+\r
+  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @type:\r
+   *   T1_Hints\r
+   *\r
+   * @description:\r
+   *   This is a handle to an opaque structure used to record glyph hints\r
+   *   from a Type 1 character glyph character string.\r
+   *\r
+   *   The methods used to operate on this object are defined by the\r
+   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally\r
+   *   achieved through the following scheme:\r
+   *\r
+   *   - Open a new hint recording session by calling the `open' method.\r
+   *     This rewinds the recorder and prepare it for new input.\r
+   *\r
+   *   - For each hint found in the glyph charstring, call the corresponding\r
+   *     method (`stem', `stem3', or `reset').  Note that these functions do\r
+   *     not return an error code.\r
+   *\r
+   *   - Close the recording session by calling the `close' method.  It\r
+   *     returns an error code if the hints were invalid or something\r
+   *     strange happened (e.g., memory shortage).\r
+   *\r
+   *   The hints accumulated in the object can later be used by the\r
+   *   PostScript hinter.\r
+   *\r
+   */\r
+  typedef struct T1_HintsRec_*  T1_Hints;\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @type:\r
+   *   T1_Hints_Funcs\r
+   *\r
+   * @description:\r
+   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of\r
+   *   a given @T1_Hints object.\r
+   *\r
+   */\r
+  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T1_Hints_OpenFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T1_Hints class used to prepare it for a new Type 1\r
+   *   hints recording session.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 1 hints recorder.\r
+   *\r
+   * @note:\r
+   *   You should always call the @T1_Hints_CloseFunc method in order to\r
+   *   close an opened recording session.\r
+   *\r
+   */\r
+  typedef void\r
+  (*T1_Hints_OpenFunc)( T1_Hints  hints );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T1_Hints_SetStemFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T1_Hints class used to record a new horizontal or\r
+   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'\r
+   *   operators.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 1 hints recorder.\r
+   *\r
+   *   dimension ::\r
+   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\r
+   *\r
+   *   coords ::\r
+   *     Array of 2 integers, used as (position,length) stem descriptor.\r
+   *\r
+   * @note:\r
+   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\r
+   *   horizontal coordinates (x) for vertical stems (dim=1).\r
+   *\r
+   *   `coords[0]' is the absolute stem position (lowest coordinate);\r
+   *   `coords[1]' is the length.\r
+   *\r
+   *   The length can be negative, in which case it must be either -20 or\r
+   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\r
+   *   specification.\r
+   *\r
+   *   If the length is -21 (corresponding to a bottom ghost stem), then\r
+   *   the real stem position is `coords[0]+coords[1]'.\r
+   *\r
+   */\r
+  typedef void\r
+  (*T1_Hints_SetStemFunc)( T1_Hints  hints,\r
+                           FT_UInt   dimension,\r
+                           FT_Long*  coords );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T1_Hints_SetStem3Func\r
+   *\r
+   * @description:\r
+   *   A method of the @T1_Hints class used to record three\r
+   *   counter-controlled horizontal or vertical stems at once.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 1 hints recorder.\r
+   *\r
+   *   dimension ::\r
+   *     0 for horizontal stems, 1 for vertical ones.\r
+   *\r
+   *   coords ::\r
+   *     An array of 6 integers, holding 3 (position,length) pairs for the\r
+   *     counter-controlled stems.\r
+   *\r
+   * @note:\r
+   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\r
+   *   horizontal coordinates (x) for vertical stems (dim=1).\r
+   *\r
+   *   The lengths cannot be negative (ghost stems are never\r
+   *   counter-controlled).\r
+   *\r
+   */\r
+  typedef void\r
+  (*T1_Hints_SetStem3Func)( T1_Hints  hints,\r
+                            FT_UInt   dimension,\r
+                            FT_Long*  coords );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T1_Hints_ResetFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T1_Hints class used to reset the stems hints in a\r
+   *   recording session.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 1 hints recorder.\r
+   *\r
+   *   end_point ::\r
+   *     The index of the last point in the input glyph in which the\r
+   *     previously defined hints apply.\r
+   *\r
+   */\r
+  typedef void\r
+  (*T1_Hints_ResetFunc)( T1_Hints  hints,\r
+                         FT_UInt   end_point );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T1_Hints_CloseFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T1_Hints class used to close a hint recording\r
+   *   session.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 1 hints recorder.\r
+   *\r
+   *   end_point ::\r
+   *     The index of the last point in the input glyph.\r
+   *\r
+   * @return:\r
+   *   FreeType error code.  0 means success.\r
+   *\r
+   * @note:\r
+   *   The error code is set to indicate that an error occurred during the\r
+   *   recording session.\r
+   *\r
+   */\r
+  typedef FT_Error\r
+  (*T1_Hints_CloseFunc)( T1_Hints  hints,\r
+                         FT_UInt   end_point );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T1_Hints_ApplyFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T1_Hints class used to apply hints to the\r
+   *   corresponding glyph outline.  Must be called once all hints have been\r
+   *   recorded.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 1 hints recorder.\r
+   *\r
+   *   outline ::\r
+   *     A pointer to the target outline descriptor.\r
+   *\r
+   *   globals ::\r
+   *     The hinter globals for this font.\r
+   *\r
+   *   hint_mode ::\r
+   *     Hinting information.\r
+   *\r
+   * @return:\r
+   *   FreeType error code.  0 means success.\r
+   *\r
+   * @note:\r
+   *   On input, all points within the outline are in font coordinates. On\r
+   *   output, they are in 1/64th of pixels.\r
+   *\r
+   *   The scaling transformation is taken from the `globals' object which\r
+   *   must correspond to the same font as the glyph.\r
+   *\r
+   */\r
+  typedef FT_Error\r
+  (*T1_Hints_ApplyFunc)( T1_Hints        hints,\r
+                         FT_Outline*     outline,\r
+                         PSH_Globals     globals,\r
+                         FT_Render_Mode  hint_mode );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @struct:\r
+   *   T1_Hints_FuncsRec\r
+   *\r
+   * @description:\r
+   *   The structure used to provide the API to @T1_Hints objects.\r
+   *\r
+   * @fields:\r
+   *   hints ::\r
+   *     A handle to the T1 Hints recorder.\r
+   *\r
+   *   open ::\r
+   *     The function to open a recording session.\r
+   *\r
+   *   close ::\r
+   *     The function to close a recording session.\r
+   *\r
+   *   stem ::\r
+   *     The function to set a simple stem.\r
+   *\r
+   *   stem3 ::\r
+   *     The function to set counter-controlled stems.\r
+   *\r
+   *   reset ::\r
+   *     The function to reset stem hints.\r
+   *\r
+   *   apply ::\r
+   *     The function to apply the hints to the corresponding glyph outline.\r
+   *\r
+   */\r
+  typedef struct  T1_Hints_FuncsRec_\r
+  {\r
+    T1_Hints               hints;\r
+    T1_Hints_OpenFunc      open;\r
+    T1_Hints_CloseFunc     close;\r
+    T1_Hints_SetStemFunc   stem;\r
+    T1_Hints_SetStem3Func  stem3;\r
+    T1_Hints_ResetFunc     reset;\r
+    T1_Hints_ApplyFunc     apply;\r
+\r
+  } T1_Hints_FuncsRec;\r
+\r
+\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+  /*****                                                               *****/\r
+  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/\r
+  /*****                                                               *****/\r
+  /*************************************************************************/\r
+  /*************************************************************************/\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @type:\r
+   *   T2_Hints\r
+   *\r
+   * @description:\r
+   *   This is a handle to an opaque structure used to record glyph hints\r
+   *   from a Type 2 character glyph character string.\r
+   *\r
+   *   The methods used to operate on this object are defined by the\r
+   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally\r
+   *   achieved through the following scheme:\r
+   *\r
+   *   - Open a new hint recording session by calling the `open' method.\r
+   *     This rewinds the recorder and prepare it for new input.\r
+   *\r
+   *   - For each hint found in the glyph charstring, call the corresponding\r
+   *     method (`stems', `hintmask', `counters').  Note that these\r
+   *     functions do not return an error code.\r
+   *\r
+   *   - Close the recording session by calling the `close' method.  It\r
+   *     returns an error code if the hints were invalid or something\r
+   *     strange happened (e.g., memory shortage).\r
+   *\r
+   *   The hints accumulated in the object can later be used by the\r
+   *   Postscript hinter.\r
+   *\r
+   */\r
+  typedef struct T2_HintsRec_*  T2_Hints;\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @type:\r
+   *   T2_Hints_Funcs\r
+   *\r
+   * @description:\r
+   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of\r
+   *   a given @T2_Hints object.\r
+   *\r
+   */\r
+  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T2_Hints_OpenFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T2_Hints class used to prepare it for a new Type 2\r
+   *   hints recording session.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 2 hints recorder.\r
+   *\r
+   * @note:\r
+   *   You should always call the @T2_Hints_CloseFunc method in order to\r
+   *   close an opened recording session.\r
+   *\r
+   */\r
+  typedef void\r
+  (*T2_Hints_OpenFunc)( T2_Hints  hints );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T2_Hints_StemsFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T2_Hints class used to set the table of stems in\r
+   *   either the vertical or horizontal dimension.  Equivalent to the\r
+   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 2 hints recorder.\r
+   *\r
+   *   dimension ::\r
+   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\r
+   *\r
+   *   count ::\r
+   *     The number of stems.\r
+   *\r
+   *   coords ::\r
+   *     An array of `count' (position,length) pairs.\r
+   *\r
+   * @note:\r
+   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\r
+   *   horizontal coordinates (x) for vertical stems (dim=1).\r
+   *\r
+   *   There are `2*count' elements in the `coords' array.  Each even\r
+   *   element is an absolute position in font units, each odd element is a\r
+   *   length in font units.\r
+   *\r
+   *   A length can be negative, in which case it must be either -20 or\r
+   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\r
+   *   specification.\r
+   *\r
+   */\r
+  typedef void\r
+  (*T2_Hints_StemsFunc)( T2_Hints   hints,\r
+                         FT_UInt    dimension,\r
+                         FT_UInt    count,\r
+                         FT_Fixed*  coordinates );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T2_Hints_MaskFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T2_Hints class used to set a given hintmask (this\r
+   *   corresponds to the `hintmask' Type 2 operator).\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 2 hints recorder.\r
+   *\r
+   *   end_point ::\r
+   *     The glyph index of the last point to which the previously defined\r
+   *     or activated hints apply.\r
+   *\r
+   *   bit_count ::\r
+   *     The number of bits in the hint mask.\r
+   *\r
+   *   bytes ::\r
+   *     An array of bytes modelling the hint mask.\r
+   *\r
+   * @note:\r
+   *   If the hintmask starts the charstring (before any glyph point\r
+   *   definition), the value of `end_point' should be 0.\r
+   *\r
+   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\r
+   *   must be equal to the total number of hints defined so far (i.e.,\r
+   *   horizontal+verticals).\r
+   *\r
+   *   The `bytes' array can come directly from the Type 2 charstring and\r
+   *   respects the same format.\r
+   *\r
+   */\r
+  typedef void\r
+  (*T2_Hints_MaskFunc)( T2_Hints        hints,\r
+                        FT_UInt         end_point,\r
+                        FT_UInt         bit_count,\r
+                        const FT_Byte*  bytes );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T2_Hints_CounterFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T2_Hints class used to set a given counter mask\r
+   *   (this corresponds to the `hintmask' Type 2 operator).\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 2 hints recorder.\r
+   *\r
+   *   end_point ::\r
+   *     A glyph index of the last point to which the previously defined or\r
+   *     active hints apply.\r
+   *\r
+   *   bit_count ::\r
+   *     The number of bits in the hint mask.\r
+   *\r
+   *   bytes ::\r
+   *     An array of bytes modelling the hint mask.\r
+   *\r
+   * @note:\r
+   *   If the hintmask starts the charstring (before any glyph point\r
+   *   definition), the value of `end_point' should be 0.\r
+   *\r
+   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\r
+   *   must be equal to the total number of hints defined so far (i.e.,\r
+   *   horizontal+verticals).\r
+   *\r
+   *    The `bytes' array can come directly from the Type 2 charstring and\r
+   *    respects the same format.\r
+   *\r
+   */\r
+  typedef void\r
+  (*T2_Hints_CounterFunc)( T2_Hints        hints,\r
+                           FT_UInt         bit_count,\r
+                           const FT_Byte*  bytes );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T2_Hints_CloseFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T2_Hints class used to close a hint recording\r
+   *   session.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 2 hints recorder.\r
+   *\r
+   *   end_point ::\r
+   *     The index of the last point in the input glyph.\r
+   *\r
+   * @return:\r
+   *   FreeType error code.  0 means success.\r
+   *\r
+   * @note:\r
+   *   The error code is set to indicate that an error occurred during the\r
+   *   recording session.\r
+   *\r
+   */\r
+  typedef FT_Error\r
+  (*T2_Hints_CloseFunc)( T2_Hints  hints,\r
+                         FT_UInt   end_point );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @functype:\r
+   *   T2_Hints_ApplyFunc\r
+   *\r
+   * @description:\r
+   *   A method of the @T2_Hints class used to apply hints to the\r
+   *   corresponding glyph outline.  Must be called after the `close'\r
+   *   method.\r
+   *\r
+   * @input:\r
+   *   hints ::\r
+   *     A handle to the Type 2 hints recorder.\r
+   *\r
+   *   outline ::\r
+   *     A pointer to the target outline descriptor.\r
+   *\r
+   *   globals ::\r
+   *     The hinter globals for this font.\r
+   *\r
+   *   hint_mode ::\r
+   *     Hinting information.\r
+   *\r
+   * @return:\r
+   *   FreeType error code.  0 means success.\r
+   *\r
+   * @note:\r
+   *   On input, all points within the outline are in font coordinates. On\r
+   *   output, they are in 1/64th of pixels.\r
+   *\r
+   *   The scaling transformation is taken from the `globals' object which\r
+   *   must correspond to the same font than the glyph.\r
+   *\r
+   */\r
+  typedef FT_Error\r
+  (*T2_Hints_ApplyFunc)( T2_Hints        hints,\r
+                         FT_Outline*     outline,\r
+                         PSH_Globals     globals,\r
+                         FT_Render_Mode  hint_mode );\r
+\r
+\r
+  /*************************************************************************\r
+   *\r
+   * @struct:\r
+   *   T2_Hints_FuncsRec\r
+   *\r
+   * @description:\r
+   *   The structure used to provide the API to @T2_Hints objects.\r
+   *\r
+   * @fields:\r
+   *   hints ::\r
+   *     A handle to the T2 hints recorder object.\r
+   *\r
+   *   open ::\r
+   *     The function to open a recording session.\r
+   *\r
+   *   close ::\r
+   *     The function to close a recording session.\r
+   *\r
+   *   stems ::\r
+   *     The function to set the dimension's stems table.\r
+   *\r
+   *   hintmask ::\r
+   *     The function to set hint masks.\r
+   *\r
+   *   counter ::\r
+   *     The function to set counter masks.\r
+   *\r
+   *   apply ::\r
+   *     The function to apply the hints on the corresponding glyph outline.\r
+   *\r
+   */\r
+  typedef struct  T2_Hints_FuncsRec_\r
+  {\r
+    T2_Hints              hints;\r
+    T2_Hints_OpenFunc     open;\r
+    T2_Hints_CloseFunc    close;\r
+    T2_Hints_StemsFunc    stems;\r
+    T2_Hints_MaskFunc     hintmask;\r
+    T2_Hints_CounterFunc  counter;\r
+    T2_Hints_ApplyFunc    apply;\r
+\r
+  } T2_Hints_FuncsRec;\r
+\r
+\r
+  /* */\r
+\r
+\r
+  typedef struct  PSHinter_Interface_\r
+  {\r
+    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );\r
+    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );\r
+    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );\r
+\r
+  } PSHinter_Interface;\r
+\r
+  typedef PSHinter_Interface*  PSHinter_Service;\r
+\r
+\r
+FT_END_HEADER\r
+\r
+#endif /* __PSHINTS_H__ */\r
+\r
+\r
+/* END */\r