misc/libfreetype/include/freetype/internal/pshints.h
author koda
Mon, 25 Apr 2011 01:46:54 +0200
changeset 5172 88f2e05288ba
permissions -rw-r--r--
aaand let's add freetype as well while we are at it other smaller changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  pshints.h                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*    recorders (specification only).  These are used to support native    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*  Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 by                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#ifndef __PSHINTS_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#define __PSHINTS_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include FT_FREETYPE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#include FT_TYPE1_TABLES_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
FT_BEGIN_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  typedef struct PSH_GlobalsRec_*  PSH_Globals;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
  (*PSH_Globals_NewFunc)( FT_Memory     memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
                          T1_Private*   private_dict,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
                          PSH_Globals*  aglobals );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
                               FT_Fixed     x_scale,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
                               FT_Fixed     y_scale,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
                               FT_Fixed     x_delta,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
                               FT_Fixed     y_delta );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
  typedef struct  PSH_Globals_FuncsRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
    PSH_Globals_NewFunc       create;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
    PSH_Globals_SetScaleFunc  set_scale;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
    PSH_Globals_DestroyFunc   destroy;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
   * @type:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
   *   T1_Hints
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
   *   This is a handle to an opaque structure used to record glyph hints
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
   *   from a Type 1 character glyph character string.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
   *   The methods used to operate on this object are defined by the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
   *   achieved through the following scheme:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
   *   - Open a new hint recording session by calling the `open' method.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
   *     This rewinds the recorder and prepare it for new input.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
   *   - For each hint found in the glyph charstring, call the corresponding
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
   *     method (`stem', `stem3', or `reset').  Note that these functions do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
   *     not return an error code.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
   *   - Close the recording session by calling the `close' method.  It
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
   *     returns an error code if the hints were invalid or something
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
   *     strange happened (e.g., memory shortage).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
   *   The hints accumulated in the object can later be used by the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
   *   PostScript hinter.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  typedef struct T1_HintsRec_*  T1_Hints;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
   * @type:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
   *   T1_Hints_Funcs
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
   *   a given @T1_Hints object.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
   *   T1_Hints_OpenFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
   *   A method of the @T1_Hints class used to prepare it for a new Type 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
   *   hints recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
   *     A handle to the Type 1 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
   *   You should always call the @T1_Hints_CloseFunc method in order to
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
   *   close an opened recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
  (*T1_Hints_OpenFunc)( T1_Hints  hints );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
   *   T1_Hints_SetStemFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
   *   A method of the @T1_Hints class used to record a new horizontal or
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
   *   operators.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
   *     A handle to the Type 1 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
   *   dimension ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
   *   coords ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
   *     Array of 2 coordinates in 16.16 format, used as (position,length)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
   *     stem descriptor.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
   *   horizontal coordinates (x) for vertical stems (dim=1).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
   *   `coords[0]' is the absolute stem position (lowest coordinate);
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
   *   `coords[1]' is the length.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
   *   The length can be negative, in which case it must be either -20 or
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
   *   specification.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
   *   If the length is -21 (corresponding to a bottom ghost stem), then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
   *   the real stem position is `coords[0]+coords[1]'.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
  (*T1_Hints_SetStemFunc)( T1_Hints   hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
                           FT_UInt    dimension,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
                           FT_Fixed*  coords );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
   *   T1_Hints_SetStem3Func
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
   *   A method of the @T1_Hints class used to record three
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
   *   counter-controlled horizontal or vertical stems at once.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
   *     A handle to the Type 1 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
   *   dimension ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
   *     0 for horizontal stems, 1 for vertical ones.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
   *   coords ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
   *     An array of 6 values in 16.16 format, holding 3 (position,length)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
   *     pairs for the counter-controlled stems.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
   *   horizontal coordinates (x) for vertical stems (dim=1).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
   *   The lengths cannot be negative (ghost stems are never
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
   *   counter-controlled).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
  (*T1_Hints_SetStem3Func)( T1_Hints   hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
                            FT_UInt    dimension,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
                            FT_Fixed*  coords );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   219
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
   *   T1_Hints_ResetFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
   *   A method of the @T1_Hints class used to reset the stems hints in a
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
   *   recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
   *     A handle to the Type 1 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
   *   end_point ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
   *     The index of the last point in the input glyph in which the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
   *     previously defined hints apply.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
  (*T1_Hints_ResetFunc)( T1_Hints  hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
                         FT_UInt   end_point );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
   *   T1_Hints_CloseFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
   *   A method of the @T1_Hints class used to close a hint recording
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
   *   session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
   *     A handle to the Type 1 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
   *   end_point ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
   *     The index of the last point in the input glyph.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
   * @return:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
   *   FreeType error code.  0 means success.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
   *   The error code is set to indicate that an error occurred during the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
   *   recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
  (*T1_Hints_CloseFunc)( T1_Hints  hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
                         FT_UInt   end_point );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
   *   T1_Hints_ApplyFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
   *   A method of the @T1_Hints class used to apply hints to the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
   *   corresponding glyph outline.  Must be called once all hints have been
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
   *   recorded.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   282
   *     A handle to the Type 1 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   283
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   284
   *   outline ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
   *     A pointer to the target outline descriptor.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   287
   *   globals ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
   *     The hinter globals for this font.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   290
   *   hint_mode ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   291
   *     Hinting information.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   293
   * @return:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   294
   *   FreeType error code.  0 means success.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   295
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
   *   On input, all points within the outline are in font coordinates. On
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
   *   output, they are in 1/64th of pixels.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   300
   *   The scaling transformation is taken from the `globals' object which
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
   *   must correspond to the same font as the glyph.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   303
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   304
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   305
  (*T1_Hints_ApplyFunc)( T1_Hints        hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
                         FT_Outline*     outline,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   307
                         PSH_Globals     globals,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   308
                         FT_Render_Mode  hint_mode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   311
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   312
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
   * @struct:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
   *   T1_Hints_FuncsRec
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
   *   The structure used to provide the API to @T1_Hints objects.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   318
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   319
   * @fields:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
   *     A handle to the T1 Hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
   *   open ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   324
   *     The function to open a recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   325
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   326
   *   close ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
   *     The function to close a recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   329
   *   stem ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   330
   *     The function to set a simple stem.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   331
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   332
   *   stem3 ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   333
   *     The function to set counter-controlled stems.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   335
   *   reset ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
   *     The function to reset stem hints.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   338
   *   apply ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   339
   *     The function to apply the hints to the corresponding glyph outline.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
  typedef struct  T1_Hints_FuncsRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
    T1_Hints               hints;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
    T1_Hints_OpenFunc      open;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
    T1_Hints_CloseFunc     close;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
    T1_Hints_SetStemFunc   stem;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
    T1_Hints_SetStem3Func  stem3;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   349
    T1_Hints_ResetFunc     reset;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
    T1_Hints_ApplyFunc     apply;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
  } T1_Hints_FuncsRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
   * @type:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
   *   T2_Hints
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
   *   This is a handle to an opaque structure used to record glyph hints
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
   *   from a Type 2 character glyph character string.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
   *   The methods used to operate on this object are defined by the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   373
   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   374
   *   achieved through the following scheme:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   375
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   376
   *   - Open a new hint recording session by calling the `open' method.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
   *     This rewinds the recorder and prepare it for new input.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
   *   - For each hint found in the glyph charstring, call the corresponding
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
   *     method (`stems', `hintmask', `counters').  Note that these
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   381
   *     functions do not return an error code.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   382
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
   *   - Close the recording session by calling the `close' method.  It
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
   *     returns an error code if the hints were invalid or something
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   385
   *     strange happened (e.g., memory shortage).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
   *   The hints accumulated in the object can later be used by the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
   *   Postscript hinter.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
  typedef struct T2_HintsRec_*  T2_Hints;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
   * @type:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
   *   T2_Hints_Funcs
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   399
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
   *   a given @T2_Hints object.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   402
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   403
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   404
  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   405
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   407
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   408
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
   *   T2_Hints_OpenFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   411
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   412
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   413
   *   A method of the @T2_Hints class used to prepare it for a new Type 2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   414
   *   hints recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   415
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   416
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   417
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   418
   *     A handle to the Type 2 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   419
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   420
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   421
   *   You should always call the @T2_Hints_CloseFunc method in order to
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   422
   *   close an opened recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   423
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   424
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   425
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   426
  (*T2_Hints_OpenFunc)( T2_Hints  hints );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   427
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   428
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   429
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   430
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   431
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   432
   *   T2_Hints_StemsFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   433
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   434
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   435
   *   A method of the @T2_Hints class used to set the table of stems in
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   436
   *   either the vertical or horizontal dimension.  Equivalent to the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   437
   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   438
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   439
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   440
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   441
   *     A handle to the Type 2 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   442
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   443
   *   dimension ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   444
   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   445
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   446
   *   count ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   447
   *     The number of stems.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   448
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   449
   *   coords ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   450
   *     An array of `count' (position,length) pairs in 16.16 format.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   451
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   452
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   453
   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   454
   *   horizontal coordinates (x) for vertical stems (dim=1).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   455
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   456
   *   There are `2*count' elements in the `coords' array.  Each even
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   457
   *   element is an absolute position in font units, each odd element is a
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   458
   *   length in font units.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   459
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   460
   *   A length can be negative, in which case it must be either -20 or
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   461
   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   462
   *   specification.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   463
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   464
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   465
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   466
  (*T2_Hints_StemsFunc)( T2_Hints   hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   467
                         FT_UInt    dimension,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   468
                         FT_UInt    count,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   469
                         FT_Fixed*  coordinates );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   470
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   471
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   472
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   473
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   474
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   475
   *   T2_Hints_MaskFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   476
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   477
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   478
   *   A method of the @T2_Hints class used to set a given hintmask (this
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   479
   *   corresponds to the `hintmask' Type 2 operator).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   480
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   481
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   482
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   483
   *     A handle to the Type 2 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   484
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   485
   *   end_point ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   486
   *     The glyph index of the last point to which the previously defined
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   487
   *     or activated hints apply.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   488
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   489
   *   bit_count ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   490
   *     The number of bits in the hint mask.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   491
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   492
   *   bytes ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   493
   *     An array of bytes modelling the hint mask.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   494
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   495
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   496
   *   If the hintmask starts the charstring (before any glyph point
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   497
   *   definition), the value of `end_point' should be 0.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   498
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   499
   *   `bit_count' is the number of meaningful bits in the `bytes' array; it
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   500
   *   must be equal to the total number of hints defined so far (i.e.,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   501
   *   horizontal+verticals).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   502
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   503
   *   The `bytes' array can come directly from the Type 2 charstring and
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   504
   *   respects the same format.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   505
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   506
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   507
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   508
  (*T2_Hints_MaskFunc)( T2_Hints        hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   509
                        FT_UInt         end_point,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   510
                        FT_UInt         bit_count,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   511
                        const FT_Byte*  bytes );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   512
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   513
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   514
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   515
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   516
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   517
   *   T2_Hints_CounterFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   518
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   519
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   520
   *   A method of the @T2_Hints class used to set a given counter mask
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   521
   *   (this corresponds to the `hintmask' Type 2 operator).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   522
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   523
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   524
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   525
   *     A handle to the Type 2 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   526
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   527
   *   end_point ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   528
   *     A glyph index of the last point to which the previously defined or
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   529
   *     active hints apply.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   530
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   531
   *   bit_count ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   532
   *     The number of bits in the hint mask.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   533
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   534
   *   bytes ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   535
   *     An array of bytes modelling the hint mask.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   536
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   537
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   538
   *   If the hintmask starts the charstring (before any glyph point
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   539
   *   definition), the value of `end_point' should be 0.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   540
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   541
   *   `bit_count' is the number of meaningful bits in the `bytes' array; it
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   542
   *   must be equal to the total number of hints defined so far (i.e.,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   543
   *   horizontal+verticals).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   544
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   545
   *    The `bytes' array can come directly from the Type 2 charstring and
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   546
   *    respects the same format.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   547
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   548
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   549
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   550
  (*T2_Hints_CounterFunc)( T2_Hints        hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   551
                           FT_UInt         bit_count,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   552
                           const FT_Byte*  bytes );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   553
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   554
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   555
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   556
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   557
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   558
   *   T2_Hints_CloseFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   559
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   560
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   561
   *   A method of the @T2_Hints class used to close a hint recording
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   562
   *   session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   563
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   564
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   565
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   566
   *     A handle to the Type 2 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   567
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   568
   *   end_point ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   569
   *     The index of the last point in the input glyph.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   570
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   571
   * @return:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   572
   *   FreeType error code.  0 means success.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   573
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   574
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   575
   *   The error code is set to indicate that an error occurred during the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   576
   *   recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   577
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   578
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   579
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   580
  (*T2_Hints_CloseFunc)( T2_Hints  hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   581
                         FT_UInt   end_point );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   582
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   583
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   584
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   585
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   586
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   587
   *   T2_Hints_ApplyFunc
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   588
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   589
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   590
   *   A method of the @T2_Hints class used to apply hints to the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   591
   *   corresponding glyph outline.  Must be called after the `close'
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   592
   *   method.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   593
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   594
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   595
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   596
   *     A handle to the Type 2 hints recorder.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   597
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   598
   *   outline ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   599
   *     A pointer to the target outline descriptor.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   600
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   601
   *   globals ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   602
   *     The hinter globals for this font.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   603
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   604
   *   hint_mode ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   605
   *     Hinting information.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   606
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   607
   * @return:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   608
   *   FreeType error code.  0 means success.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   609
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   610
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   611
   *   On input, all points within the outline are in font coordinates. On
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   612
   *   output, they are in 1/64th of pixels.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   613
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   614
   *   The scaling transformation is taken from the `globals' object which
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   615
   *   must correspond to the same font than the glyph.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   616
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   617
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   618
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   619
  (*T2_Hints_ApplyFunc)( T2_Hints        hints,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   620
                         FT_Outline*     outline,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   621
                         PSH_Globals     globals,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   622
                         FT_Render_Mode  hint_mode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   623
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   624
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   625
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   626
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   627
   * @struct:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   628
   *   T2_Hints_FuncsRec
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   629
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   630
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   631
   *   The structure used to provide the API to @T2_Hints objects.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   632
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   633
   * @fields:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   634
   *   hints ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   635
   *     A handle to the T2 hints recorder object.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   636
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   637
   *   open ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   638
   *     The function to open a recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   639
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   640
   *   close ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   641
   *     The function to close a recording session.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   642
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   643
   *   stems ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   644
   *     The function to set the dimension's stems table.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   645
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   646
   *   hintmask ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   647
   *     The function to set hint masks.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   648
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   649
   *   counter ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   650
   *     The function to set counter masks.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   651
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   652
   *   apply ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   653
   *     The function to apply the hints on the corresponding glyph outline.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   654
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   655
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   656
  typedef struct  T2_Hints_FuncsRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   657
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   658
    T2_Hints              hints;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   659
    T2_Hints_OpenFunc     open;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   660
    T2_Hints_CloseFunc    close;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   661
    T2_Hints_StemsFunc    stems;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   662
    T2_Hints_MaskFunc     hintmask;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   663
    T2_Hints_CounterFunc  counter;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   664
    T2_Hints_ApplyFunc    apply;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   665
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   666
  } T2_Hints_FuncsRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   667
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   668
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   669
  /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   670
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   671
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   672
  typedef struct  PSHinter_Interface_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   673
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   674
    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   675
    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   676
    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   677
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   678
  } PSHinter_Interface;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   679
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   680
  typedef PSHinter_Interface*  PSHinter_Service;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   681
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   682
#ifndef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   683
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   684
#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_,             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   685
                                     get_t1_funcs_, get_t2_funcs_)           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   686
  static const PSHinter_Interface class_ =                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   687
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   688
    get_globals_funcs_, get_t1_funcs_, get_t2_funcs_                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   689
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   690
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   691
#else /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   692
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   693
#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_,             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   694
                                     get_t1_funcs_, get_t2_funcs_)           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   695
  void                                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   696
  FT_Init_Class_##class_( FT_Library library,                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   697
                          PSHinter_Interface*  clazz)                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   698
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   699
    FT_UNUSED(library);                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   700
    clazz->get_globals_funcs = get_globals_funcs_;                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   701
    clazz->get_t1_funcs = get_t1_funcs_;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   702
    clazz->get_t2_funcs = get_t2_funcs_;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   703
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   704
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   705
#endif /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   706
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   707
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   708
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   709
#endif /* __PSHINTS_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   710
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   711
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   712
/* END */