/***************************************************************************/
/* */
/*fttypes.h*/
/* */
/*FreeType simple types definitions (specification only).*/
/* */
/*Copyright 1996-2015 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.*/
/* */
/***************************************************************************/
#ifndef __FTTYPES_H__
#define __FTTYPES_H__
#include
#include FT_CONFIG_CONFIG_H
#include FT_SYSTEM_H
#include FT_IMAGE_H
#include
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/*
/*basic_types*/
/* */
/*
/*Basic Data Types */
/* */
/*
/*The basic data types defined by the library. */
/* */
/*
/*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. */
/* */
/*
/*FT_Byte*/
/*FT_Bytes */
/*FT_Char*/
/*FT_Int */
/*FT_UInt*/
/*FT_Int16 */
/*FT_UInt16*/
/*FT_Int32 */
/*FT_UInt32*/
/*FT_Int64 */
/*FT_UInt64*/
/*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_Data*/
/* */
/*FT_MAKE_TAG*/
/* */
/*FT_Generic */
/*FT_Generic_Finalizer */
/* */
/*FT_Bitmap*/
/*FT_Pixel_Mode*/
/*FT_Palette_Mode*/
/*FT_Glyph_Format*/
/*FT_IMAGE_TAG */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/*
/*FT_Bool*/
/* */
/*
/*A typedef of unsigned char, used for simple booleans.As usual, */
/*values 1 and~0 represent true and false, respectively. */
/* */
typedef unsigned charFT_Bool;
/*************************************************************************/
/* */
/*
/*FT_FWord */
/* */
/*
/*A signed 16-bit integer used to store a distance in original font*/
/*units. */
/* */
typedef signed shortFT_FWord; /* distance in FUnits */
/*************************************************************************/
/* */
/*
/*FT_UFWord*/
/* */
/*
/*An unsigned 16-bit integer used to store a distance in original*/
/*font units.*/
/* */
typedef unsigned shortFT_UFWord;/* unsigned distance */
/*************************************************************************/
/* */
/*
/*FT_Char*/
/* */
/*
/*A simple typedef for the _signed_ char type. */
/* */
typedef signed charFT_Char;
/*************************************************************************/
/* */
/*
/*FT_Byte*/
/* */
/*
/*A simple typedef for the _unsigned_ char type. */
/* */
typedef unsigned charFT_Byte;
/*************************************************************************/
/* */
/*
/*FT_Bytes */
/* */
/*
/*A typedef for constant memory areas. */
/* */
typedef const FT_Byte*FT_Bytes;
/*************************************************************************/
/* */
/*
/*FT_Tag */
/* */
/*
/*A typedef for 32-bit tags (as used in the SFNT format).*/
/* */
typedef FT_UInt32FT_Tag;
/*************************************************************************/
/* */
/*
/*FT_String*/
/* */
/*
/*A simple typedef for the char type, usually used for strings.*/
/* */
typedef charFT_String;
/*************************************************************************/
/* */
/*
/*FT_Short */
/* */
/*
/*A typedef for signed short.*/
/* */
typedef signed shortFT_Short;
/*************************************************************************/
/* */
/*
/*FT_UShort*/
/* */
/*
/*A typedef for unsigned short.*/
/* */
typedef unsigned shortFT_UShort;
/*************************************************************************/
/* */
/*
/*FT_Int */
/* */
/*
/*A typedef for the int type.*/
/* */
typedef signed intFT_Int;
/*************************************************************************/
/* */
/*
/*FT_UInt*/
/* */
/*
/*A typedef for the unsigned int type. */
/* */
typedef unsigned intFT_UInt;
/*************************************************************************/
/* */
/*
/*FT_Long*/
/* */
/*
/*A typedef for signed long. */
/* */
typedef signed longFT_Long;
/*************************************************************************/
/* */
/*
/*FT_ULong */
/* */
/*
/*A typedef for unsigned long. */
/* */
typedef unsigned longFT_ULong;
/*************************************************************************/
/* */
/*
/*FT_F2Dot14 */
/* */
/*
/*A signed 2.14 fixed-point type used for unit vectors.*/
/* */
typedef signed shortFT_F2Dot14;
/*************************************************************************/
/* */
/*
/*FT_F26Dot6 */
/* */
/*
/*A signed 26.6 fixed-point type used for vectorial pixel*/
/*coordinates. */
/* */
typedef signed longFT_F26Dot6;
/*************************************************************************/
/* */
/*
/*FT_Fixed */
/* */
/*
/*This type is used to store 16.16 fixed-point values, like scaling*/
/*values or matrix coefficients. */
/* */
typedef signed longFT_Fixed;
/*************************************************************************/
/* */
/*
/*FT_Error */
/* */
/*
/*The FreeType error code type.A value of~0 is always interpreted*/
/*as a successful operation. */
/* */
typedef intFT_Error;
/*************************************************************************/
/* */
/*
/*FT_Pointer */
/* */
/*
/*A simple typedef for a typeless pointer. */
/* */
typedef void*FT_Pointer;
/*************************************************************************/
/* */
/*
/*FT_Offset*/
/* */
/*
/*This is equivalent to the ANSI~C `size_t type, i.e., the largest*/
/*_unsigned_ integer type used to express a file size or position, */
/*or a memory block size.*/
/* */
typedef size_tFT_Offset;
/*************************************************************************/
/* */
/*
/*FT_PtrDist */
/* */
/*
/*This is equivalent to the ANSI~C `ptrdiff_t type, i.e., the */
/*largest _signed_ integer type used to express the distance */
/*between two pointers.*/
/* */
typedef ft_ptrdiff_tFT_PtrDist;
/*************************************************************************/
/* */
/*
/*FT_UnitVector*/
/* */
/*
/*A simple structure used to store a 2D vector unit vector.Uses*/
/*FT_F2Dot14 types.*/
/* */
/*
/*x :: Horizontal coordinate.*/
/* */
/*y :: Vertical coordinate.*/
/* */
typedef structFT_UnitVector_
{
FT_F2Dot14x;
FT_F2Dot14y;
} FT_UnitVector;
/*************************************************************************/
/* */
/*
/*FT_Matrix*/
/* */
/*
/*A simple structure used to store a 22 matrix.Coefficients are */
/*in 16.16 fixed-point format.The computation performed is:*/
/* */
/* { */
/*x = x*xx + y*xy */
/*y = x*yx + y*yy */
/* } */
/* */
/*
/*xx :: Matrix coefficient.*/
/* */
/*xy :: Matrix coefficient.*/
/* */
/*yx :: Matrix coefficient.*/
/* */
/*yy :: Matrix coefficient.*/
/* */
typedef structFT_Matrix_
{
FT_Fixedxx, xy;
FT_Fixedyx, yy;
} FT_Matrix;
/*************************************************************************/
/* */
/*
/*FT_Data*/
/* */
/*
/*Read-only binary data represented as a pointer and a length. */
/* */
/*
/*pointer :: The data. */
/* */
/*length:: The length of the data in bytes.*/
/* */
typedef structFT_Data_
{
const FT_Byte*pointer;
FT_Intlength;
} FT_Data;
/*************************************************************************/
/* */
/*
/*FT_Generic_Finalizer */
/* */
/*
/*Describe a function used to destroy the `client data of any */
/*FreeType object.See the description of the @FT_Generic type for*/
/*details of usage.*/
/* */
/**/
/*The address of the FreeType object that is under finalization. */
/*Its client data is accessed through its `generic field. */
/* */
typedef void(*FT_Generic_Finalizer)(void*object);
/*************************************************************************/
/* */
/*
/*FT_Generic */
/* */
/*
/*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.*/
/* */
/*Some 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). */
/* */
/*
/*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. */
/* */
typedef structFT_Generic_
{
void* data;
FT_Generic_Finalizerfinalizer;
} FT_Generic;
/*************************************************************************/
/* */
/*
/*FT_MAKE_TAG*/
/* */
/*
/*This macro converts four-letter tags that are used to label*/
/*TrueType tables into an unsigned long, to be used within FreeType. */
/* */
/*
/*The produced values *must* be 32-bit integers.Dont redefine */
/*this macro.*/
/* */
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 )
(FT_Tag)
( ( (FT_ULong)_x1 << 24 ) | ( (FT_ULong)_x2 << 16 ) | ( (FT_ULong)_x3 <<8 ) | (FT_ULong)_x4 )/*************************************************************************//*************************************************************************//* *//*L I S T M A N A G E M E N T*//* *//*************************************************************************//*************************************************************************//*************************************************************************//* *//*
/*list_processing*/
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/*
/*FT_ListNode*/
/* */
/*
/* Many elements and objects in FreeType are listed through an */
/* @FT_List record (see @FT_ListRec).As its name suggests, an*/
/* FT_ListNode is a handle to a single list element. */
/* */
typedef struct FT_ListNodeRec_*FT_ListNode;
/*************************************************************************/
/* */
/*
/*FT_List*/
/* */
/*
/*A handle to a list record (see @FT_ListRec). */
/* */
typedef struct FT_ListRec_*FT_List;
/*************************************************************************/
/* */
/*
/*FT_ListNodeRec */
/* */
/*
/*A structure used to hold a single list element.*/
/* */
/*
/*prev :: The previous element in the list.NULL if first.*/
/* */
/*next :: The next element in the list.NULL if last. */
/* */
/*data :: A typeless pointer to the listed object. */
/* */
typedef structFT_ListNodeRec_
{
FT_ListNodeprev;
FT_ListNodenext;
void*data;
} FT_ListNodeRec;
/*************************************************************************/
/* */
/*
/*FT_ListRec */
/* */
/*
/*A structure used to hold a simple doubly-linked list.These are */
/*used in many parts of FreeType.*/
/* */
/*
/*head :: The head (first element) of doubly-linked list.*/
/* */
/*tail :: The tail (last element) of doubly-linked list. */
/* */
typedef structFT_ListRec_
{
FT_ListNodehead;
FT_ListNodetail;
} FT_ListRec;
/* */
#define FT_IS_EMPTY( list )( (list).head == 0 )
#define FT_BOOL( x )( (FT_Bool)( x ) )
/* concatenate C tokens */
#define FT_ERR_XCAT( x, y )x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
/* see `ftmoderr.h for descriptions of the following macros */
#define FT_ERR( e )FT_ERR_CAT( FT_ERR_PREFIX, e )
#define FT_ERROR_BASE( x )( (x) & 0xFF )
#define FT_ERROR_MODULE( x )( (x) & 0xFF00U )
#define FT_ERR_EQ( x, e )
( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )
#define FT_ERR_NEQ( x, e )
( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )
FT_END_HEADER
#endif /* __FTTYPES_H__ */
/* END */
Reviews
There are no reviews yet.