aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/freetype/fttypes.inc
blob: a64432e6a1830c94ac1d21950ba61d82a13f362a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
(***************************************************************************)
(*                                                                         *)
(*  fttypes.h                                                              *)
(*                                                                         *)
(*    FreeType simple types definitions (specification only).              *)
(*                                                                         *)
(*  Copyright 1996-2001, 2002, 2004, 2006, 2007 by                         *)
(*  David Turner, Robert Wilhelm, and Werner Lemberg.                      *)
(*                                                                         *)
(*  This file is part of the FreeType project, and may only be used,       *)
(*  modified, and distributed under the terms of the FreeType project      *)
(*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     *)
(*  this file you indicate that you have read the license and              *)
(*  understand and accept it fully.                                        *)
(*                                                                         *)
(***************************************************************************)
(***************************************************************************)
(* Pascal port by the UltraStar Deluxe Team                                *)
(***************************************************************************)

  (*************************************************************************)
  (*                                                                       *)
  (* <Section>                                                             *)
  (*    basic_types                                                        *)
  (*                                                                       *)
  (* <Title>                                                               *)
  (*    Basic Data Types                                                   *)
  (*                                                                       *)
  (* <Abstract>                                                            *)
  (*    The basic data types defined by the library.                       *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    This section contains the basic data types defined by FreeType 2,  *)
  (*    ranging from simple scalar types to bitmap descriptors.  More      *)
  (*    font-specific structures are defined in a different section.       *)
  (*                                                                       *)
  (* <Order>                                                               *)
  (*    FT_Byte                                                            *)
  (*    FT_Bytes                                                           *)
  (*    FT_Char                                                            *)
  (*    FT_Int                                                             *)
  (*    FT_UInt                                                            *)
  (*    FT_Short                                                           *)
  (*    FT_UShort                                                          *)
  (*    FT_Long                                                            *)
  (*    FT_ULong                                                           *)
  (*    FT_Bool                                                            *)
  (*    FT_Offset                                                          *)
  (*    FT_PtrDist                                                         *)
  (*    FT_String                                                          *)
  (*    FT_Tag                                                             *)
  (*    FT_Error                                                           *)
  (*    FT_Fixed                                                           *)
  (*    FT_Pointer                                                         *)
  (*    FT_Pos                                                             *)
  (*    FT_Vector                                                          *)
  (*    FT_BBox                                                            *)
  (*    FT_Matrix                                                          *)
  (*    FT_FWord                                                           *)
  (*    FT_UFWord                                                          *)
  (*    FT_F2Dot14                                                         *)
  (*    FT_UnitVector                                                      *)
  (*    FT_F26Dot6                                                         *)
  (*                                                                       *)
  (*                                                                       *)
  (*    FT_Generic                                                         *)
  (*    FT_Generic_Finalizer                                               *)
  (*                                                                       *)
  (*    FT_Bitmap                                                          *)
  (*    FT_Pixel_Mode                                                      *)
  (*    FT_Palette_Mode                                                    *)
  (*    FT_Glyph_Format                                                    *)
  (*    FT_IMAGE_TAG                                                       *)
  (*                                                                       *)
  (*************************************************************************)

