2018-06-03 22:00:42 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* fttypes.h
|
|
|
|
*
|
|
|
|
* FreeType simple types definitions (specification only).
|
|
|
|
*
|
2023-01-17 09:18:25 +01:00
|
|
|
* Copyright (C) 1996-2023 by
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef FTTYPES_H_
|
|
|
|
#define FTTYPES_H_
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_CONFIG_CONFIG_H
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/ftsystem.h>
|
|
|
|
#include <freetype/ftimage.h>
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @section:
|
2018-06-03 22:00:42 +02:00
|
|
|
* basic_types
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @title:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Basic Data Types
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @abstract:
|
2018-06-03 22:00:42 +02:00
|
|
|
* The basic data types defined by the library.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* This section contains the basic data types defined by FreeType~2,
|
|
|
|
* ranging from simple scalar types to bitmap descriptors. More
|
2022-10-15 04:06:23 +02:00
|
|
|
* font-specific structures are defined in a different section. Note
|
|
|
|
* that FreeType does not use floating-point data types. Fractional
|
|
|
|
* values are represented by fixed-point integers, with lower bits
|
|
|
|
* storing the fractional part.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @order:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Bool
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef of unsigned char, used for simple booleans. As usual,
|
|
|
|
* values 1 and~0 represent true and false, respectively.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef unsigned char FT_Bool;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_FWord
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A signed 16-bit integer used to store a distance in original font
|
|
|
|
* units.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef signed short FT_FWord; /* distance in FUnits */
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_UFWord
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* An unsigned 16-bit integer used to store a distance in original font
|
|
|
|
* units.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef unsigned short FT_UFWord; /* unsigned distance */
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Char
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A simple typedef for the _signed_ char type.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef signed char FT_Char;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Byte
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A simple typedef for the _unsigned_ char type.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef unsigned char FT_Byte;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Bytes
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for constant memory areas.
|
|
|
|
*/
|
2004-08-30 07:27:57 +02:00
|
|
|
typedef const FT_Byte* FT_Bytes;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Tag
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for 32-bit tags (as used in the SFNT format).
|
|
|
|
*/
|
2004-08-30 07:27:57 +02:00
|
|
|
typedef FT_UInt32 FT_Tag;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_String
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A simple typedef for the char type, usually used for strings.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef char FT_String;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Short
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for signed short.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef signed short FT_Short;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_UShort
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for unsigned short.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef unsigned short FT_UShort;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Int
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for the int type.
|
|
|
|
*/
|
2004-08-30 07:27:57 +02:00
|
|
|
typedef signed int FT_Int;
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_UInt
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for the unsigned int type.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef unsigned int FT_UInt;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Long
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for signed long.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef signed long FT_Long;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_ULong
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A typedef for unsigned long.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef unsigned long FT_ULong;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_F2Dot14
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A signed 2.14 fixed-point type used for unit vectors.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef signed short FT_F2Dot14;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_F26Dot6
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* A signed 26.6 fixed-point type used for vectorial pixel coordinates.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef signed long FT_F26Dot6;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Fixed
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* This type is used to store 16.16 fixed-point values, like scaling
|
|
|
|
* values or matrix coefficients.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef signed long FT_Fixed;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Error
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* The FreeType error code type. A value of~0 is always interpreted as a
|
|
|
|
* successful operation.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef int FT_Error;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Pointer
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A simple typedef for a typeless pointer.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef void* FT_Pointer;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Offset
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef size_t FT_Offset;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_PtrDist
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2004-10-14 13:33:04 +02:00
|
|
|
typedef ft_ptrdiff_t FT_PtrDist;
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_UnitVector
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A simple structure used to store a 2D vector unit vector. Uses
|
|
|
|
* FT_F2Dot14 types.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* x ::
|
|
|
|
* Horizontal coordinate.
|
|
|
|
*
|
|
|
|
* y ::
|
|
|
|
* Vertical coordinate.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_UnitVector_
|
|
|
|
{
|
|
|
|
FT_F2Dot14 x;
|
|
|
|
FT_F2Dot14 y;
|
|
|
|
|
|
|
|
} FT_UnitVector;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Matrix
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* A simple structure used to store a 2x2 matrix. Coefficients are in
|
|
|
|
* 16.16 fixed-point format. The computation performed is:
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-08-06 10:24:08 +02:00
|
|
|
* x' = x*xx + y*xy
|
|
|
|
* y' = x*yx + y*yy
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* xx ::
|
|
|
|
* Matrix coefficient.
|
|
|
|
*
|
|
|
|
* xy ::
|
|
|
|
* Matrix coefficient.
|
|
|
|
*
|
|
|
|
* yx ::
|
|
|
|
* Matrix coefficient.
|
|
|
|
*
|
|
|
|
* yy ::
|
|
|
|
* Matrix coefficient.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_Matrix_
|
|
|
|
{
|
|
|
|
FT_Fixed xx, xy;
|
|
|
|
FT_Fixed yx, yy;
|
|
|
|
|
|
|
|
} FT_Matrix;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Data
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Read-only binary data represented as a pointer and a length.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* pointer ::
|
|
|
|
* The data.
|
|
|
|
*
|
|
|
|
* length ::
|
|
|
|
* The length of the data in bytes.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_Data_
|
|
|
|
{
|
|
|
|
const FT_Byte* pointer;
|
2021-10-08 04:41:56 +02:00
|
|
|
FT_UInt length;
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
} FT_Data;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @functype:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Generic_Finalizer
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-08-24 18:52:30 +02:00
|
|
|
* The address of the FreeType object that is under finalization. Its
|
2018-09-04 10:37:44 +02:00
|
|
|
* client data is accessed through its `generic` field.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2017-09-30 16:16:03 +02:00
|
|
|
typedef void (*FT_Generic_Finalizer)( void* object );
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Generic
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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.
|
|
|
|
*
|
2018-09-04 10:37:44 +02:00
|
|
|
* Some FreeType object contains a `generic` field, of type `FT_Generic`,
|
2018-08-24 18:52:30 +02:00
|
|
|
* which usage is left to client applications and font servers.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType when the object is destroyed (for example, the previous
|
2018-08-24 18:52:30 +02:00
|
|
|
* client example would put the address of the glyph cache destructor in
|
2018-09-04 10:37:44 +02:00
|
|
|
* the `finalizer` field).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* data ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A typeless pointer to any client-specified data. This field is
|
|
|
|
* completely ignored by the FreeType library.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* finalizer ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A pointer to a 'generic finalizer' function, which will be called
|
2019-02-20 16:18:40 +01:00
|
|
|
* when the object is destroyed. If this field is set to `NULL`, no
|
|
|
|
* code will be called.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_Generic_
|
|
|
|
{
|
|
|
|
void* data;
|
|
|
|
FT_Generic_Finalizer finalizer;
|
|
|
|
|
|
|
|
} FT_Generic;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @macro:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_MAKE_TAG
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* This macro converts four-letter tags that are used to label TrueType
|
2021-11-19 21:50:22 +01:00
|
|
|
* tables into an `FT_Tag` type, to be used within FreeType.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* The produced values **must** be 32-bit integers. Don't redefine this
|
|
|
|
* macro.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2021-11-20 13:01:26 +01:00
|
|
|
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
|
|
|
|
( ( FT_STATIC_BYTE_CAST( FT_Tag, _x1 ) << 24 ) | \
|
|
|
|
( FT_STATIC_BYTE_CAST( FT_Tag, _x2 ) << 16 ) | \
|
|
|
|
( FT_STATIC_BYTE_CAST( FT_Tag, _x3 ) << 8 ) | \
|
|
|
|
FT_STATIC_BYTE_CAST( FT_Tag, _x4 ) )
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* L I S T M A N A G E M E N T */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @section:
|
2018-06-03 22:00:42 +02:00
|
|
|
* list_processing
|
|
|
|
*
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_ListNode
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_ListNodeRec_* FT_ListNode;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @type:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_List
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A handle to a list record (see @FT_ListRec).
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_ListRec_* FT_List;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_ListNodeRec
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A structure used to hold a single list element.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* prev ::
|
2019-02-20 16:18:40 +01:00
|
|
|
* The previous element in the list. `NULL` if first.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* next ::
|
2019-02-20 16:18:40 +01:00
|
|
|
* The next element in the list. `NULL` if last.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* data ::
|
|
|
|
* A typeless pointer to the listed object.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_ListNodeRec_
|
|
|
|
{
|
|
|
|
FT_ListNode prev;
|
|
|
|
FT_ListNode next;
|
|
|
|
void* data;
|
|
|
|
|
|
|
|
} FT_ListNodeRec;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_ListRec
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* A structure used to hold a simple doubly-linked list. These are used
|
|
|
|
* in many parts of FreeType.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* head ::
|
|
|
|
* The head (first element) of doubly-linked list.
|
|
|
|
*
|
|
|
|
* tail ::
|
|
|
|
* The tail (last element) of doubly-linked list.
|
|
|
|
*/
|
2003-12-24 14:37:58 +01:00
|
|
|
typedef struct FT_ListRec_
|
|
|
|
{
|
|
|
|
FT_ListNode head;
|
|
|
|
FT_ListNode tail;
|
|
|
|
|
|
|
|
} FT_ListRec;
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
2014-12-02 23:06:04 +01:00
|
|
|
|
2003-12-24 14:37:58 +01:00
|
|
|
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
|
2021-11-19 21:50:22 +01:00
|
|
|
#define FT_BOOL( x ) FT_STATIC_CAST( FT_Bool, (x) != 0 )
|
2003-12-24 14:37:58 +01:00
|
|
|
|
2013-03-14 15:49:49 +01:00
|
|
|
/* concatenate C tokens */
|
|
|
|
#define FT_ERR_XCAT( x, y ) x ## y
|
|
|
|
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
|
|
|
|
|
2018-09-04 10:37:44 +02:00
|
|
|
/* see `ftmoderr.h` for descriptions of the following macros */
|
2013-03-14 15:49:49 +01:00
|
|
|
|
|
|
|
#define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
|
2003-12-24 14:37:58 +01:00
|
|
|
|
2013-03-14 15:49:49 +01:00
|
|
|
#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
|
2003-12-24 14:37:58 +01:00
|
|
|
#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
|
|
|
|
|
2013-03-14 15:49:49 +01:00
|
|
|
#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 ) ) )
|
|
|
|
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* FTTYPES_H_ */
|
2003-12-24 14:37:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|