nuclear@0: /***************************************************************************/ nuclear@0: /* */ nuclear@0: /* fttypes.h */ nuclear@0: /* */ nuclear@0: /* FreeType simple types definitions (specification only). */ nuclear@0: /* */ nuclear@0: /* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by */ nuclear@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ nuclear@0: /* */ nuclear@0: /* This file is part of the FreeType project, and may only be used, */ nuclear@0: /* modified, and distributed under the terms of the FreeType project */ nuclear@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ nuclear@0: /* this file you indicate that you have read the license and */ nuclear@0: /* understand and accept it fully. */ nuclear@0: /* */ nuclear@0: /***************************************************************************/ nuclear@0: nuclear@0: nuclear@0: #ifndef __FTTYPES_H__ nuclear@0: #define __FTTYPES_H__ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: #include FT_CONFIG_CONFIG_H nuclear@0: #include FT_SYSTEM_H nuclear@0: #include FT_IMAGE_H nuclear@0: nuclear@0: #include nuclear@0: nuclear@0: nuclear@0: FT_BEGIN_HEADER nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /*
*/ nuclear@0: /* basic_types */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Basic Data Types */ nuclear@0: /* */ nuclear@0: /* <Abstract> */ nuclear@0: /* The basic data types defined by the library. */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This section contains the basic data types defined by FreeType~2, */ nuclear@0: /* ranging from simple scalar types to bitmap descriptors. More */ nuclear@0: /* font-specific structures are defined in a different section. */ nuclear@0: /* */ nuclear@0: /* <Order> */ nuclear@0: /* FT_Byte */ nuclear@0: /* FT_Bytes */ nuclear@0: /* FT_Char */ nuclear@0: /* FT_Int */ nuclear@0: /* FT_UInt */ nuclear@0: /* FT_Int16 */ nuclear@0: /* FT_UInt16 */ nuclear@0: /* FT_Int32 */ nuclear@0: /* FT_UInt32 */ nuclear@0: /* FT_Short */ nuclear@0: /* FT_UShort */ nuclear@0: /* FT_Long */ nuclear@0: /* FT_ULong */ nuclear@0: /* FT_Bool */ nuclear@0: /* FT_Offset */ nuclear@0: /* FT_PtrDist */ nuclear@0: /* FT_String */ nuclear@0: /* FT_Tag */ nuclear@0: /* FT_Error */ nuclear@0: /* FT_Fixed */ nuclear@0: /* FT_Pointer */ nuclear@0: /* FT_Pos */ nuclear@0: /* FT_Vector */ nuclear@0: /* FT_BBox */ nuclear@0: /* FT_Matrix */ nuclear@0: /* FT_FWord */ nuclear@0: /* FT_UFWord */ nuclear@0: /* FT_F2Dot14 */ nuclear@0: /* FT_UnitVector */ nuclear@0: /* FT_F26Dot6 */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* FT_Generic */ nuclear@0: /* FT_Generic_Finalizer */ nuclear@0: /* */ nuclear@0: /* FT_Bitmap */ nuclear@0: /* FT_Pixel_Mode */ nuclear@0: /* FT_Palette_Mode */ nuclear@0: /* FT_Glyph_Format */ nuclear@0: /* FT_IMAGE_TAG */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Bool */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef of unsigned char, used for simple booleans. As usual, */ nuclear@0: /* values 1 and~0 represent true and false, respectively. */ nuclear@0: /* */ nuclear@0: typedef unsigned char FT_Bool; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_FWord */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A signed 16-bit integer used to store a distance in original font */ nuclear@0: /* units. */ nuclear@0: /* */ nuclear@0: typedef signed short FT_FWord; /* distance in FUnits */ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_UFWord */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* An unsigned 16-bit integer used to store a distance in original */ nuclear@0: /* font units. */ nuclear@0: /* */ nuclear@0: typedef unsigned short FT_UFWord; /* unsigned distance */ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Char */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A simple typedef for the _signed_ char type. */ nuclear@0: /* */ nuclear@0: typedef signed char FT_Char; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Byte */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A simple typedef for the _unsigned_ char type. */ nuclear@0: /* */ nuclear@0: typedef unsigned char FT_Byte; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Bytes */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for constant memory areas. */ nuclear@0: /* */ nuclear@0: typedef const FT_Byte* FT_Bytes; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Tag */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for 32-bit tags (as used in the SFNT format). */ nuclear@0: /* */ nuclear@0: typedef FT_UInt32 FT_Tag; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_String */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A simple typedef for the char type, usually used for strings. */ nuclear@0: /* */ nuclear@0: typedef char FT_String; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Short */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for signed short. */ nuclear@0: /* */ nuclear@0: typedef signed short FT_Short; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_UShort */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for unsigned short. */ nuclear@0: /* */ nuclear@0: typedef unsigned short FT_UShort; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Int */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for the int type. */ nuclear@0: /* */ nuclear@0: typedef signed int FT_Int; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_UInt */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for the unsigned int type. */ nuclear@0: /* */ nuclear@0: typedef unsigned int FT_UInt; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Long */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for signed long. */ nuclear@0: /* */ nuclear@0: typedef signed long FT_Long; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_ULong */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A typedef for unsigned long. */ nuclear@0: /* */ nuclear@0: typedef unsigned long FT_ULong; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_F2Dot14 */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A signed 2.14 fixed float type used for unit vectors. */ nuclear@0: /* */ nuclear@0: typedef signed short FT_F2Dot14; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_F26Dot6 */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A signed 26.6 fixed float type used for vectorial pixel */ nuclear@0: /* coordinates. */ nuclear@0: /* */ nuclear@0: typedef signed long FT_F26Dot6; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Fixed */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This type is used to store 16.16 fixed float values, like scaling */ nuclear@0: /* values or matrix coefficients. */ nuclear@0: /* */ nuclear@0: typedef signed long FT_Fixed; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Error */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* The FreeType error code type. A value of~0 is always interpreted */ nuclear@0: /* as a successful operation. */ nuclear@0: /* */ nuclear@0: typedef int FT_Error; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Pointer */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A simple typedef for a typeless pointer. */ nuclear@0: /* */ nuclear@0: typedef void* FT_Pointer; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Offset */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */ nuclear@0: /* _unsigned_ integer type used to express a file size or position, */ nuclear@0: /* or a memory block size. */ nuclear@0: /* */ nuclear@0: typedef size_t FT_Offset; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_PtrDist */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */ nuclear@0: /* largest _signed_ integer type used to express the distance */ nuclear@0: /* between two pointers. */ nuclear@0: /* */ nuclear@0: typedef ft_ptrdiff_t FT_PtrDist; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_UnitVector */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A simple structure used to store a 2D vector unit vector. Uses */ nuclear@0: /* FT_F2Dot14 types. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* x :: Horizontal coordinate. */ nuclear@0: /* */ nuclear@0: /* y :: Vertical coordinate. */ nuclear@0: /* */ nuclear@0: typedef struct FT_UnitVector_ nuclear@0: { nuclear@0: FT_F2Dot14 x; nuclear@0: FT_F2Dot14 y; nuclear@0: nuclear@0: } FT_UnitVector; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_Matrix */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A simple structure used to store a 2x2 matrix. Coefficients are */ nuclear@0: /* in 16.16 fixed float format. The computation performed is: */ nuclear@0: /* */ nuclear@0: /* { */ nuclear@0: /* x' = x*xx + y*xy */ nuclear@0: /* y' = x*yx + y*yy */ nuclear@0: /* } */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* xx :: Matrix coefficient. */ nuclear@0: /* */ nuclear@0: /* xy :: Matrix coefficient. */ nuclear@0: /* */ nuclear@0: /* yx :: Matrix coefficient. */ nuclear@0: /* */ nuclear@0: /* yy :: Matrix coefficient. */ nuclear@0: /* */ nuclear@0: typedef struct FT_Matrix_ nuclear@0: { nuclear@0: FT_Fixed xx, xy; nuclear@0: FT_Fixed yx, yy; nuclear@0: nuclear@0: } FT_Matrix; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_Data */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Read-only binary data represented as a pointer and a length. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* pointer :: The data. */ nuclear@0: /* */ nuclear@0: /* length :: The length of the data in bytes. */ nuclear@0: /* */ nuclear@0: typedef struct FT_Data_ nuclear@0: { nuclear@0: const FT_Byte* pointer; nuclear@0: FT_Int length; nuclear@0: nuclear@0: } FT_Data; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <FuncType> */ nuclear@0: /* FT_Generic_Finalizer */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Describe a function used to destroy the `client' data of any */ nuclear@0: /* FreeType object. See the description of the @FT_Generic type for */ nuclear@0: /* details of usage. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* The address of the FreeType object which is under finalization. */ nuclear@0: /* Its client data is accessed through its `generic' field. */ nuclear@0: /* */ nuclear@0: typedef void (*FT_Generic_Finalizer)(void* object); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_Generic */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Client applications often need to associate their own data to a */ nuclear@0: /* variety of FreeType core objects. For example, a text layout API */ nuclear@0: /* might want to associate a glyph cache to a given size object. */ nuclear@0: /* */ nuclear@0: /* Most FreeType object contains a `generic' field, of type */ nuclear@0: /* FT_Generic, which usage is left to client applications and font */ nuclear@0: /* servers. */ nuclear@0: /* */ nuclear@0: /* It can be used to store a pointer to client-specific data, as well */ nuclear@0: /* as the address of a `finalizer' function, which will be called by */ nuclear@0: /* FreeType when the object is destroyed (for example, the previous */ nuclear@0: /* client example would put the address of the glyph cache destructor */ nuclear@0: /* in the `finalizer' field). */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* data :: A typeless pointer to any client-specified data. This */ nuclear@0: /* field is completely ignored by the FreeType library. */ nuclear@0: /* */ nuclear@0: /* finalizer :: A pointer to a `generic finalizer' function, which */ nuclear@0: /* will be called when the object is destroyed. If this */ nuclear@0: /* field is set to NULL, no code will be called. */ nuclear@0: /* */ nuclear@0: typedef struct FT_Generic_ nuclear@0: { nuclear@0: void* data; nuclear@0: FT_Generic_Finalizer finalizer; nuclear@0: nuclear@0: } FT_Generic; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Macro> */ nuclear@0: /* FT_MAKE_TAG */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This macro converts four-letter tags which are used to label */ nuclear@0: /* TrueType tables into an unsigned long to be used within FreeType. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* The produced values *must* be 32-bit integers. Don't redefine */ nuclear@0: /* this macro. */ nuclear@0: /* */ nuclear@0: #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ nuclear@0: (FT_Tag) \ nuclear@0: ( ( (FT_ULong)_x1 << 24 ) | \ nuclear@0: ( (FT_ULong)_x2 << 16 ) | \ nuclear@0: ( (FT_ULong)_x3 << 8 ) | \ nuclear@0: (FT_ULong)_x4 ) nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* L I S T M A N A G E M E N T */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Section> */ nuclear@0: /* list_processing */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_ListNode */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Many elements and objects in FreeType are listed through an */ nuclear@0: /* @FT_List record (see @FT_ListRec). As its name suggests, an */ nuclear@0: /* FT_ListNode is a handle to a single list element. */ nuclear@0: /* */ nuclear@0: typedef struct FT_ListNodeRec_* FT_ListNode; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_List */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A handle to a list record (see @FT_ListRec). */ nuclear@0: /* */ nuclear@0: typedef struct FT_ListRec_* FT_List; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_ListNodeRec */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A structure used to hold a single list element. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* prev :: The previous element in the list. NULL if first. */ nuclear@0: /* */ nuclear@0: /* next :: The next element in the list. NULL if last. */ nuclear@0: /* */ nuclear@0: /* data :: A typeless pointer to the listed object. */ nuclear@0: /* */ nuclear@0: typedef struct FT_ListNodeRec_ nuclear@0: { nuclear@0: FT_ListNode prev; nuclear@0: FT_ListNode next; nuclear@0: void* data; nuclear@0: nuclear@0: } FT_ListNodeRec; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_ListRec */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A structure used to hold a simple doubly-linked list. These are */ nuclear@0: /* used in many parts of FreeType. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* head :: The head (first element) of doubly-linked list. */ nuclear@0: /* */ nuclear@0: /* tail :: The tail (last element) of doubly-linked list. */ nuclear@0: /* */ nuclear@0: typedef struct FT_ListRec_ nuclear@0: { nuclear@0: FT_ListNode head; nuclear@0: FT_ListNode tail; nuclear@0: nuclear@0: } FT_ListRec; nuclear@0: nuclear@0: nuclear@0: /* */ nuclear@0: nuclear@0: #define FT_IS_EMPTY( list ) ( (list).head == 0 ) nuclear@0: nuclear@0: /* return base error code (without module-specific prefix) */ nuclear@0: #define FT_ERROR_BASE( x ) ( (x) & 0xFF ) nuclear@0: nuclear@0: /* return module error code */ nuclear@0: #define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U ) nuclear@0: nuclear@0: #define FT_BOOL( x ) ( (FT_Bool)( x ) ) nuclear@0: nuclear@0: FT_END_HEADER nuclear@0: nuclear@0: #endif /* __FTTYPES_H__ */ nuclear@0: nuclear@0: nuclear@0: /* END */