1
/***************************************************************************/
5
/* FreeType simple types definitions (specification only). */
7
/* Copyright 1996-2001 by */
8
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10
/* This file is part of the FreeType project, and may only be used, */
11
/* modified, and distributed under the terms of the FreeType project */
12
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13
/* this file you indicate that you have read the license and */
14
/* understand and accept it fully. */
16
/***************************************************************************/
24
#include FT_CONFIG_CONFIG_H
34
/*************************************************************************/
40
/* Basic Data Types */
43
/* The basic data types defined by the library. */
46
/* This section contains the basic data types defined by FreeType 2, */
47
/* ranging from simple scalar types to bitmap descriptors. More */
48
/* font-specific structures are defined in a different section. */
78
/* FT_Generic_Finalizer */
86
/*************************************************************************/
89
/*************************************************************************/
95
/* A typedef of unsigned char, used for simple booleans. */
97
typedef unsigned char FT_Bool;
100
/*************************************************************************/
106
/* A signed 16-bit integer used to store a distance in original font */
109
typedef signed short FT_FWord; /* distance in FUnits */
112
/*************************************************************************/
118
/* An unsigned 16-bit integer used to store a distance in original */
121
typedef unsigned short FT_UFWord; /* unsigned distance */
124
/*************************************************************************/
130
/* A simple typedef for the _signed_ char type. */
132
typedef signed char FT_Char;
135
/*************************************************************************/
141
/* A simple typedef for the _unsigned_ char type. */
143
typedef unsigned char FT_Byte;
146
/*************************************************************************/
152
/* A simple typedef for the char type, usually used for strings. */
154
typedef char FT_String;
157
/*************************************************************************/
163
/* A typedef for signed short. */
165
typedef signed short FT_Short;
168
/*************************************************************************/
174
/* A typedef for unsigned short. */
176
typedef unsigned short FT_UShort;
179
/*************************************************************************/
185
/* A typedef for the int type. */
190
/*************************************************************************/
196
/* A typedef for the unsigned int type. */
198
typedef unsigned int FT_UInt;
201
/*************************************************************************/
207
/* A typedef for signed long. */
209
typedef signed long FT_Long;
212
/*************************************************************************/
218
/* A typedef for unsigned long. */
220
typedef unsigned long FT_ULong;
223
/*************************************************************************/
229
/* A signed 2.14 fixed float type used for unit vectors. */
231
typedef signed short FT_F2Dot14;
234
/*************************************************************************/
240
/* A signed 26.6 fixed float type used for vectorial pixel */
243
typedef signed long FT_F26Dot6;
246
/*************************************************************************/
252
/* This type is used to store 16.16 fixed float values, like scales */
253
/* or matrix coefficients. */
255
typedef signed long FT_Fixed;
258
/*************************************************************************/
264
/* The FreeType error code type. A value of 0 is always interpreted */
265
/* as a successful operation. */
267
typedef int FT_Error;
270
/*************************************************************************/
276
/* A simple typedef for a typeless pointer. */
278
typedef void* FT_Pointer;
281
/*************************************************************************/
287
/* This is equivalent to the ANSI C `size_t' type, i.e. the largest */
288
/* _unsigned_ integer type used to express a file size or position, */
289
/* or a memory block size. */
291
typedef size_t FT_Offset;
294
/*************************************************************************/
300
/* This is equivalent to the ANSI C `ptrdiff_t' type, i.e. the */
301
/* largest _signed_ integer type used to express the distance */
302
/* between two pointers. */
304
typedef size_t FT_PtrDist;
307
/*************************************************************************/
313
/* A simple structure used to store a 2D vector unit vector. Uses */
314
/* FT_F2Dot14 types. */
317
/* x :: Horizontal coordinate. */
319
/* y :: Vertical coordinate. */
321
typedef struct FT_UnitVector_
329
/*************************************************************************/
335
/* A simple structure used to store a 2x2 matrix. Coefficients are */
336
/* in 16.16 fixed float format. The computation performed is: */
339
/* x' = x*xx + y*xy */
340
/* y' = x*yx + y*yy */
344
/* xx :: Matrix coefficient. */
346
/* xy :: Matrix coefficient. */
348
/* yx :: Matrix coefficient. */
350
/* yy :: Matrix coefficient. */
352
typedef struct FT_Matrix_
360
/*************************************************************************/
366
/* Read-only binary data represented as a pointer and a length. */
369
/* pointer :: The data. */
371
/* length :: The length of the data in bytes. */
373
typedef struct FT_Data_
375
const FT_Byte* pointer;
381
/*************************************************************************/
384
/* FT_Generic_Finalizer */
387
/* Describes a function used to destroy the `client' data of any */
388
/* FreeType object. See the description of the FT_Generic type for */
389
/* details of usage. */
392
/* The address of the FreeType object which is under finalization. */
393
/* Its client data is accessed through its `generic' field. */
395
typedef void (*FT_Generic_Finalizer)(void* object);
398
/*************************************************************************/
404
/* Client applications often need to associate their own data to a */
405
/* variety of FreeType core objects. For example, a text layout API */
406
/* might want to associate a glyph cache to a given size object. */
408
/* Most FreeType object contains a `generic' field, of type */
409
/* FT_Generic, which usage is left to client applications and font */
412
/* It can be used to store a pointer to client-specific data, as well */
413
/* as the address of a `finalizer' function, which will be called by */
414
/* FreeType when the object is destroyed (for example, the previous */
415
/* client example would put the address of the glyph cache destructor */
416
/* in the `finalizer' field). */
419
/* data :: A typeless pointer to any client-specified data. This */
420
/* field is completely ignored by the FreeType library. */
422
/* finalizer :: A pointer to a `generic finalizer' function, which */
423
/* will be called when the object is destroyed. If this */
424
/* field is set to NULL, no code will be called. */
426
typedef struct FT_Generic_
429
FT_Generic_Finalizer finalizer;
434
/*************************************************************************/
440
/* This macro converts four letter tags which are used to label */
441
/* TrueType tables into an unsigned long to be used within FreeType. */
444
/* The produced values *must* be 32bit integers. Don't redefine this */
447
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
448
( ( (FT_ULong)_x1 << 24 ) | \
449
( (FT_ULong)_x2 << 16 ) | \
450
( (FT_ULong)_x3 << 8 ) | \
454
/*************************************************************************/
455
/*************************************************************************/
457
/* L I S T M A N A G E M E N T */
459
/*************************************************************************/
460
/*************************************************************************/
463
/*************************************************************************/
466
/* list_processing */
468
/*************************************************************************/
471
/*************************************************************************/
477
/* Many elements and objects in FreeType are listed through a */
478
/* FT_List record (see FT_ListRec). As its name suggests, a */
479
/* FT_ListNode is a handle to a single list element. */
481
typedef struct FT_ListNodeRec_* FT_ListNode;
484
/*************************************************************************/
490
/* A handle to a list record (see FT_ListRec). */
492
typedef struct FT_ListRec_* FT_List;
495
/*************************************************************************/
501
/* A structure used to hold a single list element. */
504
/* prev :: The previous element in the list. NULL if first. */
506
/* next :: The next element in the list. NULL if last. */
508
/* data :: A typeless pointer to the listed object. */
510
typedef struct FT_ListNodeRec_
519
/*************************************************************************/
525
/* A structure used to hold a simple doubly-linked list. These are */
526
/* used in many parts of FreeType. */
529
/* head :: The head (first element) of doubly-linked list. */
531
/* tail :: The tail (last element) of doubly-linked list. */
533
typedef struct FT_ListRec_
543
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
545
/* return base error code (without module-specific prefix) */
546
#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
548
/* return module error code */
549
#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
551
#define FT_BOOL( x ) ( (FT_Bool)( x ) )
555
#endif /* __FTTYPES_H__ */