~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/freetype/src/autohint/ahmodule.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************/
 
2
/*                                                                         */
 
3
/*  ahmodule.c                                                             */
 
4
/*                                                                         */
 
5
/*    Auto-hinting module implementation (declaration).                    */
 
6
/*                                                                         */
 
7
/*  Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc.        */
 
8
/*  Author: David Turner                                                   */
 
9
/*                                                                         */
 
10
/*  This file is part of the Catharon Typography Project and shall only    */
 
11
/*  be used, modified, and distributed under the terms of the Catharon     */
 
12
/*  Open Source License that should come with this file under the name     */
 
13
/*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
 
14
/*  this file you indicate that you have read the license and              */
 
15
/*  understand and accept it fully.                                        */
 
16
/*                                                                         */
 
17
/*  Note that this license is compatible with the FreeType license.        */
 
18
/*                                                                         */
 
19
/***************************************************************************/
 
20
 
 
21
 
 
22
#include <ft2build.h>
 
23
#include FT_MODULE_H
 
24
#include "ahhint.h"
 
25
 
 
26
 
 
27
#ifdef  DEBUG_HINTER
 
28
   AH_Hinter  ah_debug_hinter       = NULL;
 
29
   FT_Bool    ah_debug_disable_horz = 0;
 
30
   FT_Bool    ah_debug_disable_vert = 0;
 
31
#endif
 
32
 
 
33
  typedef struct  FT_AutoHinterRec_
 
34
  {
 
35
    FT_ModuleRec  root;
 
36
    AH_Hinter     hinter;
 
37
 
 
38
  } FT_AutoHinterRec;
 
39
 
 
40
 
 
41
  FT_CALLBACK_DEF( FT_Error )
 
42
  ft_autohinter_init( FT_Module  module )       /* FT_AutoHinter */
 
43
  {
 
44
    FT_AutoHinter  autohinter = (FT_AutoHinter)module;
 
45
    FT_Error       error;
 
46
 
 
47
 
 
48
    error = ah_hinter_new( module->library, &autohinter->hinter );
 
49
 
 
50
#ifdef DEBUG_HINTER
 
51
    if ( !error )
 
52
      ah_debug_hinter = autohinter->hinter;
 
53
#endif
 
54
 
 
55
    return error;
 
56
  }
 
57
 
 
58
 
 
59
  FT_CALLBACK_DEF( void )
 
60
  ft_autohinter_done( FT_Module  module )
 
61
  {
 
62
    FT_AutoHinter  autohinter = (FT_AutoHinter)module;
 
63
 
 
64
 
 
65
    ah_hinter_done( autohinter->hinter );
 
66
 
 
67
#ifdef DEBUG_HINTER
 
68
    ah_debug_hinter = NULL;
 
69
#endif
 
70
  }
 
71
 
 
72
 
 
73
  FT_CALLBACK_DEF( FT_Error )
 
74
  ft_autohinter_load_glyph( FT_AutoHinter  module,
 
75
                            FT_GlyphSlot   slot,
 
76
                            FT_Size        size,
 
77
                            FT_UInt        glyph_index,
 
78
                            FT_Int32       load_flags )
 
79
  {
 
80
    return ah_hinter_load_glyph( module->hinter,
 
81
                                 slot, size, glyph_index, load_flags );
 
82
  }
 
83
 
 
84
 
 
85
  FT_CALLBACK_DEF( void )
 
86
  ft_autohinter_reset_globals( FT_AutoHinter  module,
 
87
                               FT_Face        face )
 
88
  {
 
89
    FT_UNUSED( module );
 
90
 
 
91
    if ( face->autohint.data )
 
92
      ah_hinter_done_face_globals( (AH_Face_Globals)(face->autohint.data) );
 
93
  }
 
94
 
 
95
 
 
96
  FT_CALLBACK_DEF( void )
 
97
  ft_autohinter_get_globals( FT_AutoHinter  module,
 
98
                             FT_Face        face,
 
99
                             void**         global_hints,
 
100
                             long*          global_len )
 
101
  {
 
102
    ah_hinter_get_global_hints( module->hinter, face,
 
103
                                global_hints, global_len );
 
104
  }
 
105
 
 
106
 
 
107
  FT_CALLBACK_DEF( void )
 
108
  ft_autohinter_done_globals( FT_AutoHinter  module,
 
109
                              void*          global_hints )
 
110
  {
 
111
    ah_hinter_done_global_hints( module->hinter, global_hints );
 
112
  }
 
113
 
 
114
 
 
115
  FT_CALLBACK_TABLE_DEF
 
116
  const FT_AutoHinter_ServiceRec  ft_autohinter_service =
 
117
  {
 
118
    ft_autohinter_reset_globals,
 
119
    ft_autohinter_get_globals,
 
120
    ft_autohinter_done_globals,
 
121
    ft_autohinter_load_glyph
 
122
  };
 
123
 
 
124
 
 
125
  FT_CALLBACK_TABLE_DEF
 
126
  const FT_Module_Class  autohint_module_class =
 
127
  {
 
128
    FT_MODULE_HINTER,
 
129
    sizeof ( FT_AutoHinterRec ),
 
130
 
 
131
    "autohinter",
 
132
    0x10000L,   /* version 1.0 of the autohinter  */
 
133
    0x20000L,   /* requires FreeType 2.0 or above */
 
134
 
 
135
    (const void*) &ft_autohinter_service,
 
136
 
 
137
    ft_autohinter_init,
 
138
    ft_autohinter_done,
 
139
    0                       /* FT_Module_Requester */
 
140
  };
 
141
 
 
142
 
 
143
/* END */