{$IFDEF TYPE_DECL}

  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_Bool                                                            *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A typedef of unsigned char, used for simple booleans.  As usual,   *)
  (*    values 1 and 0 represent true and false, respectively.             *)
  (*                                                                       *)
  FT_Bool    = cuchar;
{$ENDIF TYPE_DECL}
{$IFNDEF TYPE_DECL}
const
  FT_FALSE = 0;
  FT_TRUE  = 1;
{$ENDIF !TYPE_DECL}
{$IFDEF TYPE_DECL}

  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_Byte                                                            *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A simple typedef for the _unsigned_ char type.                     *)
  (*                                                                       *)
  FT_Byte    = cuchar;
  PFT_Byte   = ^FT_Byte;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_String                                                          *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A simple typedef for the char type, usually used for strings.      *)
  (*                                                                       *)
  FT_String  = cchar;
  PFT_String = ^FT_String;

  
  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_Short                                                           *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A typedef for signed short.                                        *)
  (*                                                                       *)
  FT_Short   = csshort;
  PFT_Short  = ^FT_Short;

  PFT_ShortArray = ^FT_ShortArray;
  FT_ShortArray = array[0 .. (MaxInt div SizeOf(FT_Short))-1] of FT_Short;

  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_UShort                                                          *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A typedef for unsigned short.                                      *)
  (*                                                                       *)
  FT_UShort  = cushort;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_Int                                                             *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A typedef for the int type.                                        *)
  (*                                                                       *)
  FT_Int     = csint;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_UInt                                                            *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A typedef for the unsigned int type.                               *)
  (*                                                                       *)
  FT_UInt    = cuint;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_Long                                                            *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A typedef for signed long.                                         *)
  (*                                                                       *)
  FT_Long    = cslong;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_ULong                                                           *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A typedef for unsigned long.                                       *)
  (*                                                                       *)
  FT_ULong   = culong;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_F26Dot6                                                         *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A signed 26.6 fixed float type used for vectorial pixel            *)
  (*    coordinates.                                                       *)
  (*                                                                       *)
  FT_F26Dot6 = cslong;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_Fixed                                                           *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    This type is used to store 16.16 fixed float values, like scaling  *)
  (*    values or matrix coefficients.                                     *)
  (*                                                                       *)
  FT_Fixed   = cslong;


  (*************************************************************************)
  (*                                                                       *)
  (* <Type>                                                                *)
  (*    FT_Error                                                           *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    The FreeType error code type.  A value of 0 is always interpreted  *)
  (*    as a successful operation.                                         *)
  (*                                                                       *)
  FT_Error   = cint;


  (*************************************************************************)
  (*                                                                       *)
  (* <Struct>                                                              *)
  (*    FT_Matrix                                                          *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    A simple structure used to store a 2x2 matrix.  Coefficients are   *)
  (*    in 16.16 fixed float format.  The computation performed is:        *)
  (*                                                                       *)
  (*       {                                                               *)
  (*          x' = x*xx + y*xy                                             *)
  (*          y' = x*yx + y*yy                                             *)
  (*       }                                                               *)
  (*                                                                       *)
  (* <Fields>                                                              *)
  (*    xx :: Matrix coefficient.                                          *)
  (*                                                                       *)
  (*    xy :: Matrix coefficient.                                          *)
  (*                                                                       *)
  (*    yx :: Matrix coefficient.                                          *)
  (*                                                                       *)
  (*    yy :: Matrix coefficient.                                          *)
  (*                                                                       *)
  PFT_Matrix = ^FT_Matrix;
  FT_Matrix = record
    xx, xy: FT_Fixed;
    yx, yy: FT_Fixed;
  end;

  
  (*************************************************************************)
  (*                                                                       *)
  (* <FuncType>                                                            *)
  (*    FT_Generic_Finalizer                                               *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    Describes a function used to destroy the `client' data of any      *)
  (*    FreeType object.  See the description of the FT_Generic type for   *)
  (*    details of usage.                                                  *)
  (*                                                                       *)
  (* <Input>                                                               *)
  (*    The address of the FreeType object which is under finalization.    *)
  (*    Its client data is accessed through its `generic' field.           *)
  (*                                                                       *)
  FT_Generic_Finalizer = procedure(AnObject : pointer ); cdecl;


  (*************************************************************************)
  (*                                                                       *)
  (* <Struct>                                                              *)
  (*    FT_Generic                                                         *)
  (*                                                                       *)
  (* <Description>                                                         *)
  (*    Client applications often need to associate their own data to a    *)
  (*    variety of FreeType core objects.  For example, a text layout API  *)
  (*    might want to associate a glyph cache to a given size object.      *)
  (*                                                                       *)
  (*    Most FreeType object contains a `generic' field, of type           *)
  (*    FT_Generic, which usage is left to client applications and font    *)
  (*    servers.                                                           *)
  (*                                                                       *)
  (*    It can be used to store a pointer to client-specific data, as well *)
  (*    as the address of a `finalizer' function, which will be called by  *)
  (*    FreeType when the object is destroyed (for example, the previous   *)
  (*    client example would put the address of the glyph cache destructor *)
  (*    in the `finalizer' field).                                         *)
  (*                                                                       *)
  (* <Fields>                                                              *)
  (*    data      :: A typeless pointer to any client-specified data. This *)
  (*                 field is completely ignored by the FreeType library.  *)
  (*                                                                       *)
  (*    finalizer :: A pointer to a `generic finalizer' function, which    *)
  (*                 will be called when the object is destroyed.  If this *)
  (*                 field is set to NULL, no code will be called.         *)
  (*                                                                       *)
  FT_Generic = record
    data:      pointer;
    finalizer: FT_Generic_Finalizer;
  end;


  TByteArray = array [0 .. (MaxInt div SizeOf(byte))-1] of byte;
  PByteArray = ^TByteArray;

{$ENDIF TYPE_DECL}