Commit 57023a55 authored by Adrian Biagioli's avatar Adrian Biagioli
Browse files

Update freetype and drawsvg_ref.dll so on Win64 DrawSVG builds correctly

parent ab7caec5
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftsystem.h */ * ftsystem.h
/* */ *
/* FreeType low-level system interface definition (specification). */ * FreeType low-level system interface definition (specification).
/* */ *
/* Copyright 1996-2001, 2002, 2005 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef __FTSYSTEM_H__ #ifndef FTSYSTEM_H_
#define __FTSYSTEM_H__ #define FTSYSTEM_H_
#include <ft2build.h> #include <ft2build.h>
...@@ -26,34 +26,33 @@ ...@@ -26,34 +26,33 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* system_interface */ * system_interface
/* */ *
/* <Title> */ * @title:
/* System Interface */ * System Interface
/* */ *
/* <Abstract> */ * @abstract:
/* How FreeType manages memory and i/o. */ * How FreeType manages memory and i/o.
/* */ *
/* <Description> */ * @description:
/* This section contains various definitions related to memory */ * This section contains various definitions related to memory management
/* management and i/o access. You need to understand this */ * and i/o access. You need to understand this information if you want to
/* information if you want to use a custom memory manager or you own */ * use a custom memory manager or you own i/o streams.
/* i/o streams. */ *
/* */ */
/*************************************************************************/
/*************************************************************************/ /**************************************************************************
/* */ *
/* M E M O R Y M A N A G E M E N T */ * M E M O R Y M A N A G E M E N T
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* FT_Memory * FT_Memory
...@@ -66,13 +65,13 @@ FT_BEGIN_HEADER ...@@ -66,13 +65,13 @@ FT_BEGIN_HEADER
typedef struct FT_MemoryRec_* FT_Memory; typedef struct FT_MemoryRec_* FT_Memory;
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Alloc_Func * FT_Alloc_Func
* *
* @description: * @description:
* A function used to allocate `size' bytes from `memory'. * A function used to allocate `size` bytes from `memory`.
* *
* @input: * @input:
* memory :: * memory ::
...@@ -82,7 +81,7 @@ FT_BEGIN_HEADER ...@@ -82,7 +81,7 @@ FT_BEGIN_HEADER
* The size in bytes to allocate. * The size in bytes to allocate.
* *
* @return: * @return:
* Address of new memory block. 0 in case of failure. * Address of new memory block. 0~in case of failure.
* *
*/ */
typedef void* typedef void*
...@@ -90,7 +89,7 @@ FT_BEGIN_HEADER ...@@ -90,7 +89,7 @@ FT_BEGIN_HEADER
long size ); long size );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Free_Func * FT_Free_Func
...@@ -111,7 +110,7 @@ FT_BEGIN_HEADER ...@@ -111,7 +110,7 @@ FT_BEGIN_HEADER
void* block ); void* block );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Realloc_Func * FT_Realloc_Func
...@@ -133,7 +132,7 @@ FT_BEGIN_HEADER ...@@ -133,7 +132,7 @@ FT_BEGIN_HEADER
* The block's current address. * The block's current address.
* *
* @return: * @return:
* New block address. 0 in case of memory shortage. * New block address. 0~in case of memory shortage.
* *
* @note: * @note:
* In case of error, the old block must still be available. * In case of error, the old block must still be available.
...@@ -146,13 +145,13 @@ FT_BEGIN_HEADER ...@@ -146,13 +145,13 @@ FT_BEGIN_HEADER
void* block ); void* block );
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* FT_MemoryRec * FT_MemoryRec
* *
* @description: * @description:
* A structure used to describe a given memory manager to FreeType 2. * A structure used to describe a given memory manager to FreeType~2.
* *
* @fields: * @fields:
* user :: * user ::
...@@ -177,14 +176,14 @@ FT_BEGIN_HEADER ...@@ -177,14 +176,14 @@ FT_BEGIN_HEADER
}; };
/*************************************************************************/ /**************************************************************************
/* */ *
/* I / O M A N A G E M E N T */ * I / O M A N A G E M E N T
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* FT_Stream * FT_Stream
...@@ -192,18 +191,22 @@ FT_BEGIN_HEADER ...@@ -192,18 +191,22 @@ FT_BEGIN_HEADER
* @description: * @description:
* A handle to an input stream. * A handle to an input stream.
* *
* @also:
* See @FT_StreamRec for the publicly accessible fields of a given stream
* object.
*
*/ */
typedef struct FT_StreamRec_* FT_Stream; typedef struct FT_StreamRec_* FT_Stream;
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* FT_StreamDesc * FT_StreamDesc
* *
* @description: * @description:
* A union type used to store either a long or a pointer. This is used * A union type used to store either a long or a pointer. This is used
* to store a file descriptor or a `FILE*' in an input stream. * to store a file descriptor or a `FILE*` in an input stream.
* *
*/ */
typedef union FT_StreamDesc_ typedef union FT_StreamDesc_
...@@ -214,7 +217,7 @@ FT_BEGIN_HEADER ...@@ -214,7 +217,7 @@ FT_BEGIN_HEADER
} FT_StreamDesc; } FT_StreamDesc;
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Stream_IoFunc * FT_Stream_IoFunc
...@@ -239,8 +242,8 @@ FT_BEGIN_HEADER ...@@ -239,8 +242,8 @@ FT_BEGIN_HEADER
* The number of bytes effectively read by the stream. * The number of bytes effectively read by the stream.
* *
* @note: * @note:
* This function might be called to perform a seek or skip operation * This function might be called to perform a seek or skip operation with
* with a `count' of 0. * a `count` of~0. A non-zero return value then indicates an error.
* *
*/ */
typedef unsigned long typedef unsigned long
...@@ -250,7 +253,7 @@ FT_BEGIN_HEADER ...@@ -250,7 +253,7 @@ FT_BEGIN_HEADER
unsigned long count ); unsigned long count );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Stream_CloseFunc * FT_Stream_CloseFunc
...@@ -260,14 +263,14 @@ FT_BEGIN_HEADER ...@@ -260,14 +263,14 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* stream :: * stream ::
* A handle to the target stream. * A handle to the target stream.
* *
*/ */
typedef void typedef void
(*FT_Stream_CloseFunc)( FT_Stream stream ); (*FT_Stream_CloseFunc)( FT_Stream stream );
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* FT_StreamRec * FT_StreamRec
...@@ -278,18 +281,23 @@ FT_BEGIN_HEADER ...@@ -278,18 +281,23 @@ FT_BEGIN_HEADER
* @input: * @input:
* base :: * base ::
* For memory-based streams, this is the address of the first stream * For memory-based streams, this is the address of the first stream
* byte in memory. This field should always be set to NULL for * byte in memory. This field should always be set to `NULL` for
* disk-based streams. * disk-based streams.
* *
* size :: * size ::
* The stream size in bytes. * The stream size in bytes.
* *
* In case of compressed streams where the size is unknown before
* actually doing the decompression, the value is set to 0x7FFFFFFF.
* (Note that this size value can occur for normal streams also; it is
* thus just a hint.)
*
* pos :: * pos ::
* The current position within the stream. * The current position within the stream.
* *
* descriptor :: * descriptor ::
* This field is a union that can hold an integer or a pointer. It is * This field is a union that can hold an integer or a pointer. It is
* used by stream implementations to store file descriptors or `FILE*' * used by stream implementations to store file descriptors or `FILE*`
* pointers. * pointers.
* *
* pathname :: * pathname ::
...@@ -301,16 +309,16 @@ FT_BEGIN_HEADER ...@@ -301,16 +309,16 @@ FT_BEGIN_HEADER
* The stream's input function. * The stream's input function.
* *
* close :: * close ::
* The stream;s close function. * The stream's close function.
* *
* memory :: * memory ::
* The memory manager to use to preload frames. This is set * The memory manager to use to preload frames. This is set internally
* internally by FreeType and shouldn't be touched by stream * by FreeType and shouldn't be touched by stream implementations.
* implementations.
* *
* cursor :: * cursor ::
* This field is set and used internally by FreeType when parsing * This field is set and used internally by FreeType when parsing
* frames. * frames. In particular, the `FT_GET_XXX` macros use this instead of
* the `pos` field.
* *
* limit :: * limit ::
* This field is set and used internally by FreeType when parsing * This field is set and used internally by FreeType when parsing
...@@ -334,13 +342,12 @@ FT_BEGIN_HEADER ...@@ -334,13 +342,12 @@ FT_BEGIN_HEADER
} FT_StreamRec; } FT_StreamRec;
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTSYSTEM_H__ */ #endif /* FTSYSTEM_H_ */
/* END */ /* END */
/***************************************************************************/ /****************************************************************************
/* */ *
/* fttrigon.h */ * fttrigon.h
/* */ *
/* FreeType trigonometric functions (specification). */ * FreeType trigonometric functions (specification).
/* */ *
/* Copyright 2001, 2003, 2005, 2007 by */ * Copyright (C) 2001-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef __FTTRIGON_H__ #ifndef FTTRIGON_H_
#define __FTTRIGON_H__ #define FTTRIGON_H_
#include FT_FREETYPE_H #include FT_FREETYPE_H
...@@ -31,28 +31,28 @@ ...@@ -31,28 +31,28 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* computations */ * computations
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* FT_Angle * FT_Angle
* *
* @description: * @description:
* This type is used to model angle values in FreeType. Note that the * This type is used to model angle values in FreeType. Note that the
* angle is a 16.16 fixed float value expressed in degrees. * angle is a 16.16 fixed-point value expressed in degrees.
* *
*/ */
typedef FT_Fixed FT_Angle; typedef FT_Fixed FT_Angle;
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI * FT_ANGLE_PI
...@@ -64,7 +64,7 @@ FT_BEGIN_HEADER ...@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI ( 180L << 16 ) #define FT_ANGLE_PI ( 180L << 16 )
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_2PI * FT_ANGLE_2PI
...@@ -76,7 +76,7 @@ FT_BEGIN_HEADER ...@@ -76,7 +76,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) #define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI2 * FT_ANGLE_PI2
...@@ -88,7 +88,7 @@ FT_BEGIN_HEADER ...@@ -88,7 +88,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) #define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI4 * FT_ANGLE_PI4
...@@ -100,13 +100,13 @@ FT_BEGIN_HEADER ...@@ -100,13 +100,13 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) #define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Sin * FT_Sin
* *
* @description: * @description:
* Return the sinus of a given angle in fixed point format. * Return the sinus of a given angle in fixed-point format.
* *
* @input: * @input:
* angle :: * angle ::
...@@ -124,13 +124,13 @@ FT_BEGIN_HEADER ...@@ -124,13 +124,13 @@ FT_BEGIN_HEADER
FT_Sin( FT_Angle angle ); FT_Sin( FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Cos * FT_Cos
* *
* @description: * @description:
* Return the cosinus of a given angle in fixed point format. * Return the cosinus of a given angle in fixed-point format.
* *
* @input: * @input:
* angle :: * angle ::
...@@ -148,13 +148,13 @@ FT_BEGIN_HEADER ...@@ -148,13 +148,13 @@ FT_BEGIN_HEADER
FT_Cos( FT_Angle angle ); FT_Cos( FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Tan * FT_Tan
* *
* @description: * @description:
* Return the tangent of a given angle in fixed point format. * Return the tangent of a given angle in fixed-point format.
* *
* @input: * @input:
* angle :: * angle ::
...@@ -168,14 +168,14 @@ FT_BEGIN_HEADER ...@@ -168,14 +168,14 @@ FT_BEGIN_HEADER
FT_Tan( FT_Angle angle ); FT_Tan( FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Atan2 * FT_Atan2
* *
* @description: * @description:
* Return the arc-tangent corresponding to a given vector (x,y) in * Return the arc-tangent corresponding to a given vector (x,y) in the 2d
* the 2d plane. * plane.
* *
* @input: * @input:
* x :: * x ::
...@@ -193,7 +193,7 @@ FT_BEGIN_HEADER ...@@ -193,7 +193,7 @@ FT_BEGIN_HEADER
FT_Fixed y ); FT_Fixed y );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Angle_Diff * FT_Angle_Diff
...@@ -210,7 +210,7 @@ FT_BEGIN_HEADER ...@@ -210,7 +210,7 @@ FT_BEGIN_HEADER
* Second angle. * Second angle.
* *
* @return: * @return:
* Constrained value of `value2-value1'. * Constrained value of `angle2-angle1`.
* *
*/ */
FT_EXPORT( FT_Angle ) FT_EXPORT( FT_Angle )
...@@ -218,15 +218,15 @@ FT_BEGIN_HEADER ...@@ -218,15 +218,15 @@ FT_BEGIN_HEADER
FT_Angle angle2 ); FT_Angle angle2 );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Unit * FT_Vector_Unit
* *
* @description: * @description:
* Return the unit vector corresponding to a given angle. After the * Return the unit vector corresponding to a given angle. After the
* call, the value of `vec.x' will be `sin(angle)', and the value of * call, the value of `vec.x` will be `cos(angle)`, and the value of
* `vec.y' will be `cos(angle)'. * `vec.y` will be `sin(angle)`.
* *
* This function is useful to retrieve both the sinus and cosinus of a * This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly. * given angle quickly.
...@@ -237,7 +237,7 @@ FT_BEGIN_HEADER ...@@ -237,7 +237,7 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* angle :: * angle ::
* The address of angle. * The input angle.
* *
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
...@@ -245,7 +245,7 @@ FT_BEGIN_HEADER ...@@ -245,7 +245,7 @@ FT_BEGIN_HEADER
FT_Angle angle ); FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Rotate * FT_Vector_Rotate
...@@ -259,7 +259,7 @@ FT_BEGIN_HEADER ...@@ -259,7 +259,7 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* angle :: * angle ::
* The address of angle. * The input angle.
* *
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
...@@ -267,7 +267,7 @@ FT_BEGIN_HEADER ...@@ -267,7 +267,7 @@ FT_BEGIN_HEADER
FT_Angle angle ); FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Length * FT_Vector_Length
...@@ -288,7 +288,7 @@ FT_BEGIN_HEADER ...@@ -288,7 +288,7 @@ FT_BEGIN_HEADER
FT_Vector_Length( FT_Vector* vec ); FT_Vector_Length( FT_Vector* vec );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Polarize * FT_Vector_Polarize
...@@ -314,7 +314,7 @@ FT_BEGIN_HEADER ...@@ -314,7 +314,7 @@ FT_BEGIN_HEADER
FT_Angle *angle ); FT_Angle *angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_From_Polar * FT_Vector_From_Polar
...@@ -344,7 +344,7 @@ FT_BEGIN_HEADER ...@@ -344,7 +344,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTTRIGON_H__ */ #endif /* FTTRIGON_H_ */
/* END */ /* END */
/****************************************************************************
*
* fttypes.h
*
* FreeType simple types definitions (specification only).
*
* Copyright (C) 1996-2019 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 <ft2build.h>
#include FT_CONFIG_CONFIG_H
#include FT_SYSTEM_H
#include FT_IMAGE_H
#include <stddef.h>
FT_BEGIN_HEADER
/**************************************************************************
*
* @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_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
*
*/
/**************************************************************************
*
* @type:
* FT_Bool
*
* @description:
* A typedef of unsigned char, used for simple booleans. As usual,
* values 1 and~0 represent true and false, respectively.
*/
typedef unsigned char FT_Bool;
/**************************************************************************
*
* @type:
* FT_FWord
*
* @description:
* A signed 16-bit integer used to store a distance in original font
* units.
*/
typedef signed short FT_FWord; /* distance in FUnits */
/**************************************************************************
*
* @type:
* FT_UFWord
*
* @description:
* An unsigned 16-bit integer used to store a distance in original font
* units.
*/
typedef unsigned short FT_UFWord; /* unsigned distance */
/**************************************************************************
*
* @type:
* FT_Char
*
* @description:
* A simple typedef for the _signed_ char type.
*/
typedef signed char FT_Char;
/**************************************************************************
*
* @type:
* FT_Byte
*
* @description:
* A simple typedef for the _unsigned_ char type.
*/
typedef unsigned char FT_Byte;
/**************************************************************************
*
* @type:
* FT_Bytes
*
* @description:
* A typedef for constant memory areas.
*/
typedef const FT_Byte* FT_Bytes;
/**************************************************************************
*
* @type:
* FT_Tag
*
* @description:
* A typedef for 32-bit tags (as used in the SFNT format).
*/
typedef FT_UInt32 FT_Tag;
/**************************************************************************
*
* @type:
* FT_String
*
* @description:
* A simple typedef for the char type, usually used for strings.
*/
typedef char FT_String;
/**************************************************************************
*
* @type:
* FT_Short
*
* @description:
* A typedef for signed short.
*/
typedef signed short FT_Short;
/**************************************************************************
*
* @type:
* FT_UShort
*
* @description:
* A typedef for unsigned short.
*/
typedef unsigned short FT_UShort;
/**************************************************************************
*
* @type:
* FT_Int
*
* @description:
* A typedef for the int type.
*/
typedef signed int FT_Int;
/**************************************************************************
*
* @type:
* FT_UInt
*
* @description:
* A typedef for the unsigned int type.
*/
typedef unsigned int FT_UInt;
/**************************************************************************
*
* @type:
* FT_Long
*
* @description:
* A typedef for signed long.
*/
typedef signed long FT_Long;
/**************************************************************************
*
* @type:
* FT_ULong
*
* @description:
* A typedef for unsigned long.
*/
typedef unsigned long FT_ULong;
/**************************************************************************
*
* @type:
* FT_F2Dot14
*
* @description:
* A signed 2.14 fixed-point type used for unit vectors.
*/
typedef signed short FT_F2Dot14;
/**************************************************************************
*
* @type:
* FT_F26Dot6
*
* @description:
* A signed 26.6 fixed-point type used for vectorial pixel coordinates.
*/
typedef signed long FT_F26Dot6;
/**************************************************************************
*
* @type:
* FT_Fixed
*
* @description:
* This type is used to store 16.16 fixed-point values, like scaling
* values or matrix coefficients.
*/
typedef signed long FT_Fixed;
/**************************************************************************
*
* @type:
* FT_Error
*
* @description:
* The FreeType error code type. A value of~0 is always interpreted as a
* successful operation.
*/
typedef int FT_Error;
/**************************************************************************
*
* @type:
* FT_Pointer
*
* @description:
* A simple typedef for a typeless pointer.
*/
typedef void* FT_Pointer;
/**************************************************************************
*
* @type:
* FT_Offset
*
* @description:
* 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_t FT_Offset;
/**************************************************************************
*
* @type:
* FT_PtrDist
*
* @description:
* 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_t FT_PtrDist;
/**************************************************************************
*
* @struct:
* FT_UnitVector
*
* @description:
* A simple structure used to store a 2D vector unit vector. Uses
* FT_F2Dot14 types.
*
* @fields:
* x ::
* Horizontal coordinate.
*
* y ::
* Vertical coordinate.
*/
typedef struct FT_UnitVector_
{
FT_F2Dot14 x;
FT_F2Dot14 y;
} FT_UnitVector;
/**************************************************************************
*
* @struct:
* FT_Matrix
*
* @description:
* A simple structure used to store a 2x2 matrix. Coefficients are in
* 16.16 fixed-point 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.
*/
typedef struct FT_Matrix_
{
FT_Fixed xx, xy;
FT_Fixed yx, yy;
} FT_Matrix;
/**************************************************************************
*
* @struct:
* FT_Data
*
* @description:
* Read-only binary data represented as a pointer and a length.
*
* @fields:
* pointer ::
* The data.
*
* length ::
* The length of the data in bytes.
*/
typedef struct FT_Data_
{
const FT_Byte* pointer;
FT_Int length;
} FT_Data;
/**************************************************************************
*
* @functype:
* FT_Generic_Finalizer
*
* @description:
* 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.
*
* @input:
* 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 );
/**************************************************************************
*
* @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.
*
* 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).
*
* @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.
*/
typedef struct FT_Generic_
{
void* data;
FT_Generic_Finalizer finalizer;
} FT_Generic;
/**************************************************************************
*
* @macro:
* FT_MAKE_TAG
*
* @description:
* This macro converts four-letter tags that are used to label TrueType
* tables into an unsigned long, to be used within FreeType.
*
* @note:
* The produced values **must** be 32-bit integers. Don't 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 */
/* */
/*************************************************************************/
/*************************************************************************/
/**************************************************************************
*
* @section:
* list_processing
*
*/
/**************************************************************************
*
* @type:
* FT_ListNode
*
* @description:
* 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;
/**************************************************************************
*
* @type:
* FT_List
*
* @description:
* A handle to a list record (see @FT_ListRec).
*/
typedef struct FT_ListRec_* FT_List;
/**************************************************************************
*
* @struct:
* FT_ListNodeRec
*
* @description:
* A structure used to hold a single list element.
*
* @fields:
* 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 struct FT_ListNodeRec_
{
FT_ListNode prev;
FT_ListNode next;
void* data;
} FT_ListNodeRec;
/**************************************************************************
*
* @struct:
* FT_ListRec
*
* @description:
* A structure used to hold a simple doubly-linked list. These are used
* in many parts of FreeType.
*
* @fields:
* head ::
* The head (first element) of doubly-linked list.
*
* tail ::
* The tail (last element) of doubly-linked list.
*/
typedef struct FT_ListRec_
{
FT_ListNode head;
FT_ListNode tail;
} FT_ListRec;
/* */
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
#define FT_BOOL( x ) ( (FT_Bool)( (x) != 0 ) )
/* 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 */
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftwinfnt.h */ * ftwinfnt.h
/* */ *
/* FreeType API for accessing Windows fnt-specific data. */ * FreeType API for accessing Windows fnt-specific data.
/* */ *
/* Copyright 2003, 2004 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef __FTWINFNT_H__ #ifndef FTWINFNT_H_
#define __FTWINFNT_H__ #define FTWINFNT_H_
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
...@@ -32,43 +32,43 @@ ...@@ -32,43 +32,43 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* winfnt_fonts */ * winfnt_fonts
/* */ *
/* <Title> */ * @title:
/* Window FNT Files */ * Window FNT Files
/* */ *
/* <Abstract> */ * @abstract:
/* Windows FNT specific API. */ * Windows FNT-specific API.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of Windows FNT specific */ * This section contains the declaration of Windows FNT-specific
/* functions. */ * functions.
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @enum: * @enum:
* FT_WinFNT_ID_XXX * FT_WinFNT_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `charset' byte in * A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX * Exact mapping tables for the various 'cpXXXX' encodings (except for
* encodings (except for cp1361) can be found at ftp://ftp.unicode.org * 'cp1361') can be found at 'ftp://ftp.unicode.org/Public/' in the
* in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is * `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a
* roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. * superset of `MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT`.
* *
* @values: * @values:
* FT_WinFNT_ID_DEFAULT :: * FT_WinFNT_ID_DEFAULT ::
* This is used for font enumeration and font creation as a * This is used for font enumeration and font creation as a 'don't
* `don't care' value. Valid font files don't contain this value. * care' value. Valid font files don't contain this value. When
* When querying for information about the character set of the font * querying for information about the character set of the font that is
* that is currently selected into a specified device context, this * currently selected into a specified device context, this return
* return value (of the related Windows API) simply denotes failure. * value (of the related Windows API) simply denotes failure.
* *
* FT_WinFNT_ID_SYMBOL :: * FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available. * There is no known mapping table available.
...@@ -77,28 +77,29 @@ FT_BEGIN_HEADER ...@@ -77,28 +77,29 @@ FT_BEGIN_HEADER
* Mac Roman encoding. * Mac Roman encoding.
* *
* FT_WinFNT_ID_OEM :: * FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <michael@poettgen.de>: * From Michael Poettgen <michael@poettgen.de>:
* *
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM * The 'Windows Font Mapping' article says that `FT_WinFNT_ID_OEM` is
* is used for the charset of vector fonts, like `modern.fon', * used for the charset of vector fonts, like `modern.fon`,
* `roman.fon', and `script.fon' on Windows. * `roman.fon`, and `script.fon` on Windows.
* *
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value * The 'CreateFont' documentation says: The `FT_WinFNT_ID_OEM` value
* specifies a character set that is operating-system dependent. * specifies a character set that is operating-system dependent.
* *
* The `IFIMETRICS' documentation from the `Windows Driver * The 'IFIMETRICS' documentation from the 'Windows Driver Development
* Development Kit' says: This font supports an OEM-specific * Kit' says: This font supports an OEM-specific character set. The
* character set. The OEM character set is system dependent. * OEM character set is system dependent.
* *
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the * In general OEM, as opposed to ANSI (i.e., 'cp1252'), denotes the
* second default codepage that most international versions of * second default codepage that most international versions of Windows
* Windows have. It is one of the OEM codepages from * have. It is one of the OEM codepages from
* *
* http://www.microsoft.com/globaldev/reference/cphome.mspx, * https://docs.microsoft.com/en-us/windows/desktop/intl/code-page-identifiers
* ,
* *
* and is used for the `DOS boxes', to support legacy applications. * and is used for the 'DOS boxes', to support legacy applications. A
* A German Windows version for example usually uses ANSI codepage * German Windows version for example usually uses ANSI codepage 1252
* 1252 and OEM codepage 850. * and OEM codepage 850.
* *
* FT_WinFNT_ID_CP874 :: * FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11. * A superset of Thai TIS 620 and ISO 8859-11.
...@@ -111,11 +112,11 @@ FT_BEGIN_HEADER ...@@ -111,11 +112,11 @@ FT_BEGIN_HEADER
* ordering and minor deviations). * ordering and minor deviations).
* *
* FT_WinFNT_ID_CP949 :: * FT_WinFNT_ID_CP949 ::
* A superset of Korean Hangul KS C 5601-1987 (with different * A superset of Korean Hangul KS~C 5601-1987 (with different ordering
* ordering and minor deviations). * and minor deviations).
* *
* FT_WinFNT_ID_CP950 :: * FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big 5 ETen (with different * A superset of traditional Chinese Big~5 ETen (with different
* ordering and minor deviations). * ordering and minor deviations).
* *
* FT_WinFNT_ID_CP1250 :: * FT_WinFNT_ID_CP1250 ::
...@@ -172,14 +173,14 @@ FT_BEGIN_HEADER ...@@ -172,14 +173,14 @@ FT_BEGIN_HEADER
#define FT_WinFNT_ID_OEM 255 #define FT_WinFNT_ID_OEM 255
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_WinFNT_HeaderRec */ * FT_WinFNT_HeaderRec
/* */ *
/* <Description> */ * @description:
/* Windows FNT Header info. */ * Windows FNT Header info.
/* */ */
typedef struct FT_WinFNT_HeaderRec_ typedef struct FT_WinFNT_HeaderRec_
{ {
FT_UShort version; FT_UShort version;
...@@ -219,40 +220,53 @@ FT_BEGIN_HEADER ...@@ -219,40 +220,53 @@ FT_BEGIN_HEADER
FT_UShort color_table_offset; FT_UShort color_table_offset;
FT_ULong reserved1[4]; FT_ULong reserved1[4];
} FT_WinFNT_HeaderRec, *FT_WinFNT_Header; } FT_WinFNT_HeaderRec;
/**************************************************************************
*
* @struct:
* FT_WinFNT_Header
*
* @description:
* A handle to an @FT_WinFNT_HeaderRec structure.
*/
typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
/**********************************************************************
* /**************************************************************************
* @function: *
* FT_Get_WinFNT_Header * @function:
* * FT_Get_WinFNT_Header
* @description: *
* Retrieve a Windows FNT font info header. * @description:
* * Retrieve a Windows FNT font info header.
* @input: *
* face :: A handle to the input face. * @input:
* * face ::
* @output: * A handle to the input face.
* aheader :: The WinFNT header. *
* * @output:
* @return: * aheader ::
* FreeType error code. 0 means success. * The WinFNT header.
* *
* @note: * @return:
* This function only works with Windows FNT faces, returning an error * FreeType error code. 0~means success.
* otherwise. *
*/ * @note:
* This function only works with Windows FNT faces, returning an error
* otherwise.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_WinFNT_Header( FT_Face face, FT_Get_WinFNT_Header( FT_Face face,
FT_WinFNT_HeaderRec *aheader ); FT_WinFNT_HeaderRec *aheader );
/* */
/* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTWINFNT_H__ */ #endif /* FTWINFNT_H_ */
/* END */ /* END */
......
/****************************************************************************
*
* t1tables.h
*
* Basic Type 1/Type 2 tables definitions and interface (specification
* only).
*
* Copyright (C) 1996-2019 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 T1TABLES_H_
#define T1TABLES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* type1_tables
*
* @title:
* Type 1 Tables
*
* @abstract:
* Type~1-specific font tables.
*
* @description:
* This section contains the definition of Type~1-specific tables,
* including structures related to other PostScript font formats.
*
* @order:
* PS_FontInfoRec
* PS_FontInfo
* PS_PrivateRec
* PS_Private
*
* CID_FaceDictRec
* CID_FaceDict
* CID_FaceInfoRec
* CID_FaceInfo
*
* FT_Has_PS_Glyph_Names
* FT_Get_PS_Font_Info
* FT_Get_PS_Font_Private
* FT_Get_PS_Font_Value
*
* T1_Blend_Flags
* T1_EncodingType
* PS_Dict_Keys
*
*/
/* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
/* structures in order to support Multiple Master fonts. */
/**************************************************************************
*
* @struct:
* PS_FontInfoRec
*
* @description:
* A structure used to model a Type~1 or Type~2 FontInfo dictionary.
* Note that for Multiple Master fonts, each instance has its own
* FontInfo dictionary.
*/
typedef struct PS_FontInfoRec_
{
FT_String* version;
FT_String* notice;
FT_String* full_name;
FT_String* family_name;
FT_String* weight;
FT_Long italic_angle;
FT_Bool is_fixed_pitch;
FT_Short underline_position;
FT_UShort underline_thickness;
} PS_FontInfoRec;
/**************************************************************************
*
* @struct:
* PS_FontInfo
*
* @description:
* A handle to a @PS_FontInfoRec structure.
*/
typedef struct PS_FontInfoRec_* PS_FontInfo;
/**************************************************************************
*
* @struct:
* T1_FontInfo
*
* @description:
* This type is equivalent to @PS_FontInfoRec. It is deprecated but kept
* to maintain source compatibility between various versions of FreeType.
*/
typedef PS_FontInfoRec T1_FontInfo;
/**************************************************************************
*
* @struct:
* PS_PrivateRec
*
* @description:
* A structure used to model a Type~1 or Type~2 private dictionary. Note
* that for Multiple Master fonts, each instance has its own Private
* dictionary.
*/
typedef struct PS_PrivateRec_
{
FT_Int unique_id;
FT_Int lenIV;
FT_Byte num_blue_values;
FT_Byte num_other_blues;
FT_Byte num_family_blues;
FT_Byte num_family_other_blues;
FT_Short blue_values[14];
FT_Short other_blues[10];
FT_Short family_blues [14];
FT_Short family_other_blues[10];
FT_Fixed blue_scale;
FT_Int blue_shift;
FT_Int blue_fuzz;
FT_UShort standard_width[1];
FT_UShort standard_height[1];
FT_Byte num_snap_widths;
FT_Byte num_snap_heights;
FT_Bool force_bold;
FT_Bool round_stem_up;
FT_Short snap_widths [13]; /* including std width */
FT_Short snap_heights[13]; /* including std height */
FT_Fixed expansion_factor;
FT_Long language_group;
FT_Long password;
FT_Short min_feature[2];
} PS_PrivateRec;
/**************************************************************************
*
* @struct:
* PS_Private
*
* @description:
* A handle to a @PS_PrivateRec structure.
*/
typedef struct PS_PrivateRec_* PS_Private;
/**************************************************************************
*
* @struct:
* T1_Private
*
* @description:
* This type is equivalent to @PS_PrivateRec. It is deprecated but kept
* to maintain source compatibility between various versions of FreeType.
*/
typedef PS_PrivateRec T1_Private;
/**************************************************************************
*
* @enum:
* T1_Blend_Flags
*
* @description:
* A set of flags used to indicate which fields are present in a given
* blend dictionary (font info or private). Used to support Multiple
* Masters fonts.
*
* @values:
* T1_BLEND_UNDERLINE_POSITION ::
* T1_BLEND_UNDERLINE_THICKNESS ::
* T1_BLEND_ITALIC_ANGLE ::
* T1_BLEND_BLUE_VALUES ::
* T1_BLEND_OTHER_BLUES ::
* T1_BLEND_STANDARD_WIDTH ::
* T1_BLEND_STANDARD_HEIGHT ::
* T1_BLEND_STEM_SNAP_WIDTHS ::
* T1_BLEND_STEM_SNAP_HEIGHTS ::
* T1_BLEND_BLUE_SCALE ::
* T1_BLEND_BLUE_SHIFT ::
* T1_BLEND_FAMILY_BLUES ::
* T1_BLEND_FAMILY_OTHER_BLUES ::
* T1_BLEND_FORCE_BOLD ::
*/
typedef enum T1_Blend_Flags_
{
/* required fields in a FontInfo blend dictionary */
T1_BLEND_UNDERLINE_POSITION = 0,
T1_BLEND_UNDERLINE_THICKNESS,
T1_BLEND_ITALIC_ANGLE,
/* required fields in a Private blend dictionary */
T1_BLEND_BLUE_VALUES,
T1_BLEND_OTHER_BLUES,
T1_BLEND_STANDARD_WIDTH,
T1_BLEND_STANDARD_HEIGHT,
T1_BLEND_STEM_SNAP_WIDTHS,
T1_BLEND_STEM_SNAP_HEIGHTS,
T1_BLEND_BLUE_SCALE,
T1_BLEND_BLUE_SHIFT,
T1_BLEND_FAMILY_BLUES,
T1_BLEND_FAMILY_OTHER_BLUES,
T1_BLEND_FORCE_BOLD,
T1_BLEND_MAX /* do not remove */
} T1_Blend_Flags;
/* these constants are deprecated; use the corresponding */
/* `T1_Blend_Flags` values instead */
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
#define t1_blend_blue_values T1_BLEND_BLUE_VALUES
#define t1_blend_other_blues T1_BLEND_OTHER_BLUES
#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
#define t1_blend_max T1_BLEND_MAX
/* */
/* maximum number of Multiple Masters designs, as defined in the spec */
#define T1_MAX_MM_DESIGNS 16
/* maximum number of Multiple Masters axes, as defined in the spec */
#define T1_MAX_MM_AXIS 4
/* maximum number of elements in a design map */
#define T1_MAX_MM_MAP_POINTS 20
/* this structure is used to store the BlendDesignMap entry for an axis */
typedef struct PS_DesignMap_
{
FT_Byte num_points;
FT_Long* design_points;
FT_Fixed* blend_points;
} PS_DesignMapRec, *PS_DesignMap;
/* backward compatible definition */
typedef PS_DesignMapRec T1_DesignMap;
typedef struct PS_BlendRec_
{
FT_UInt num_designs;
FT_UInt num_axis;
FT_String* axis_names[T1_MAX_MM_AXIS];
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
FT_Fixed* weight_vector;
FT_Fixed* default_weight_vector;
PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
PS_Private privates [T1_MAX_MM_DESIGNS + 1];
FT_ULong blend_bitflags;
FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
/* since 2.3.0 */
/* undocumented, optional: the default design instance; */
/* corresponds to default_weight_vector -- */
/* num_default_design_vector == 0 means it is not present */
/* in the font and associated metrics files */
FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
FT_UInt num_default_design_vector;
} PS_BlendRec, *PS_Blend;
/* backward compatible definition */
typedef PS_BlendRec T1_Blend;
/**************************************************************************
*
* @struct:
* CID_FaceDictRec
*
* @description:
* A structure used to represent data in a CID top-level dictionary. In
* most cases, they are part of the font's '/FDArray' array. Within a
* CID font file, such (internal) subfont dictionaries are enclosed by
* '%ADOBeginFontDict' and '%ADOEndFontDict' comments.
*
* Note that `CID_FaceDictRec` misses a field for the '/FontName'
* keyword, specifying the subfont's name (the top-level font name is
* given by the '/CIDFontName' keyword). This is an oversight, but it
* doesn't limit the 'cid' font module's functionality because FreeType
* neither needs this entry nor gives access to CID subfonts.
*/
typedef struct CID_FaceDictRec_
{
PS_PrivateRec private_dict;
FT_UInt len_buildchar;
FT_Fixed forcebold_threshold;
FT_Pos stroke_width;
FT_Fixed expansion_factor; /* this is a duplicate of */
/* `private_dict->expansion_factor' */
FT_Byte paint_type;
FT_Byte font_type;
FT_Matrix font_matrix;
FT_Vector font_offset;
FT_UInt num_subrs;
FT_ULong subrmap_offset;
FT_Int sd_bytes;
} CID_FaceDictRec;
/**************************************************************************
*
* @struct:
* CID_FaceDict
*
* @description:
* A handle to a @CID_FaceDictRec structure.
*/
typedef struct CID_FaceDictRec_* CID_FaceDict;
/**************************************************************************
*
* @struct:
* CID_FontDict
*
* @description:
* This type is equivalent to @CID_FaceDictRec. It is deprecated but
* kept to maintain source compatibility between various versions of
* FreeType.
*/
typedef CID_FaceDictRec CID_FontDict;
/**************************************************************************
*
* @struct:
* CID_FaceInfoRec
*
* @description:
* A structure used to represent CID Face information.
*/
typedef struct CID_FaceInfoRec_
{
FT_String* cid_font_name;
FT_Fixed cid_version;
FT_Int cid_font_type;
FT_String* registry;
FT_String* ordering;
FT_Int supplement;
PS_FontInfoRec font_info;
FT_BBox font_bbox;
FT_ULong uid_base;
FT_Int num_xuid;
FT_ULong xuid[16];
FT_ULong cidmap_offset;
FT_Int fd_bytes;
FT_Int gd_bytes;
FT_ULong cid_count;
FT_Int num_dicts;
CID_FaceDict font_dicts;
FT_ULong data_offset;
} CID_FaceInfoRec;
/**************************************************************************
*
* @struct:
* CID_FaceInfo
*
* @description:
* A handle to a @CID_FaceInfoRec structure.
*/
typedef struct CID_FaceInfoRec_* CID_FaceInfo;
/**************************************************************************
*
* @struct:
* CID_Info
*
* @description:
* This type is equivalent to @CID_FaceInfoRec. It is deprecated but kept
* to maintain source compatibility between various versions of FreeType.
*/
typedef CID_FaceInfoRec CID_Info;
/**************************************************************************
*
* @function:
* FT_Has_PS_Glyph_Names
*
* @description:
* Return true if a given face provides reliable PostScript glyph names.
* This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
* certain fonts (mostly TrueType) contain incorrect glyph name tables.
*
* When this function returns true, the caller is sure that the glyph
* names returned by @FT_Get_Glyph_Name are reliable.
*
* @input:
* face ::
* face handle
*
* @return:
* Boolean. True if glyph names are reliable.
*
*/
FT_EXPORT( FT_Int )
FT_Has_PS_Glyph_Names( FT_Face face );
/**************************************************************************
*
* @function:
* FT_Get_PS_Font_Info
*
* @description:
* Retrieve the @PS_FontInfoRec structure corresponding to a given
* PostScript font.
*
* @input:
* face ::
* PostScript face handle.
*
* @output:
* afont_info ::
* Output font info structure pointer.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* String pointers within the @PS_FontInfoRec structure are owned by the
* face and don't need to be freed by the caller. Missing entries in
* the font's FontInfo dictionary are represented by `NULL` pointers.
*
* If the font's format is not PostScript-based, this function will
* return the `FT_Err_Invalid_Argument` error code.
*
*/
FT_EXPORT( FT_Error )
FT_Get_PS_Font_Info( FT_Face face,
PS_FontInfo afont_info );
/**************************************************************************
*
* @function:
* FT_Get_PS_Font_Private
*
* @description:
* Retrieve the @PS_PrivateRec structure corresponding to a given
* PostScript font.
*
* @input:
* face ::
* PostScript face handle.
*
* @output:
* afont_private ::
* Output private dictionary structure pointer.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The string pointers within the @PS_PrivateRec structure are owned by
* the face and don't need to be freed by the caller.
*
* If the font's format is not PostScript-based, this function returns
* the `FT_Err_Invalid_Argument` error code.
*
*/
FT_EXPORT( FT_Error )
FT_Get_PS_Font_Private( FT_Face face,
PS_Private afont_private );
/**************************************************************************
*
* @enum:
* T1_EncodingType
*
* @description:
* An enumeration describing the 'Encoding' entry in a Type 1 dictionary.
*
* @values:
* T1_ENCODING_TYPE_NONE ::
* T1_ENCODING_TYPE_ARRAY ::
* T1_ENCODING_TYPE_STANDARD ::
* T1_ENCODING_TYPE_ISOLATIN1 ::
* T1_ENCODING_TYPE_EXPERT ::
*
* @since:
* 2.4.8
*/
typedef enum T1_EncodingType_
{
T1_ENCODING_TYPE_NONE = 0,
T1_ENCODING_TYPE_ARRAY,
T1_ENCODING_TYPE_STANDARD,
T1_ENCODING_TYPE_ISOLATIN1,
T1_ENCODING_TYPE_EXPERT
} T1_EncodingType;
/**************************************************************************
*
* @enum:
* PS_Dict_Keys
*
* @description:
* An enumeration used in calls to @FT_Get_PS_Font_Value to identify the
* Type~1 dictionary entry to retrieve.
*
* @values:
* PS_DICT_FONT_TYPE ::
* PS_DICT_FONT_MATRIX ::
* PS_DICT_FONT_BBOX ::
* PS_DICT_PAINT_TYPE ::
* PS_DICT_FONT_NAME ::
* PS_DICT_UNIQUE_ID ::
* PS_DICT_NUM_CHAR_STRINGS ::
* PS_DICT_CHAR_STRING_KEY ::
* PS_DICT_CHAR_STRING ::
* PS_DICT_ENCODING_TYPE ::
* PS_DICT_ENCODING_ENTRY ::
* PS_DICT_NUM_SUBRS ::
* PS_DICT_SUBR ::
* PS_DICT_STD_HW ::
* PS_DICT_STD_VW ::
* PS_DICT_NUM_BLUE_VALUES ::
* PS_DICT_BLUE_VALUE ::
* PS_DICT_BLUE_FUZZ ::
* PS_DICT_NUM_OTHER_BLUES ::
* PS_DICT_OTHER_BLUE ::
* PS_DICT_NUM_FAMILY_BLUES ::
* PS_DICT_FAMILY_BLUE ::
* PS_DICT_NUM_FAMILY_OTHER_BLUES ::
* PS_DICT_FAMILY_OTHER_BLUE ::
* PS_DICT_BLUE_SCALE ::
* PS_DICT_BLUE_SHIFT ::
* PS_DICT_NUM_STEM_SNAP_H ::
* PS_DICT_STEM_SNAP_H ::
* PS_DICT_NUM_STEM_SNAP_V ::
* PS_DICT_STEM_SNAP_V ::
* PS_DICT_FORCE_BOLD ::
* PS_DICT_RND_STEM_UP ::
* PS_DICT_MIN_FEATURE ::
* PS_DICT_LEN_IV ::
* PS_DICT_PASSWORD ::
* PS_DICT_LANGUAGE_GROUP ::
* PS_DICT_VERSION ::
* PS_DICT_NOTICE ::
* PS_DICT_FULL_NAME ::
* PS_DICT_FAMILY_NAME ::
* PS_DICT_WEIGHT ::
* PS_DICT_IS_FIXED_PITCH ::
* PS_DICT_UNDERLINE_POSITION ::
* PS_DICT_UNDERLINE_THICKNESS ::
* PS_DICT_FS_TYPE ::
* PS_DICT_ITALIC_ANGLE ::
*
* @since:
* 2.4.8
*/
typedef enum PS_Dict_Keys_
{
/* conventionally in the font dictionary */
PS_DICT_FONT_TYPE, /* FT_Byte */
PS_DICT_FONT_MATRIX, /* FT_Fixed */
PS_DICT_FONT_BBOX, /* FT_Fixed */
PS_DICT_PAINT_TYPE, /* FT_Byte */
PS_DICT_FONT_NAME, /* FT_String* */
PS_DICT_UNIQUE_ID, /* FT_Int */
PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */
PS_DICT_CHAR_STRING_KEY, /* FT_String* */
PS_DICT_CHAR_STRING, /* FT_String* */
PS_DICT_ENCODING_TYPE, /* T1_EncodingType */
PS_DICT_ENCODING_ENTRY, /* FT_String* */
/* conventionally in the font Private dictionary */
PS_DICT_NUM_SUBRS, /* FT_Int */
PS_DICT_SUBR, /* FT_String* */
PS_DICT_STD_HW, /* FT_UShort */
PS_DICT_STD_VW, /* FT_UShort */
PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */
PS_DICT_BLUE_VALUE, /* FT_Short */
PS_DICT_BLUE_FUZZ, /* FT_Int */
PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */
PS_DICT_OTHER_BLUE, /* FT_Short */
PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */
PS_DICT_FAMILY_BLUE, /* FT_Short */
PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */
PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */
PS_DICT_BLUE_SCALE, /* FT_Fixed */
PS_DICT_BLUE_SHIFT, /* FT_Int */
PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */
PS_DICT_STEM_SNAP_H, /* FT_Short */
PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */
PS_DICT_STEM_SNAP_V, /* FT_Short */
PS_DICT_FORCE_BOLD, /* FT_Bool */
PS_DICT_RND_STEM_UP, /* FT_Bool */
PS_DICT_MIN_FEATURE, /* FT_Short */
PS_DICT_LEN_IV, /* FT_Int */
PS_DICT_PASSWORD, /* FT_Long */
PS_DICT_LANGUAGE_GROUP, /* FT_Long */
/* conventionally in the font FontInfo dictionary */
PS_DICT_VERSION, /* FT_String* */
PS_DICT_NOTICE, /* FT_String* */
PS_DICT_FULL_NAME, /* FT_String* */
PS_DICT_FAMILY_NAME, /* FT_String* */
PS_DICT_WEIGHT, /* FT_String* */
PS_DICT_IS_FIXED_PITCH, /* FT_Bool */
PS_DICT_UNDERLINE_POSITION, /* FT_Short */
PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */
PS_DICT_FS_TYPE, /* FT_UShort */
PS_DICT_ITALIC_ANGLE, /* FT_Long */
PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
} PS_Dict_Keys;
/**************************************************************************
*
* @function:
* FT_Get_PS_Font_Value
*
* @description:
* Retrieve the value for the supplied key from a PostScript font.
*
* @input:
* face ::
* PostScript face handle.
*
* key ::
* An enumeration value representing the dictionary key to retrieve.
*
* idx ::
* For array values, this specifies the index to be returned.
*
* value ::
* A pointer to memory into which to write the value.
*
* valen_len ::
* The size, in bytes, of the memory supplied for the value.
*
* @output:
* value ::
* The value matching the above key, if it exists.
*
* @return:
* The amount of memory (in bytes) required to hold the requested value
* (if it exists, -1 otherwise).
*
* @note:
* The values returned are not pointers into the internal structures of
* the face, but are 'fresh' copies, so that the memory containing them
* belongs to the calling application. This also enforces the
* 'read-only' nature of these values, i.e., this function cannot be
* used to manipulate the face.
*
* `value` is a void pointer because the values returned can be of
* various types.
*
* If either `value` is `NULL` or `value_len` is too small, just the
* required memory size for the requested entry is returned.
*
* The `idx` parameter is used, not only to retrieve elements of, for
* example, the FontMatrix or FontBBox, but also to retrieve name keys
* from the CharStrings dictionary, and the charstrings themselves. It
* is ignored for atomic values.
*
* `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
* get the value as in the font stream, you need to divide by 65536000.0
* (to remove the FT_Fixed scale, and the x1000 scale).
*
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
* be retrieved. So, for example, PostScript procedures such as NP, ND,
* and RD are not available. Arbitrary keys are, obviously, not be
* available either.
*
* If the font's format is not PostScript-based, this function returns
* the `FT_Err_Invalid_Argument` error code.
*
* @since:
* 2.4.8
*
*/
FT_EXPORT( FT_Long )
FT_Get_PS_Font_Value( FT_Face face,
PS_Dict_Keys key,
FT_UInt idx,
void *value,
FT_Long value_len );
/* */
FT_END_HEADER
#endif /* T1TABLES_H_ */
/* END */
/***************************************************************************/ /****************************************************************************
/* */ *
/* ttnameid.h */ * ttnameid.h
/* */ *
/* TrueType name ID definitions (specification only). */ * TrueType name ID definitions (specification only).
/* */ *
/* Copyright 1996-2002, 2003, 2004, 2006, 2007 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef __TTNAMEID_H__ #ifndef TTNAMEID_H_
#define __TTNAMEID_H__ #define TTNAMEID_H_
#include <ft2build.h> #include <ft2build.h>
...@@ -26,46 +26,54 @@ ...@@ -26,46 +26,54 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* Possible values for the `platform' identifier code in the name */ * @section:
/* records of the TTF `name' table. */ * truetype_tables
/* */ */
/*************************************************************************/
/*********************************************************************** /**************************************************************************
*
* Possible values for the 'platform' identifier code in the name records
* of an SFNT 'name' table.
*
*/
/**************************************************************************
* *
* @enum: * @enum:
* TT_PLATFORM_XXX * TT_PLATFORM_XXX
* *
* @description: * @description:
* A list of valid values for the `platform_id' identifier code in * A list of valid values for the `platform_id` identifier code in
* @FT_CharMapRec and @FT_SfntName structures. * @FT_CharMapRec and @FT_SfntName structures.
* *
* @values: * @values:
* TT_PLATFORM_APPLE_UNICODE :: * TT_PLATFORM_APPLE_UNICODE ::
* Used by Apple to indicate a Unicode character map and/or name entry. * Used by Apple to indicate a Unicode character map and/or name entry.
* See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note * See @TT_APPLE_ID_XXX for corresponding `encoding_id` values. Note
* that name entries in this format are coded as big-endian UCS-2 * that name entries in this format are coded as big-endian UCS-2
* character codes _only_. * character codes _only_.
* *
* TT_PLATFORM_MACINTOSH :: * TT_PLATFORM_MACINTOSH ::
* Used by Apple to indicate a MacOS-specific charmap and/or name entry. * Used by Apple to indicate a MacOS-specific charmap and/or name
* See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that * entry. See @TT_MAC_ID_XXX for corresponding `encoding_id` values.
* most TrueType fonts contain an Apple roman charmap to be usable on * Note that most TrueType fonts contain an Apple roman charmap to be
* MacOS systems (even if they contain a Microsoft charmap as well). * usable on MacOS systems (even if they contain a Microsoft charmap as
* well).
* *
* TT_PLATFORM_ISO :: * TT_PLATFORM_ISO ::
* This value was used to specify Unicode charmaps. It is however * This value was used to specify ISO/IEC 10646 charmaps. It is
* now deprecated. See @TT_ISO_ID_XXX for a list of corresponding * however now deprecated. See @TT_ISO_ID_XXX for a list of
* `encoding_id' values. * corresponding `encoding_id` values.
* *
* TT_PLATFORM_MICROSOFT :: * TT_PLATFORM_MICROSOFT ::
* Used by Microsoft to indicate Windows-specific charmaps. See * Used by Microsoft to indicate Windows-specific charmaps. See
* @TT_MS_ID_XXX for a list of corresponding `encoding_id' values. * @TT_MS_ID_XXX for a list of corresponding `encoding_id` values.
* Note that most fonts contain a Unicode charmap using * Note that most fonts contain a Unicode charmap using
* (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS). * (`TT_PLATFORM_MICROSOFT`, @TT_MS_ID_UNICODE_CS).
* *
* TT_PLATFORM_CUSTOM :: * TT_PLATFORM_CUSTOM ::
* Used to indicate application-specific charmaps. * Used to indicate application-specific charmaps.
...@@ -84,13 +92,13 @@ FT_BEGIN_HEADER ...@@ -84,13 +92,13 @@ FT_BEGIN_HEADER
#define TT_PLATFORM_ADOBE 7 /* artificial */ #define TT_PLATFORM_ADOBE 7 /* artificial */
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_APPLE_ID_XXX * TT_APPLE_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for
* @TT_PLATFORM_APPLE_UNICODE charmaps and name entries. * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
* *
* @values: * @values:
...@@ -108,59 +116,33 @@ FT_BEGIN_HEADER ...@@ -108,59 +116,33 @@ FT_BEGIN_HEADER
* *
* TT_APPLE_ID_UNICODE_32 :: * TT_APPLE_ID_UNICODE_32 ::
* Unicode 3.1 and beyond, using UTF-32. * Unicode 3.1 and beyond, using UTF-32.
*
* TT_APPLE_ID_VARIANT_SELECTOR ::
* From Adobe, not Apple. Not a normal cmap. Specifies variations on
* a real cmap.
*
* TT_APPLE_ID_FULL_UNICODE ::
* Used for fallback fonts that provide complete Unicode coverage with
* a type~13 cmap.
*/ */
#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ #define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ #define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
#define TT_APPLE_ID_ISO_10646 2 /* deprecated */ #define TT_APPLE_ID_ISO_10646 2 /* deprecated */
#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ #define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
#define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ #define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */
#define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */
#define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_MAC_ID_XXX * TT_MAC_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for
* @TT_PLATFORM_MACINTOSH charmaps and name entries. * @TT_PLATFORM_MACINTOSH charmaps and name entries.
*
* @values:
* TT_MAC_ID_ROMAN ::
* TT_MAC_ID_JAPANESE ::
* TT_MAC_ID_TRADITIONAL_CHINESE ::
* TT_MAC_ID_KOREAN ::
* TT_MAC_ID_ARABIC ::
* TT_MAC_ID_HEBREW ::
* TT_MAC_ID_GREEK ::
* TT_MAC_ID_RUSSIAN ::
* TT_MAC_ID_RSYMBOL ::
* TT_MAC_ID_DEVANAGARI ::
* TT_MAC_ID_GURMUKHI ::
* TT_MAC_ID_GUJARATI ::
* TT_MAC_ID_ORIYA ::
* TT_MAC_ID_BENGALI ::
* TT_MAC_ID_TAMIL ::
* TT_MAC_ID_TELUGU ::
* TT_MAC_ID_KANNADA ::
* TT_MAC_ID_MALAYALAM ::
* TT_MAC_ID_SINHALESE ::
* TT_MAC_ID_BURMESE ::
* TT_MAC_ID_KHMER ::
* TT_MAC_ID_THAI ::
* TT_MAC_ID_LAOTIAN ::
* TT_MAC_ID_GEORGIAN ::
* TT_MAC_ID_ARMENIAN ::
* TT_MAC_ID_MALDIVIAN ::
* TT_MAC_ID_SIMPLIFIED_CHINESE ::
* TT_MAC_ID_TIBETAN ::
* TT_MAC_ID_MONGOLIAN ::
* TT_MAC_ID_GEEZ ::
* TT_MAC_ID_SLAVIC ::
* TT_MAC_ID_VIETNAMESE ::
* TT_MAC_ID_SINDHI ::
* TT_MAC_ID_UNINTERP ::
*/ */
#define TT_MAC_ID_ROMAN 0 #define TT_MAC_ID_ROMAN 0
...@@ -199,14 +181,14 @@ FT_BEGIN_HEADER ...@@ -199,14 +181,14 @@ FT_BEGIN_HEADER
#define TT_MAC_ID_UNINTERP 32 #define TT_MAC_ID_UNINTERP 32
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_ISO_ID_XXX * TT_ISO_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for @TT_PLATFORM_ISO
* @TT_PLATFORM_ISO charmaps and name entries. * charmaps and name entries.
* *
* Their use is now deprecated. * Their use is now deprecated.
* *
...@@ -224,64 +206,66 @@ FT_BEGIN_HEADER ...@@ -224,64 +206,66 @@ FT_BEGIN_HEADER
#define TT_ISO_ID_8859_1 2 #define TT_ISO_ID_8859_1 2
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_MS_ID_XXX * TT_MS_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for
* @TT_PLATFORM_MICROSOFT charmaps and name entries. * @TT_PLATFORM_MICROSOFT charmaps and name entries.
* *
* @values: * @values:
* TT_MS_ID_SYMBOL_CS :: * TT_MS_ID_SYMBOL_CS ::
* Corresponds to Microsoft symbol encoding. See * Microsoft symbol encoding. See @FT_ENCODING_MS_SYMBOL.
* @FT_ENCODING_MS_SYMBOL.
* *
* TT_MS_ID_UNICODE_CS :: * TT_MS_ID_UNICODE_CS ::
* Corresponds to a Microsoft WGL4 charmap, matching Unicode. See * Microsoft WGL4 charmap, matching Unicode. See @FT_ENCODING_UNICODE.
* @FT_ENCODING_UNICODE.
* *
* TT_MS_ID_SJIS :: * TT_MS_ID_SJIS ::
* Corresponds to SJIS Japanese encoding. See @FT_ENCODING_SJIS. * Shift JIS Japanese encoding. See @FT_ENCODING_SJIS.
* *
* TT_MS_ID_GB2312 :: * TT_MS_ID_PRC ::
* Corresponds to Simplified Chinese as used in Mainland China. See * Chinese encodings as used in the People's Republic of China (PRC).
* @FT_ENCODING_GB2312. * This means the encodings GB~2312 and its supersets GBK and GB~18030.
* See @FT_ENCODING_PRC.
* *
* TT_MS_ID_BIG_5 :: * TT_MS_ID_BIG_5 ::
* Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. * Traditional Chinese as used in Taiwan and Hong Kong. See
* See @FT_ENCODING_BIG5. * @FT_ENCODING_BIG5.
* *
* TT_MS_ID_WANSUNG :: * TT_MS_ID_WANSUNG ::
* Corresponds to Korean Wansung encoding. See @FT_ENCODING_WANSUNG. * Korean Extended Wansung encoding. See @FT_ENCODING_WANSUNG.
* *
* TT_MS_ID_JOHAB :: * TT_MS_ID_JOHAB ::
* Corresponds to Johab encoding. See @FT_ENCODING_JOHAB. * Korean Johab encoding. See @FT_ENCODING_JOHAB.
* *
* TT_MS_ID_UCS_4 :: * TT_MS_ID_UCS_4 ::
* Corresponds to UCS-4 or UTF-32 charmaps. This has been added to * UCS-4 or UTF-32 charmaps. This has been added to the OpenType
* the OpenType specification version 1.4 (mid-2001.) * specification version 1.4 (mid-2001).
*/ */
#define TT_MS_ID_SYMBOL_CS 0 #define TT_MS_ID_SYMBOL_CS 0
#define TT_MS_ID_UNICODE_CS 1 #define TT_MS_ID_UNICODE_CS 1
#define TT_MS_ID_SJIS 2 #define TT_MS_ID_SJIS 2
#define TT_MS_ID_GB2312 3 #define TT_MS_ID_PRC 3
#define TT_MS_ID_BIG_5 4 #define TT_MS_ID_BIG_5 4
#define TT_MS_ID_WANSUNG 5 #define TT_MS_ID_WANSUNG 5
#define TT_MS_ID_JOHAB 6 #define TT_MS_ID_JOHAB 6
#define TT_MS_ID_UCS_4 10 #define TT_MS_ID_UCS_4 10
/* this value is deprecated */
#define TT_MS_ID_GB2312 TT_MS_ID_PRC
/***********************************************************************
/**************************************************************************
* *
* @enum: * @enum:
* TT_ADOBE_ID_XXX * TT_ADOBE_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for @TT_PLATFORM_ADOBE
* @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! * charmaps. This is a FreeType-specific extension!
* *
* @values: * @values:
* TT_ADOBE_ID_STANDARD :: * TT_ADOBE_ID_STANDARD ::
...@@ -290,6 +274,8 @@ FT_BEGIN_HEADER ...@@ -290,6 +274,8 @@ FT_BEGIN_HEADER
* Adobe expert encoding. * Adobe expert encoding.
* TT_ADOBE_ID_CUSTOM :: * TT_ADOBE_ID_CUSTOM ::
* Adobe custom encoding. * Adobe custom encoding.
* TT_ADOBE_ID_LATIN_1 ::
* Adobe Latin~1 encoding.
*/ */
#define TT_ADOBE_ID_STANDARD 0 #define TT_ADOBE_ID_STANDARD 0
...@@ -298,16 +284,22 @@ FT_BEGIN_HEADER ...@@ -298,16 +284,22 @@ FT_BEGIN_HEADER
#define TT_ADOBE_ID_LATIN_1 3 #define TT_ADOBE_ID_LATIN_1 3
/*************************************************************************/ /**************************************************************************
/* */ *
/* Possible values of the language identifier field in the name records */ * @enum:
/* of the TTF `name' table if the `platform' identifier code is */ * TT_MAC_LANGID_XXX
/* TT_PLATFORM_MACINTOSH. */ *
/* */ * @description:
/* The canonical source for the Apple assigned Language ID's is at */ * Possible values of the language identifier field in the name records
/* */ * of the SFNT 'name' table if the 'platform' identifier code is
/* http://fonts.apple.com/TTRefMan/RM06/Chap6name.html */ * @TT_PLATFORM_MACINTOSH. These values are also used as return values
/* */ * for function @FT_Get_CMap_Language_ID.
*
* The canonical source for Apple's IDs is
*
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html
*/
#define TT_MAC_LANGID_ENGLISH 0 #define TT_MAC_LANGID_ENGLISH 0
#define TT_MAC_LANGID_FRENCH 1 #define TT_MAC_LANGID_FRENCH 1
#define TT_MAC_LANGID_GERMAN 2 #define TT_MAC_LANGID_GERMAN 2
...@@ -418,15 +410,6 @@ FT_BEGIN_HEADER ...@@ -418,15 +410,6 @@ FT_BEGIN_HEADER
#define TT_MAC_LANGID_JAVANESE 138 #define TT_MAC_LANGID_JAVANESE 138
#define TT_MAC_LANGID_SUNDANESE 139 #define TT_MAC_LANGID_SUNDANESE 139
#if 0 /* these seem to be errors that have been dropped */
#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
#define TT_MAC_LANGID_IRISH_GAELIC 141
#endif
/* The following codes are new as of 2000-03-10 */ /* The following codes are new as of 2000-03-10 */
#define TT_MAC_LANGID_GALICIAN 140 #define TT_MAC_LANGID_GALICIAN 140
#define TT_MAC_LANGID_AFRIKAANS 141 #define TT_MAC_LANGID_AFRIKAANS 141
...@@ -441,149 +424,112 @@ FT_BEGIN_HEADER ...@@ -441,149 +424,112 @@ FT_BEGIN_HEADER
#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 #define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
/*************************************************************************/ /**************************************************************************
/* */ *
/* Possible values of the language identifier field in the name records */ * @enum:
/* of the TTF `name' table if the `platform' identifier code is */ * TT_MS_LANGID_XXX
/* TT_PLATFORM_MICROSOFT. */ *
/* */ * @description:
/* The canonical source for the MS assigned LCID's (seems to) be at */ * Possible values of the language identifier field in the name records
/* */ * of the SFNT 'name' table if the 'platform' identifier code is
/* http://www.microsoft.com/globaldev/reference/lcid-all.mspx */ * @TT_PLATFORM_MICROSOFT. These values are also used as return values
/* */ * for function @FT_Get_CMap_Language_ID.
/* It used to be at various places, among them */ *
/* */ * The canonical source for Microsoft's IDs is
/* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt */ *
/* http://www.microsoft.com/globaldev/reference/loclanghome.asp */ * https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings ,
/* http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP */ *
/* http://msdn.microsoft.com/library/en-us/passport25/ */ * however, we only provide macros for language identifiers present in
/* NET_Passport_VBScript_Documentation/Single_Sign_In/ */ * the OpenType specification: Microsoft has abandoned the concept of
/* Advanced_Single_Sign_In/Localization_and_LCIDs.asp */ * LCIDs (language code identifiers), and format~1 of the 'name' table
/* */ * provides a better mechanism for languages not covered here.
/* Hopefully, it seems now that the Globaldev site prevails... */ *
/* (updated by Antoine, 2004-02-17) */ * More legacy values not listed in the reference can be found in the
* @FT_TRUETYPE_IDS_H header file.
*/
#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 #define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
#define TT_MS_LANGID_ARABIC_IRAQ 0x0801 #define TT_MS_LANGID_ARABIC_IRAQ 0x0801
#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01 #define TT_MS_LANGID_ARABIC_EGYPT 0x0C01
#define TT_MS_LANGID_ARABIC_LIBYA 0x1001 #define TT_MS_LANGID_ARABIC_LIBYA 0x1001
#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 #define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 #define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01 #define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01
#define TT_MS_LANGID_ARABIC_OMAN 0x2001 #define TT_MS_LANGID_ARABIC_OMAN 0x2001
#define TT_MS_LANGID_ARABIC_YEMEN 0x2401 #define TT_MS_LANGID_ARABIC_YEMEN 0x2401
#define TT_MS_LANGID_ARABIC_SYRIA 0x2801 #define TT_MS_LANGID_ARABIC_SYRIA 0x2801
#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01 #define TT_MS_LANGID_ARABIC_JORDAN 0x2C01
#define TT_MS_LANGID_ARABIC_LEBANON 0x3001 #define TT_MS_LANGID_ARABIC_LEBANON 0x3001
#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 #define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
#define TT_MS_LANGID_ARABIC_UAE 0x3801 #define TT_MS_LANGID_ARABIC_UAE 0x3801
#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01 #define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01
#define TT_MS_LANGID_ARABIC_QATAR 0x4001 #define TT_MS_LANGID_ARABIC_QATAR 0x4001
#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 #define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
#define TT_MS_LANGID_CATALAN_SPAIN 0x0403 #define TT_MS_LANGID_CATALAN_CATALAN 0x0403
#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 #define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
#define TT_MS_LANGID_CHINESE_PRC 0x0804 #define TT_MS_LANGID_CHINESE_PRC 0x0804
#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04 #define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04
#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 #define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
#define TT_MS_LANGID_CHINESE_MACAO 0x1404
#if 1 /* this looks like the correct value */
#define TT_MS_LANGID_CHINESE_MACAU 0x1404
#else /* but beware, Microsoft may change its mind...
the most recent Word reference has the following: */
#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
#endif
#if 0 /* used only with .NET `cultures'; commented out */
#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04
#endif
#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 #define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
#define TT_MS_LANGID_DANISH_DENMARK 0x0406 #define TT_MS_LANGID_DANISH_DENMARK 0x0406
#define TT_MS_LANGID_GERMAN_GERMANY 0x0407 #define TT_MS_LANGID_GERMAN_GERMANY 0x0407
#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 #define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07 #define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07
#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 #define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407 #define TT_MS_LANGID_GERMAN_LIECHTENSTEIN 0x1407
#define TT_MS_LANGID_GREEK_GREECE 0x0408 #define TT_MS_LANGID_GREEK_GREECE 0x0408
/* don't ask what this one means... It is commented out currently. */
#if 0
#define TT_MS_LANGID_GREEK_GREECE2 0x2008
#endif
#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 #define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 #define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09 #define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09
#define TT_MS_LANGID_ENGLISH_CANADA 0x1009 #define TT_MS_LANGID_ENGLISH_CANADA 0x1009
#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 #define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 #define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09 #define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09
#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 #define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 #define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 #define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09 #define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09
#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 #define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 #define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09
#define TT_MS_LANGID_ENGLISH_INDIA 0x4009 #define TT_MS_LANGID_ENGLISH_INDIA 0x4009
#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 #define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409
#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 #define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809
#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a #define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A
#define TT_MS_LANGID_SPANISH_MEXICO 0x080a #define TT_MS_LANGID_SPANISH_MEXICO 0x080A
#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a #define TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT 0x0C0A
#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a #define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A
#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a #define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A
#define TT_MS_LANGID_SPANISH_PANAMA 0x180a #define TT_MS_LANGID_SPANISH_PANAMA 0x180A
#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a #define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A
#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a #define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A
#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a #define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A
#define TT_MS_LANGID_SPANISH_PERU 0x280a #define TT_MS_LANGID_SPANISH_PERU 0x280A
#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a #define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A
#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a #define TT_MS_LANGID_SPANISH_ECUADOR 0x300A
#define TT_MS_LANGID_SPANISH_CHILE 0x340a #define TT_MS_LANGID_SPANISH_CHILE 0x340A
#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a #define TT_MS_LANGID_SPANISH_URUGUAY 0x380A
#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a #define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A
#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a #define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A
#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a #define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A
#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a #define TT_MS_LANGID_SPANISH_HONDURAS 0x480A
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a #define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a #define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A
#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a #define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A
/* The following ID blatantly violate MS specs by using a */ #define TT_MS_LANGID_FINNISH_FINLAND 0x040B
/* sublanguage > 0x1F. */ #define TT_MS_LANGID_FRENCH_FRANCE 0x040C
#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU #define TT_MS_LANGID_FRENCH_BELGIUM 0x080C
#define TT_MS_LANGID_FINNISH_FINLAND 0x040b #define TT_MS_LANGID_FRENCH_CANADA 0x0C0C
#define TT_MS_LANGID_FRENCH_FRANCE 0x040c #define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C
#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c #define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C
#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c #define TT_MS_LANGID_FRENCH_MONACO 0x180C
#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c #define TT_MS_LANGID_HEBREW_ISRAEL 0x040D
#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c #define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E
#define TT_MS_LANGID_FRENCH_MONACO 0x180c #define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F
#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c
#define TT_MS_LANGID_FRENCH_REUNION 0x200c
#define TT_MS_LANGID_FRENCH_CONGO 0x240c
/* which was formerly: */
#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO
#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c
#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c
#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c
#define TT_MS_LANGID_FRENCH_MALI 0x340c
#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c
#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c
/* and another violation of the spec (see 0xE40aU) */
#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f
#define TT_MS_LANGID_ITALIAN_ITALY 0x0410 #define TT_MS_LANGID_ITALIAN_ITALY 0x0410
#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 #define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 #define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412 #define TT_MS_LANGID_KOREAN_KOREA 0x0412
#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 #define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 #define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 #define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
...@@ -591,245 +537,315 @@ FT_BEGIN_HEADER ...@@ -591,245 +537,315 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_POLISH_POLAND 0x0415 #define TT_MS_LANGID_POLISH_POLAND 0x0415
#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 #define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 #define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417 #define TT_MS_LANGID_ROMANSH_SWITZERLAND 0x0417
#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 #define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 #define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819 #define TT_MS_LANGID_CROATIAN_CROATIA 0x041A
#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a #define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A
#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a #define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A
#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a #define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A
#if 0 /* this used to be this value, but it looks like we were wrong */ #define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a #define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x1C1A
#else /* current sources say */ #define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC 0x201A
#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a #define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B
#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a #define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C
/* and XPsp2 Platform SDK added (2004-07-26) */ #define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D
/* Names are shortened to be significant within 40 chars. */ #define TT_MS_LANGID_SWEDISH_FINLAND 0x081D
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a #define TT_MS_LANGID_THAI_THAILAND 0x041E
#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a #define TT_MS_LANGID_TURKISH_TURKEY 0x041F
#endif
#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b
#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c
#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d
#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d
#define TT_MS_LANGID_THAI_THAILAND 0x041e
#define TT_MS_LANGID_TURKISH_TURKEY 0x041f
#define TT_MS_LANGID_URDU_PAKISTAN 0x0420 #define TT_MS_LANGID_URDU_PAKISTAN 0x0420
#define TT_MS_LANGID_URDU_INDIA 0x0820
#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 #define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 #define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 #define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424 #define TT_MS_LANGID_SLOVENIAN_SLOVENIA 0x0424
#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 #define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 #define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 #define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 #define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428
#define TT_MS_LANGID_FARSI_IRAN 0x0429 #define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A
#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a #define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B
#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b #define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C
#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c #define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C
#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c #define TT_MS_LANGID_BASQUE_BASQUE 0x042D
#define TT_MS_LANGID_BASQUE_SPAIN 0x042d #define TT_MS_LANGID_UPPER_SORBIAN_GERMANY 0x042E
#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e #define TT_MS_LANGID_LOWER_SORBIAN_GERMANY 0x082E
#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f #define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F
#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430 #define TT_MS_LANGID_SETSWANA_SOUTH_AFRICA 0x0432
#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431 #define TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA 0x0434
#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432 #define TT_MS_LANGID_ISIZULU_SOUTH_AFRICA 0x0435
#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 #define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 #define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 #define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
#define TT_MS_LANGID_HINDI_INDIA 0x0439 #define TT_MS_LANGID_HINDI_INDIA 0x0439
#define TT_MS_LANGID_MALTESE_MALTA 0x043a #define TT_MS_LANGID_MALTESE_MALTA 0x043A
/* Added by XPsp2 Platform SDK (2004-07-26) */ #define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B
#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b #define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B
#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b #define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B
#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b #define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B
#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103b #define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B
#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143b #define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B
#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183b #define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B
#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b #define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B
#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b #define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B
#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b #define TT_MS_LANGID_IRISH_IRELAND 0x083C
/* ... and we also keep our old identifier... */ #define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b #define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
#define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F
#if 0 /* this seems to be a previous inversion */ #define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic*/ 0x0440
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c #define TT_MS_LANGID_KISWAHILI_KENYA 0x0441
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
#else
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
#endif
#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440
/* alias declared in Windows 2000 */
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN
#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 #define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 #define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 #define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444 #define TT_MS_LANGID_TATAR_RUSSIA 0x0444
#define TT_MS_LANGID_BENGALI_INDIA 0x0445 #define TT_MS_LANGID_BENGALI_INDIA 0x0445
#define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 #define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845
#define TT_MS_LANGID_PUNJABI_INDIA 0x0446 #define TT_MS_LANGID_PUNJABI_INDIA 0x0446
#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846
#define TT_MS_LANGID_GUJARATI_INDIA 0x0447 #define TT_MS_LANGID_GUJARATI_INDIA 0x0447
#define TT_MS_LANGID_ORIYA_INDIA 0x0448 #define TT_MS_LANGID_ODIA_INDIA 0x0448
#define TT_MS_LANGID_TAMIL_INDIA 0x0449 #define TT_MS_LANGID_TAMIL_INDIA 0x0449
#define TT_MS_LANGID_TELUGU_INDIA 0x044a #define TT_MS_LANGID_TELUGU_INDIA 0x044A
#define TT_MS_LANGID_KANNADA_INDIA 0x044b #define TT_MS_LANGID_KANNADA_INDIA 0x044B
#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c #define TT_MS_LANGID_MALAYALAM_INDIA 0x044C
#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d #define TT_MS_LANGID_ASSAMESE_INDIA 0x044D
#define TT_MS_LANGID_MARATHI_INDIA 0x044e #define TT_MS_LANGID_MARATHI_INDIA 0x044E
#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f #define TT_MS_LANGID_SANSKRIT_INDIA 0x044F
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 #define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850 #define TT_MS_LANGID_MONGOLIAN_PRC 0x0850
#define TT_MS_LANGID_TIBETAN_CHINA 0x0451 #define TT_MS_LANGID_TIBETAN_PRC 0x0451
/* Don't use the next constant! It has */ #define TT_MS_LANGID_WELSH_UNITED_KINGDOM 0x0452
/* (1) the wrong spelling (Dzonghka) */
/* (2) Microsoft doesn't officially define it -- */
/* at least it is not in the List of Local */
/* ID Values. */
/* (3) Dzongkha is not the same language as */
/* Tibetan, so merging it is wrong anyway. */
/* */
/* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW. */
#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
#if 0
/* the following used to be defined */
#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451
/* ... but it was changed; */
#else
/* So we will continue to #define it, but with the correct value */
#define TT_MS_LANGID_TIBETAN_BHUTAN TT_MS_LANGID_DZONGHKA_BHUTAN
#endif
#define TT_MS_LANGID_WELSH_WALES 0x0452
#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 #define TT_MS_LANGID_KHMER_CAMBODIA 0x0453
#define TT_MS_LANGID_LAO_LAOS 0x0454 #define TT_MS_LANGID_LAO_LAOS 0x0454
#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455 #define TT_MS_LANGID_GALICIAN_GALICIAN 0x0456
#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456
#define TT_MS_LANGID_KONKANI_INDIA 0x0457 #define TT_MS_LANGID_KONKANI_INDIA 0x0457
#define TT_MS_LANGID_SYRIAC_SYRIA 0x045A
#define TT_MS_LANGID_SINHALA_SRI_LANKA 0x045B
#define TT_MS_LANGID_INUKTITUT_CANADA 0x045D
#define TT_MS_LANGID_INUKTITUT_CANADA_LATIN 0x085D
#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E
#define TT_MS_LANGID_TAMAZIGHT_ALGERIA 0x085F
#define TT_MS_LANGID_NEPALI_NEPAL 0x0461
#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462
#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463
#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464
#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468
#define TT_MS_LANGID_YORUBA_NIGERIA 0x046A
#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B
#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B
#define TT_MS_LANGID_QUECHUA_PERU 0x0C6B
#define TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA 0x046C
#define TT_MS_LANGID_BASHKIR_RUSSIA 0x046D
#define TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG 0x046E
#define TT_MS_LANGID_GREENLANDIC_GREENLAND 0x046F
#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
#define TT_MS_LANGID_YI_PRC 0x0478
#define TT_MS_LANGID_MAPUDUNGUN_CHILE 0x047A
#define TT_MS_LANGID_MOHAWK_MOHAWK 0x047C
#define TT_MS_LANGID_BRETON_FRANCE 0x047E
#define TT_MS_LANGID_UIGHUR_PRC 0x0480
#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
#define TT_MS_LANGID_OCCITAN_FRANCE 0x0482
#define TT_MS_LANGID_CORSICAN_FRANCE 0x0483
#define TT_MS_LANGID_ALSATIAN_FRANCE 0x0484
#define TT_MS_LANGID_YAKUT_RUSSIA 0x0485
#define TT_MS_LANGID_KICHE_GUATEMALA 0x0486
#define TT_MS_LANGID_KINYARWANDA_RWANDA 0x0487
#define TT_MS_LANGID_WOLOF_SENEGAL 0x0488
#define TT_MS_LANGID_DARI_AFGHANISTAN 0x048C
/* */
/* legacy macro definitions not present in OpenType 1.8.1 */
#define TT_MS_LANGID_ARABIC_GENERAL 0x0001
#define TT_MS_LANGID_CATALAN_SPAIN \
TT_MS_LANGID_CATALAN_CATALAN
#define TT_MS_LANGID_CHINESE_GENERAL 0x0004
#define TT_MS_LANGID_CHINESE_MACAU \
TT_MS_LANGID_CHINESE_MACAO
#define TT_MS_LANGID_GERMAN_LIECHTENSTEI \
TT_MS_LANGID_GERMAN_LIECHTENSTEIN
#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009
#define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809
#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09
#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT \
TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT
#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU
#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C
#define TT_MS_LANGID_FRENCH_REUNION 0x200C
#define TT_MS_LANGID_FRENCH_CONGO 0x240C
/* which was formerly: */
#define TT_MS_LANGID_FRENCH_ZAIRE \
TT_MS_LANGID_FRENCH_CONGO
#define TT_MS_LANGID_FRENCH_SENEGAL 0x280C
#define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C
#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C
#define TT_MS_LANGID_FRENCH_MALI 0x340C
#define TT_MS_LANGID_FRENCH_MOROCCO 0x380C
#define TT_MS_LANGID_FRENCH_HAITI 0x3C0C
#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU
#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA \
TT_MS_LANGID_KOREAN_KOREA
#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND \
TT_MS_LANGID_ROMANSH_SWITZERLAND
#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
#define TT_MS_LANGID_URDU_INDIA 0x0820
#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
#define TT_MS_LANGID_SLOVENE_SLOVENIA \
TT_MS_LANGID_SLOVENIAN_SLOVENIA
#define TT_MS_LANGID_FARSI_IRAN 0x0429
#define TT_MS_LANGID_BASQUE_SPAIN \
TT_MS_LANGID_BASQUE_BASQUE
#define TT_MS_LANGID_SORBIAN_GERMANY \
TT_MS_LANGID_UPPER_SORBIAN_GERMANY
#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA \
TT_MS_LANGID_SETSWANA_SOUTH_AFRICA
#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA \
TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA
#define TT_MS_LANGID_ZULU_SOUTH_AFRICA \
TT_MS_LANGID_ISIZULU_SOUTH_AFRICA
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043B
/* the next two values are incorrectly inverted */
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C
#define TT_MS_LANGID_YIDDISH_GERMANY 0x043D
#define TT_MS_LANGID_KAZAK_KAZAKSTAN \
TT_MS_LANGID_KAZAKH_KAZAKHSTAN
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \
TT_MS_LANGID_KYRGYZ_KYRGYZSTAN
#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN \
TT_MS_LANGID_KYRGYZ_KYRGYZSTAN
#define TT_MS_LANGID_SWAHILI_KENYA \
TT_MS_LANGID_KISWAHILI_KENYA
#define TT_MS_LANGID_TATAR_TATARSTAN \
TT_MS_LANGID_TATAR_RUSSIA
#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846
#define TT_MS_LANGID_ORIYA_INDIA \
TT_MS_LANGID_ODIA_INDIA
#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN \
TT_MS_LANGID_MONGOLIAN_PRC
#define TT_MS_LANGID_TIBETAN_CHINA \
TT_MS_LANGID_TIBETAN_PRC
#define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851
#define TT_MS_LANGID_TIBETAN_BHUTAN \
TT_MS_LANGID_DZONGHKA_BHUTAN
#define TT_MS_LANGID_WELSH_WALES \
TT_MS_LANGID_WELSH_UNITED_KINGDOM
#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455
#define TT_MS_LANGID_GALICIAN_SPAIN \
TT_MS_LANGID_GALICIAN_GALICIAN
#define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458 #define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458
#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459 #define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459
#define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859 #define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859
/* Missing a LCID for Sindhi in Devanagari script */ #define TT_MS_LANGID_SINHALESE_SRI_LANKA \
#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a TT_MS_LANGID_SINHALA_SRI_LANKA
#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b #define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C
#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c #define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F
#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d #define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN \
#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e TT_MS_LANGID_TAMAZIGHT_ALGERIA
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f
#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f
/* Missing a LCID for Tifinagh script */
#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460 #define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460
/* Spelled this way by XPsp2 Platform SDK (2004-07-26) */
/* script is yet unclear... might be Arabic, Nagari or Sharada */
#define TT_MS_LANGID_KASHMIRI_SASIA 0x0860 #define TT_MS_LANGID_KASHMIRI_SASIA 0x0860
/* ... and aliased (by MS) for compatibility reasons. */ #define TT_MS_LANGID_KASHMIRI_INDIA \
#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA TT_MS_LANGID_KASHMIRI_SASIA
#define TT_MS_LANGID_NEPALI_NEPAL 0x0461
#define TT_MS_LANGID_NEPALI_INDIA 0x0861 #define TT_MS_LANGID_NEPALI_INDIA 0x0861
#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 #define TT_MS_LANGID_DIVEHI_MALDIVES \
#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 TT_MS_LANGID_DHIVEHI_MALDIVES
#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464
#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465
/* alias declared in Windows 2000 */
#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES
#define TT_MS_LANGID_EDO_NIGERIA 0x0466 #define TT_MS_LANGID_EDO_NIGERIA 0x0466
#define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467 #define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467
#define TT_MS_LANGID_HAUSA_NIGERIA 0x0468
#define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469 #define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469
#define TT_MS_LANGID_YORUBA_NIGERIA 0x046a #define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA \
#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046b TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA
#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b
#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b
#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c
/* Also spelled by XPsp2 Platform SDK (2004-07-26) */
#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \ #define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \
TT_MS_LANGID_SEPEDI_SOUTH_AFRICA TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA
/* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */
#define TT_MS_LANGID_IGBO_NIGERIA 0x0470
#define TT_MS_LANGID_KANURI_NIGERIA 0x0471 #define TT_MS_LANGID_KANURI_NIGERIA 0x0471
#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472 #define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472
#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473 #define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473
#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873 #define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873
/* also spelled in the `Passport SDK' list as: */ #define TT_MS_LANGID_TIGRIGNA_ERYTREA \
#define TT_MS_LANGID_TIGRIGNA_ERYTREA TT_MS_LANGID_TIGRIGNA_ERYTHREA TT_MS_LANGID_TIGRIGNA_ERYTHREA
#define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474 #define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474
#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475 #define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475
#define TT_MS_LANGID_LATIN 0x0476 #define TT_MS_LANGID_LATIN 0x0476
#define TT_MS_LANGID_SOMALI_SOMALIA 0x0477 #define TT_MS_LANGID_SOMALI_SOMALIA 0x0477
/* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */ #define TT_MS_LANGID_YI_CHINA \
/* not written (but OTOH the peculiar writing system is worth */ TT_MS_LANGID_YI_PRC
/* studying). */
#define TT_MS_LANGID_YI_CHINA 0x0478
#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479 #define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479
/* language codes from 0x047a to 0x047f are (still) unknown. */ #define TT_MS_LANGID_UIGHUR_CHINA \
#define TT_MS_LANGID_UIGHUR_CHINA 0x0480 TT_MS_LANGID_UIGHUR_PRC
#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481
/**************************************************************************
*
* @enum:
* TT_NAME_ID_XXX
*
* @description:
* Possible values of the 'name' identifier field in the name records of
* an SFNT 'name' table. These values are platform independent.
*/
#if 0 /* not deemed useful for fonts */ #define TT_NAME_ID_COPYRIGHT 0
#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04ff #define TT_NAME_ID_FONT_FAMILY 1
#endif #define TT_NAME_ID_FONT_SUBFAMILY 2
#define TT_NAME_ID_UNIQUE_ID 3
#define TT_NAME_ID_FULL_NAME 4
/*************************************************************************/ #define TT_NAME_ID_VERSION_STRING 5
/* */ #define TT_NAME_ID_PS_NAME 6
/* Possible values of the `name' identifier field in the name records of */ #define TT_NAME_ID_TRADEMARK 7
/* the TTF `name' table. These values are platform independent. */
/* */
#define TT_NAME_ID_COPYRIGHT 0
#define TT_NAME_ID_FONT_FAMILY 1
#define TT_NAME_ID_FONT_SUBFAMILY 2
#define TT_NAME_ID_UNIQUE_ID 3
#define TT_NAME_ID_FULL_NAME 4
#define TT_NAME_ID_VERSION_STRING 5
#define TT_NAME_ID_PS_NAME 6
#define TT_NAME_ID_TRADEMARK 7
/* the following values are from the OpenType spec */ /* the following values are from the OpenType spec */
#define TT_NAME_ID_MANUFACTURER 8 #define TT_NAME_ID_MANUFACTURER 8
#define TT_NAME_ID_DESIGNER 9 #define TT_NAME_ID_DESIGNER 9
#define TT_NAME_ID_DESCRIPTION 10 #define TT_NAME_ID_DESCRIPTION 10
#define TT_NAME_ID_VENDOR_URL 11 #define TT_NAME_ID_VENDOR_URL 11
#define TT_NAME_ID_DESIGNER_URL 12 #define TT_NAME_ID_DESIGNER_URL 12
#define TT_NAME_ID_LICENSE 13 #define TT_NAME_ID_LICENSE 13
#define TT_NAME_ID_LICENSE_URL 14 #define TT_NAME_ID_LICENSE_URL 14
/* number 15 is reserved */ /* number 15 is reserved */
#define TT_NAME_ID_PREFERRED_FAMILY 16 #define TT_NAME_ID_TYPOGRAPHIC_FAMILY 16
#define TT_NAME_ID_PREFERRED_SUBFAMILY 17 #define TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY 17
#define TT_NAME_ID_MAC_FULL_NAME 18 #define TT_NAME_ID_MAC_FULL_NAME 18
/* The following code is new as of 2000-01-21 */ /* The following code is new as of 2000-01-21 */
#define TT_NAME_ID_SAMPLE_TEXT 19 #define TT_NAME_ID_SAMPLE_TEXT 19
/* This is new in OpenType 1.3 */ /* This is new in OpenType 1.3 */
#define TT_NAME_ID_CID_FINDFONT_NAME 20 #define TT_NAME_ID_CID_FINDFONT_NAME 20
/* This is new in OpenType 1.5 */
#define TT_NAME_ID_WWS_FAMILY 21
#define TT_NAME_ID_WWS_SUBFAMILY 22
/* This is new in OpenType 1.7 */
#define TT_NAME_ID_LIGHT_BACKGROUND 23
#define TT_NAME_ID_DARK_BACKGROUND 24
/*************************************************************************/ /* This is new in OpenType 1.8 */
/* */ #define TT_NAME_ID_VARIATIONS_PREFIX 25
/* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
/* */
/* Updated 02-Jul-2000. */
/* */
/* General Scripts Area */ /* these two values are deprecated */
#define TT_NAME_ID_PREFERRED_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY
#define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY
/**************************************************************************
*
* @enum:
* TT_UCR_XXX
*
* @description:
* Possible bit mask values for the `ulUnicodeRangeX` fields in an SFNT
* 'OS/2' table.
*/
/* ulUnicodeRange1 */
/* --------------- */
/* Bit 0 Basic Latin */ /* Bit 0 Basic Latin */
#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ #define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
...@@ -839,27 +855,44 @@ FT_BEGIN_HEADER ...@@ -839,27 +855,44 @@ FT_BEGIN_HEADER
#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ #define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
/* Bit 3 Latin Extended-B */ /* Bit 3 Latin Extended-B */
#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ #define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
/* Bit 4 IPA Extensions */ /* Bit 4 IPA Extensions */
/* Phonetic Extensions */
/* Phonetic Extensions Supplement */
#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ #define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
/* U+1D00-U+1D7F */
/* U+1D80-U+1DBF */
/* Bit 5 Spacing Modifier Letters */ /* Bit 5 Spacing Modifier Letters */
/* Modifier Tone Letters */
#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ #define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
/* Bit 6 Combining Diacritical Marks */ /* U+A700-U+A71F */
#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */ /* Bit 6 Combining Diacritical Marks */
/* Combining Diacritical Marks Supplement */
#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */
/* U+1DC0-U+1DFF */
/* Bit 7 Greek and Coptic */ /* Bit 7 Greek and Coptic */
#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ #define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
/* Bit 8 is reserved (was: Greek Symbols and Coptic) */ /* Bit 8 Coptic */
/* Bit 9 Cyrillic + */ #define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
/* Cyrillic Supplementary */ /* Bit 9 Cyrillic */
/* Cyrillic Supplement */
/* Cyrillic Extended-A */
/* Cyrillic Extended-B */
#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ #define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
/* U+0500-U+052F */ /* U+0500-U+052F */
/* U+2DE0-U+2DFF */
/* U+A640-U+A69F */
/* Bit 10 Armenian */ /* Bit 10 Armenian */
#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ #define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
/* Bit 11 Hebrew */ /* Bit 11 Hebrew */
#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ #define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
/* Bit 12 is reserved (was: Hebrew Extended) */ /* Bit 12 Vai */
/* Bit 13 Arabic */ #define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
/* Bit 13 Arabic */
/* Arabic Supplement */
#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ #define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
/* Bit 14 is reserved (was: Arabic Extended) */ /* U+0750-U+077F */
/* Bit 14 NKo */
#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
/* Bit 15 Devanagari */ /* Bit 15 Devanagari */
#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ #define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
/* Bit 16 Bengali */ /* Bit 16 Bengali */
...@@ -882,40 +915,53 @@ FT_BEGIN_HEADER ...@@ -882,40 +915,53 @@ FT_BEGIN_HEADER
#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ #define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
/* Bit 25 Lao */ /* Bit 25 Lao */
#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ #define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
/* Bit 26 Georgian */ /* Bit 26 Georgian */
/* Georgian Supplement */
#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ #define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
/* Bit 27 is reserved (was Georgian Extended) */ /* U+2D00-U+2D2F */
/* Bit 27 Balinese */
#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
/* Bit 28 Hangul Jamo */ /* Bit 28 Hangul Jamo */
#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ #define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
/* Bit 29 Latin Extended Additional */ /* Bit 29 Latin Extended Additional */
/* Latin Extended-C */
/* Latin Extended-D */
#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ #define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
/* U+2C60-U+2C7F */
/* U+A720-U+A7FF */
/* Bit 30 Greek Extended */ /* Bit 30 Greek Extended */
#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ #define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
/* Bit 31 General Punctuation */
/* Supplemental Punctuation */
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
/* U+2E00-U+2E7F */
/* Symbols Area */ /* ulUnicodeRange2 */
/* --------------- */
/* Bit 31 General Punctuation */
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
/* Bit 32 Superscripts And Subscripts */ /* Bit 32 Superscripts And Subscripts */
#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ #define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
/* Bit 33 Currency Symbols */ /* Bit 33 Currency Symbols */
#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ #define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
/* Bit 34 Combining Diacritical Marks For Symbols */ /* Bit 34 Combining Diacritical Marks For Symbols */
#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */ #define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
(1L << 2) /* U+20D0-U+20FF */
/* Bit 35 Letterlike Symbols */ /* Bit 35 Letterlike Symbols */
#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ #define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
/* Bit 36 Number Forms */ /* Bit 36 Number Forms */
#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ #define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
/* Bit 37 Arrows + */ /* Bit 37 Arrows */
/* Supplemental Arrows-A + */ /* Supplemental Arrows-A */
/* Supplemental Arrows-B */ /* Supplemental Arrows-B */
/* Miscellaneous Symbols and Arrows */
#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ #define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
/* U+27F0-U+27FF */ /* U+27F0-U+27FF */
/* U+2900-U+297F */ /* U+2900-U+297F */
/* Bit 38 Mathematical Operators + */ /* U+2B00-U+2BFF */
/* Supplemental Mathematical Operators + */ /* Bit 38 Mathematical Operators */
/* Miscellaneous Mathematical Symbols-A + */ /* Supplemental Mathematical Operators */
/* Miscellaneous Mathematical Symbols-B */ /* Miscellaneous Mathematical Symbols-A */
/* Miscellaneous Mathematical Symbols-B */
#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ #define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
/* U+2A00-U+2AFF */ /* U+2A00-U+2AFF */
/* U+27C0-U+27EF */ /* U+27C0-U+27EF */
...@@ -938,60 +984,53 @@ FT_BEGIN_HEADER ...@@ -938,60 +984,53 @@ FT_BEGIN_HEADER
#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ #define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
/* Bit 47 Dingbats */ /* Bit 47 Dingbats */
#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ #define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
/* CJK Phonetics and Symbols Area */
/* Bit 48 CJK Symbols and Punctuation */ /* Bit 48 CJK Symbols and Punctuation */
#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ #define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
/* Bit 49 Hiragana */ /* Bit 49 Hiragana */
#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ #define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
/* Bit 50 Katakana + */ /* Bit 50 Katakana */
/* Katakana Phonetic Extensions */ /* Katakana Phonetic Extensions */
#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ #define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
/* U+31F0-U+31FF */ /* U+31F0-U+31FF */
/* Bit 51 Bopomofo + */ /* Bit 51 Bopomofo */
/* Bopomofo Extended */ /* Bopomofo Extended */
#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ #define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
/* U+31A0-U+31BF */ /* U+31A0-U+31BF */
/* Bit 52 Hangul Compatibility Jamo */ /* Bit 52 Hangul Compatibility Jamo */
#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ #define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
/* Bit 53 Kanbun */ /* Bit 53 Phags-Pa */
#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */ #define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
#define TT_UCR_KANBUN TT_UCR_CJK_MISC #define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
#define TT_UCR_PHAGSPA
/* Bit 54 Enclosed CJK Letters and Months */ /* Bit 54 Enclosed CJK Letters and Months */
#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ #define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
/* Bit 55 CJK Compatibility */ /* Bit 55 CJK Compatibility */
#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ #define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
/* Bit 56 Hangul Syllables */
/* Hangul Syllables Area */
/* Bit 56 Hangul */
#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ #define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
/* Bit 57 High Surrogates */
/* Surrogates Area */ /* High Private Use Surrogates */
/* Low Surrogates */
/* Bit 57 High Surrogates + */
/* High Private Use Surrogates + */ /* According to OpenType specs v.1.3+, */
/* Low Surrogates */ /* setting bit 57 implies that there is */
/* at least one codepoint beyond the */
/* Basic Multilingual Plane that is */
/* supported by this font. So it really */
/* means >= U+10000. */
#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ #define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
/* U+DB80-U+DBFF */ /* U+DB80-U+DBFF */
/* U+DC00-U+DFFF */ /* U+DC00-U+DFFF */
/* According to OpenType specs v.1.3+, setting bit 57 implies that there */ #define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
/* is at least one codepoint beyond the Basic Multilingual Plane that is */ /* Bit 58 Phoenician */
/* supported by this font. So it really means: >= U+10000 */ #define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
/* Bit 59 CJK Unified Ideographs */
/* Bit 58 is reserved for Unicode SubRanges */ /* CJK Radicals Supplement */
/* Kangxi Radicals */
/* CJK Ideographs Area */ /* Ideographic Description Characters */
/* CJK Unified Ideographs Extension A */
/* Bit 59 CJK Unified Ideographs + */ /* CJK Unified Ideographs Extension B */
/* CJK Radicals Supplement + */ /* Kanbun */
/* Kangxi Radicals + */
/* Ideographic Description Characters + */
/* CJK Unified Ideographs Extension A */
/* CJK Unified Ideographs Extension A + */
/* CJK Unified Ideographs Extension B + */
/* Kanbun */
#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ #define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
/* U+2E80-U+2EFF */ /* U+2E80-U+2EFF */
/* U+2F00-U+2FDF */ /* U+2F00-U+2FDF */
...@@ -999,30 +1038,32 @@ FT_BEGIN_HEADER ...@@ -999,30 +1038,32 @@ FT_BEGIN_HEADER
/* U+3400-U+4DB5 */ /* U+3400-U+4DB5 */
/*U+20000-U+2A6DF*/ /*U+20000-U+2A6DF*/
/* U+3190-U+319F */ /* U+3190-U+319F */
/* Private Use Area */
/* Bit 60 Private Use */ /* Bit 60 Private Use */
#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ #define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
/* Bit 61 CJK Strokes */
/* Compatibility Area and Specials */ /* CJK Compatibility Ideographs */
/* CJK Compatibility Ideographs Supplement */
/* Bit 61 CJK Compatibility Ideographs + */ #define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
/* CJK Compatibility Ideographs Supplement */ /* U+F900-U+FAFF */
#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */
/*U+2F800-U+2FA1F*/ /*U+2F800-U+2FA1F*/
/* Bit 62 Alphabetic Presentation Forms */ /* Bit 62 Alphabetic Presentation Forms */
#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ #define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
/* Bit 63 Arabic Presentation Forms-A */ /* Bit 63 Arabic Presentation Forms-A */
#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */ #define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */
/* ulUnicodeRange3 */
/* --------------- */
/* Bit 64 Combining Half Marks */ /* Bit 64 Combining Half Marks */
#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ #define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
/* Bit 65 CJK Compatibility Forms */ /* Bit 65 Vertical forms */
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */ /* CJK Compatibility Forms */
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
/* U+FE30-U+FE4F */
/* Bit 66 Small Form Variants */ /* Bit 66 Small Form Variants */
#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ #define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
/* Bit 67 Arabic Presentation Forms-B */ /* Bit 67 Arabic Presentation Forms-B */
#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */ #define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */
/* Bit 68 Halfwidth and Fullwidth Forms */ /* Bit 68 Halfwidth and Fullwidth Forms */
#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ #define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
/* Bit 69 Specials */ /* Bit 69 Specials */
...@@ -1037,8 +1078,12 @@ FT_BEGIN_HEADER ...@@ -1037,8 +1078,12 @@ FT_BEGIN_HEADER
#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ #define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
/* Bit 74 Myanmar */ /* Bit 74 Myanmar */
#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ #define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
/* Bit 75 Ethiopic */ /* Bit 75 Ethiopic */
/* Ethiopic Supplement */
/* Ethiopic Extended */
#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ #define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
/* U+1380-U+139F */
/* U+2D80-U+2DDF */
/* Bit 76 Cherokee */ /* Bit 76 Cherokee */
#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ #define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
/* Bit 77 Unified Canadian Aboriginal Syllabics */ /* Bit 77 Unified Canadian Aboriginal Syllabics */
...@@ -1047,20 +1092,22 @@ FT_BEGIN_HEADER ...@@ -1047,20 +1092,22 @@ FT_BEGIN_HEADER
#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ #define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
/* Bit 79 Runic */ /* Bit 79 Runic */
#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ #define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
/* Bit 80 Khmer */ /* Bit 80 Khmer */
/* Khmer Symbols */
#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ #define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
/* U+19E0-U+19FF */
/* Bit 81 Mongolian */ /* Bit 81 Mongolian */
#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ #define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
/* Bit 82 Braille Patterns */ /* Bit 82 Braille Patterns */
#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ #define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
/* Bit 83 Yi Syllables + */ /* Bit 83 Yi Syllables */
/* Yi Radicals */ /* Yi Radicals */
#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ #define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
/* U+A490-U+A4CF */ /* U+A490-U+A4CF */
/* Bit 84 Tagalog + */ /* Bit 84 Tagalog */
/* Hanunoo + */ /* Hanunoo */
/* Buhid + */ /* Buhid */
/* Tagbanwa */ /* Tagbanwa */
#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ #define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
/* U+1720-U+173F */ /* U+1720-U+173F */
/* U+1740-U+175F */ /* U+1740-U+175F */
...@@ -1071,62 +1118,119 @@ FT_BEGIN_HEADER ...@@ -1071,62 +1118,119 @@ FT_BEGIN_HEADER
#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ #define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
/* Bit 87 Deseret */ /* Bit 87 Deseret */
#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ #define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
/* Bit 88 Byzantine Musical Symbols + */ /* Bit 88 Byzantine Musical Symbols */
/* Musical Symbols */ /* Musical Symbols */
/* Ancient Greek Musical Notation */
#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ #define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
/*U+1D100-U+1D1FF*/ /*U+1D100-U+1D1FF*/
/*U+1D200-U+1D24F*/
/* Bit 89 Mathematical Alphanumeric Symbols */ /* Bit 89 Mathematical Alphanumeric Symbols */
#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ #define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
/* Bit 90 Private Use (plane 15) + */ /* Bit 90 Private Use (plane 15) */
/* Private Use (plane 16) */ /* Private Use (plane 16) */
#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ #define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
/*U+100000-U+10FFFD*/ /*U+100000-U+10FFFD*/
/* Bit 91 Variation Selectors */ /* Bit 91 Variation Selectors */
/* Variation Selectors Supplement */
#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ #define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
/*U+E0100-U+E01EF*/
/* Bit 92 Tags */ /* Bit 92 Tags */
#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ #define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
/* Bit 93 Limbu */
#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
/*************************************************************************/ /* Bit 94 Tai Le */
/* */ #define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
/* Some compilers have a very limited length of identifiers. */ /* Bit 95 New Tai Lue */
/* */ #define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
#define HAVE_LIMIT_ON_IDENTS /* ulUnicodeRange4 */
#endif /* --------------- */
/* Bit 96 Buginese */
#ifndef HAVE_LIMIT_ON_IDENTS #define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
/* Bit 97 Glagolitic */
#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
/*************************************************************************/ /* Bit 98 Tifinagh */
/* */ #define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
/* Here some alias #defines in order to be clearer. */ /* Bit 99 Yijing Hexagram Symbols */
/* */ #define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
/* These are not always #defined to stay within the 31 character limit */ /* Bit 100 Syloti Nagri */
/* which some compilers have. */ #define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
/* */ /* Bit 101 Linear B Syllabary */
/* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern */ /* Linear B Ideograms */
/* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */ /* Aegean Numbers */
/* If you get a warning with such a compiler, use the -i40 switch. */ #define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
/* */ /*U+10080-U+100FF*/
#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \ /*U+10100-U+1013F*/
TT_UCR_ARABIC_PRESENTATIONS_A /* Bit 102 Ancient Greek Numbers */
#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \ #define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
TT_UCR_ARABIC_PRESENTATIONS_B /* Bit 103 Ugaritic */
#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
#define TT_UCR_COMBINING_DIACRITICAL_MARKS \ /* Bit 104 Old Persian */
TT_UCR_COMBINING_DIACRITICS #define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \ /* Bit 105 Shavian */
TT_UCR_COMBINING_DIACRITICS_SYMB #define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
/* Bit 106 Osmanya */
#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
#endif /* !HAVE_LIMIT_ON_IDENTS */ /* Bit 107 Cypriot Syllabary */
#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
/* Bit 108 Kharoshthi */
#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
/* Bit 109 Tai Xuan Jing Symbols */
#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
/* Bit 110 Cuneiform */
/* Cuneiform Numbers and Punctuation */
#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
/*U+12400-U+1247F*/
/* Bit 111 Counting Rod Numerals */
#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
/* Bit 112 Sundanese */
#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
/* Bit 113 Lepcha */
#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
/* Bit 114 Ol Chiki */
#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
/* Bit 115 Saurashtra */
#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
/* Bit 116 Kayah Li */
#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
/* Bit 117 Rejang */
#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
/* Bit 118 Cham */
#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
/* Bit 119 Ancient Symbols */
#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
/* Bit 120 Phaistos Disc */
#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
/* Bit 121 Carian */
/* Lycian */
/* Lydian */
#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
/*U+10280-U+1029F*/
/*U+10920-U+1093F*/
/* Bit 122 Domino Tiles */
/* Mahjong Tiles */
#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
/*U+1F000-U+1F02F*/
/* Bit 123-127 Reserved for process-internal usage */
/* */
/* for backward compatibility with older FreeType versions */
#define TT_UCR_ARABIC_PRESENTATION_A \
TT_UCR_ARABIC_PRESENTATION_FORMS_A
#define TT_UCR_ARABIC_PRESENTATION_B \
TT_UCR_ARABIC_PRESENTATION_FORMS_B
#define TT_UCR_COMBINING_DIACRITICS \
TT_UCR_COMBINING_DIACRITICAL_MARKS
#define TT_UCR_COMBINING_DIACRITICS_SYMB \
TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB
FT_END_HEADER FT_END_HEADER
#endif /* __TTNAMEID_H__ */ #endif /* TTNAMEID_H_ */
/* END */ /* END */
/****************************************************************************
*
* tttables.h
*
* Basic SFNT/TrueType tables definitions and interface
* (specification only).
*
* Copyright (C) 1996-2019 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 TTTABLES_H_
#define TTTABLES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* truetype_tables
*
* @title:
* TrueType Tables
*
* @abstract:
* TrueType-specific table types and functions.
*
* @description:
* This section contains definitions of some basic tables specific to
* TrueType and OpenType as well as some routines used to access and
* process them.
*
* @order:
* TT_Header
* TT_HoriHeader
* TT_VertHeader
* TT_OS2
* TT_Postscript
* TT_PCLT
* TT_MaxProfile
*
* FT_Sfnt_Tag
* FT_Get_Sfnt_Table
* FT_Load_Sfnt_Table
* FT_Sfnt_Table_Info
*
* FT_Get_CMap_Language_ID
* FT_Get_CMap_Format
*
* FT_PARAM_TAG_UNPATENTED_HINTING
*
*/
/**************************************************************************
*
* @struct:
* TT_Header
*
* @description:
* A structure to model a TrueType font header table. All fields follow
* the OpenType specification. The 64-bit timestamps are stored in
* two-element arrays `Created` and `Modified`, first the upper then
* the lower 32~bits.
*/
typedef struct TT_Header_
{
FT_Fixed Table_Version;
FT_Fixed Font_Revision;
FT_Long CheckSum_Adjust;
FT_Long Magic_Number;
FT_UShort Flags;
FT_UShort Units_Per_EM;
FT_ULong Created [2];
FT_ULong Modified[2];
FT_Short xMin;
FT_Short yMin;
FT_Short xMax;
FT_Short yMax;
FT_UShort Mac_Style;
FT_UShort Lowest_Rec_PPEM;
FT_Short Font_Direction;
FT_Short Index_To_Loc_Format;
FT_Short Glyph_Data_Format;
} TT_Header;
/**************************************************************************
*
* @struct:
* TT_HoriHeader
*
* @description:
* A structure to model a TrueType horizontal header, the 'hhea' table,
* as well as the corresponding horizontal metrics table, 'hmtx'.
*
* @fields:
* Version ::
* The table version.
*
* Ascender ::
* The font's ascender, i.e., the distance from the baseline to the
* top-most of all glyph points found in the font.
*
* This value is invalid in many fonts, as it is usually set by the
* font designer, and often reflects only a portion of the glyphs found
* in the font (maybe ASCII).
*
* You should use the `sTypoAscender` field of the 'OS/2' table instead
* if you want the correct one.
*
* Descender ::
* The font's descender, i.e., the distance from the baseline to the
* bottom-most of all glyph points found in the font. It is negative.
*
* This value is invalid in many fonts, as it is usually set by the
* font designer, and often reflects only a portion of the glyphs found
* in the font (maybe ASCII).
*
* You should use the `sTypoDescender` field of the 'OS/2' table
* instead if you want the correct one.
*
* Line_Gap ::
* The font's line gap, i.e., the distance to add to the ascender and
* descender to get the BTB, i.e., the baseline-to-baseline distance
* for the font.
*
* advance_Width_Max ::
* This field is the maximum of all advance widths found in the font.
* It can be used to compute the maximum width of an arbitrary string
* of text.
*
* min_Left_Side_Bearing ::
* The minimum left side bearing of all glyphs within the font.
*
* min_Right_Side_Bearing ::
* The minimum right side bearing of all glyphs within the font.
*
* xMax_Extent ::
* The maximum horizontal extent (i.e., the 'width' of a glyph's
* bounding box) for all glyphs in the font.
*
* caret_Slope_Rise ::
* The rise coefficient of the cursor's slope of the cursor
* (slope=rise/run).
*
* caret_Slope_Run ::
* The run coefficient of the cursor's slope.
*
* caret_Offset ::
* The cursor's offset for slanted fonts.
*
* Reserved ::
* 8~reserved bytes.
*
* metric_Data_Format ::
* Always~0.
*
* number_Of_HMetrics ::
* Number of HMetrics entries in the 'hmtx' table -- this value can be
* smaller than the total number of glyphs in the font.
*
* long_metrics ::
* A pointer into the 'hmtx' table.
*
* short_metrics ::
* A pointer into the 'hmtx' table.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `caret_Slope_Rise`,
* `caret_Slope_Run`, and `caret_Offset`.
*/
typedef struct TT_HoriHeader_
{
FT_Fixed Version;
FT_Short Ascender;
FT_Short Descender;
FT_Short Line_Gap;
FT_UShort advance_Width_Max; /* advance width maximum */
FT_Short min_Left_Side_Bearing; /* minimum left-sb */
FT_Short min_Right_Side_Bearing; /* minimum right-sb */
FT_Short xMax_Extent; /* xmax extents */
FT_Short caret_Slope_Rise;
FT_Short caret_Slope_Run;
FT_Short caret_Offset;
FT_Short Reserved[4];
FT_Short metric_Data_Format;
FT_UShort number_Of_HMetrics;
/* The following fields are not defined by the OpenType specification */
/* but they are used to connect the metrics header to the relevant */
/* 'hmtx' table. */
void* long_metrics;
void* short_metrics;
} TT_HoriHeader;
/**************************************************************************
*
* @struct:
* TT_VertHeader
*
* @description:
* A structure used to model a TrueType vertical header, the 'vhea'
* table, as well as the corresponding vertical metrics table, 'vmtx'.
*
* @fields:
* Version ::
* The table version.
*
* Ascender ::
* The font's ascender, i.e., the distance from the baseline to the
* top-most of all glyph points found in the font.
*
* This value is invalid in many fonts, as it is usually set by the
* font designer, and often reflects only a portion of the glyphs found
* in the font (maybe ASCII).
*
* You should use the `sTypoAscender` field of the 'OS/2' table instead
* if you want the correct one.
*
* Descender ::
* The font's descender, i.e., the distance from the baseline to the
* bottom-most of all glyph points found in the font. It is negative.
*
* This value is invalid in many fonts, as it is usually set by the
* font designer, and often reflects only a portion of the glyphs found
* in the font (maybe ASCII).
*
* You should use the `sTypoDescender` field of the 'OS/2' table
* instead if you want the correct one.
*
* Line_Gap ::
* The font's line gap, i.e., the distance to add to the ascender and
* descender to get the BTB, i.e., the baseline-to-baseline distance
* for the font.
*
* advance_Height_Max ::
* This field is the maximum of all advance heights found in the font.
* It can be used to compute the maximum height of an arbitrary string
* of text.
*
* min_Top_Side_Bearing ::
* The minimum top side bearing of all glyphs within the font.
*
* min_Bottom_Side_Bearing ::
* The minimum bottom side bearing of all glyphs within the font.
*
* yMax_Extent ::
* The maximum vertical extent (i.e., the 'height' of a glyph's
* bounding box) for all glyphs in the font.
*
* caret_Slope_Rise ::
* The rise coefficient of the cursor's slope of the cursor
* (slope=rise/run).
*
* caret_Slope_Run ::
* The run coefficient of the cursor's slope.
*
* caret_Offset ::
* The cursor's offset for slanted fonts.
*
* Reserved ::
* 8~reserved bytes.
*
* metric_Data_Format ::
* Always~0.
*
* number_Of_VMetrics ::
* Number of VMetrics entries in the 'vmtx' table -- this value can be
* smaller than the total number of glyphs in the font.
*
* long_metrics ::
* A pointer into the 'vmtx' table.
*
* short_metrics ::
* A pointer into the 'vmtx' table.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `Ascender`, `Descender`,
* `Line_Gap`, `caret_Slope_Rise`, `caret_Slope_Run`, and `caret_Offset`.
*/
typedef struct TT_VertHeader_
{
FT_Fixed Version;
FT_Short Ascender;
FT_Short Descender;
FT_Short Line_Gap;
FT_UShort advance_Height_Max; /* advance height maximum */
FT_Short min_Top_Side_Bearing; /* minimum top-sb */
FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */
FT_Short yMax_Extent; /* ymax extents */
FT_Short caret_Slope_Rise;
FT_Short caret_Slope_Run;
FT_Short caret_Offset;
FT_Short Reserved[4];
FT_Short metric_Data_Format;
FT_UShort number_Of_VMetrics;
/* The following fields are not defined by the OpenType specification */
/* but they are used to connect the metrics header to the relevant */
/* 'vmtx' table. */
void* long_metrics;
void* short_metrics;
} TT_VertHeader;
/**************************************************************************
*
* @struct:
* TT_OS2
*
* @description:
* A structure to model a TrueType 'OS/2' table. All fields comply to
* the OpenType specification.
*
* Note that we now support old Mac fonts that do not include an 'OS/2'
* table. In this case, the `version` field is always set to 0xFFFF.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `sCapHeight`, `sTypoAscender`,
* `sTypoDescender`, `sTypoLineGap`, `sxHeight`, `usWinAscent`,
* `usWinDescent`, `yStrikeoutPosition`, `yStrikeoutSize`,
* `ySubscriptXOffset`, `ySubScriptXSize`, `ySubscriptYOffset`,
* `ySubscriptYSize`, `ySuperscriptXOffset`, `ySuperscriptXSize`,
* `ySuperscriptYOffset`, and `ySuperscriptYSize`.
*
* Possible values for bits in the `ulUnicodeRangeX` fields are given by
* the @TT_UCR_XXX macros.
*/
typedef struct TT_OS2_
{
FT_UShort version; /* 0x0001 - more or 0xFFFF */
FT_Short xAvgCharWidth;
FT_UShort usWeightClass;
FT_UShort usWidthClass;
FT_UShort fsType;
FT_Short ySubscriptXSize;
FT_Short ySubscriptYSize;
FT_Short ySubscriptXOffset;
FT_Short ySubscriptYOffset;
FT_Short ySuperscriptXSize;
FT_Short ySuperscriptYSize;
FT_Short ySuperscriptXOffset;
FT_Short ySuperscriptYOffset;
FT_Short yStrikeoutSize;
FT_Short yStrikeoutPosition;
FT_Short sFamilyClass;
FT_Byte panose[10];
FT_ULong ulUnicodeRange1; /* Bits 0-31 */
FT_ULong ulUnicodeRange2; /* Bits 32-63 */
FT_ULong ulUnicodeRange3; /* Bits 64-95 */
FT_ULong ulUnicodeRange4; /* Bits 96-127 */
FT_Char achVendID[4];
FT_UShort fsSelection;
FT_UShort usFirstCharIndex;
FT_UShort usLastCharIndex;
FT_Short sTypoAscender;
FT_Short sTypoDescender;
FT_Short sTypoLineGap;
FT_UShort usWinAscent;
FT_UShort usWinDescent;
/* only version 1 and higher: */
FT_ULong ulCodePageRange1; /* Bits 0-31 */
FT_ULong ulCodePageRange2; /* Bits 32-63 */
/* only version 2 and higher: */
FT_Short sxHeight;
FT_Short sCapHeight;
FT_UShort usDefaultChar;
FT_UShort usBreakChar;
FT_UShort usMaxContext;
/* only version 5 and higher: */
FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
} TT_OS2;
/**************************************************************************
*
* @struct:
* TT_Postscript
*
* @description:
* A structure to model a TrueType 'post' table. All fields comply to
* the OpenType specification. This structure does not reference a
* font's PostScript glyph names; use @FT_Get_Glyph_Name to retrieve
* them.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `underlinePosition` and
* `underlineThickness`.
*/
typedef struct TT_Postscript_
{
FT_Fixed FormatType;
FT_Fixed italicAngle;
FT_Short underlinePosition;
FT_Short underlineThickness;
FT_ULong isFixedPitch;
FT_ULong minMemType42;
FT_ULong maxMemType42;
FT_ULong minMemType1;
FT_ULong maxMemType1;
/* Glyph names follow in the 'post' table, but we don't */
/* load them by default. */
} TT_Postscript;
/**************************************************************************
*
* @struct:
* TT_PCLT
*
* @description:
* A structure to model a TrueType 'PCLT' table. All fields comply to
* the OpenType specification.
*/
typedef struct TT_PCLT_
{
FT_Fixed Version;
FT_ULong FontNumber;
FT_UShort Pitch;
FT_UShort xHeight;
FT_UShort Style;
FT_UShort TypeFamily;
FT_UShort CapHeight;
FT_UShort SymbolSet;
FT_Char TypeFace[16];
FT_Char CharacterComplement[8];
FT_Char FileName[6];
FT_Char StrokeWeight;
FT_Char WidthType;
FT_Byte SerifStyle;
FT_Byte Reserved;
} TT_PCLT;
/**************************************************************************
*
* @struct:
* TT_MaxProfile
*
* @description:
* The maximum profile ('maxp') table contains many max values, which can
* be used to pre-allocate arrays for speeding up glyph loading and
* hinting.
*
* @fields:
* version ::
* The version number.
*
* numGlyphs ::
* The number of glyphs in this TrueType font.
*
* maxPoints ::
* The maximum number of points in a non-composite TrueType glyph. See
* also `maxCompositePoints`.
*
* maxContours ::
* The maximum number of contours in a non-composite TrueType glyph.
* See also `maxCompositeContours`.
*
* maxCompositePoints ::
* The maximum number of points in a composite TrueType glyph. See
* also `maxPoints`.
*
* maxCompositeContours ::
* The maximum number of contours in a composite TrueType glyph. See
* also `maxContours`.
*
* maxZones ::
* The maximum number of zones used for glyph hinting.
*
* maxTwilightPoints ::
* The maximum number of points in the twilight zone used for glyph
* hinting.
*
* maxStorage ::
* The maximum number of elements in the storage area used for glyph
* hinting.
*
* maxFunctionDefs ::
* The maximum number of function definitions in the TrueType bytecode
* for this font.
*
* maxInstructionDefs ::
* The maximum number of instruction definitions in the TrueType
* bytecode for this font.
*
* maxStackElements ::
* The maximum number of stack elements used during bytecode
* interpretation.
*
* maxSizeOfInstructions ::
* The maximum number of TrueType opcodes used for glyph hinting.
*
* maxComponentElements ::
* The maximum number of simple (i.e., non-composite) glyphs in a
* composite glyph.
*
* maxComponentDepth ::
* The maximum nesting depth of composite glyphs.
*
* @note:
* This structure is only used during font loading.
*/
typedef struct TT_MaxProfile_
{
FT_Fixed version;
FT_UShort numGlyphs;
FT_UShort maxPoints;
FT_UShort maxContours;
FT_UShort maxCompositePoints;
FT_UShort maxCompositeContours;
FT_UShort maxZones;
FT_UShort maxTwilightPoints;
FT_UShort maxStorage;
FT_UShort maxFunctionDefs;
FT_UShort maxInstructionDefs;
FT_UShort maxStackElements;
FT_UShort maxSizeOfInstructions;
FT_UShort maxComponentElements;
FT_UShort maxComponentDepth;
} TT_MaxProfile;
/**************************************************************************
*
* @enum:
* FT_Sfnt_Tag
*
* @description:
* An enumeration to specify indices of SFNT tables loaded and parsed by
* FreeType during initialization of an SFNT font. Used in the
* @FT_Get_Sfnt_Table API function.
*
* @values:
* FT_SFNT_HEAD ::
* To access the font's @TT_Header structure.
*
* FT_SFNT_MAXP ::
* To access the font's @TT_MaxProfile structure.
*
* FT_SFNT_OS2 ::
* To access the font's @TT_OS2 structure.
*
* FT_SFNT_HHEA ::
* To access the font's @TT_HoriHeader structure.
*
* FT_SFNT_VHEA ::
* To access the font's @TT_VertHeader structure.
*
* FT_SFNT_POST ::
* To access the font's @TT_Postscript structure.
*
* FT_SFNT_PCLT ::
* To access the font's @TT_PCLT structure.
*/
typedef enum FT_Sfnt_Tag_
{
FT_SFNT_HEAD,
FT_SFNT_MAXP,
FT_SFNT_OS2,
FT_SFNT_HHEA,
FT_SFNT_VHEA,
FT_SFNT_POST,
FT_SFNT_PCLT,
FT_SFNT_MAX
} FT_Sfnt_Tag;
/* these constants are deprecated; use the corresponding `FT_Sfnt_Tag` */
/* values instead */
#define ft_sfnt_head FT_SFNT_HEAD
#define ft_sfnt_maxp FT_SFNT_MAXP
#define ft_sfnt_os2 FT_SFNT_OS2
#define ft_sfnt_hhea FT_SFNT_HHEA
#define ft_sfnt_vhea FT_SFNT_VHEA
#define ft_sfnt_post FT_SFNT_POST
#define ft_sfnt_pclt FT_SFNT_PCLT
/**************************************************************************
*
* @function:
* FT_Get_Sfnt_Table
*
* @description:
* Return a pointer to a given SFNT table stored within a face.
*
* @input:
* face ::
* A handle to the source.
*
* tag ::
* The index of the SFNT table.
*
* @return:
* A type-less pointer to the table. This will be `NULL` in case of
* error, or if the corresponding table was not found **OR** loaded from
* the file.
*
* Use a typecast according to `tag` to access the structure elements.
*
* @note:
* The table is owned by the face object and disappears with it.
*
* This function is only useful to access SFNT tables that are loaded by
* the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for a
* list.
*
* @example:
* Here is an example demonstrating access to the 'vhea' table.
*
* ```
* TT_VertHeader* vert_header;
*
*
* vert_header =
* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA );
* ```
*/
FT_EXPORT( void* )
FT_Get_Sfnt_Table( FT_Face face,
FT_Sfnt_Tag tag );
/**************************************************************************
*
* @function:
* FT_Load_Sfnt_Table
*
* @description:
* Load any SFNT font table into client memory.
*
* @input:
* face ::
* A handle to the source face.
*
* tag ::
* The four-byte tag of the table to load. Use value~0 if you want to
* access the whole font file. Otherwise, you can use one of the
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
* one with @FT_MAKE_TAG.
*
* offset ::
* The starting offset in the table (or file if tag~==~0).
*
* @output:
* buffer ::
* The target buffer address. The client must ensure that the memory
* array is big enough to hold the data.
*
* @inout:
* length ::
* If the `length` parameter is `NULL`, try to load the whole table.
* Return an error code if it fails.
*
* Else, if `*length` is~0, exit immediately while returning the
* table's (or file) full size in it.
*
* Else the number of bytes to read from the table or file, from the
* starting offset.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If you need to determine the table's length you should first call this
* function with `*length` set to~0, as in the following example:
*
* ```
* FT_ULong length = 0;
*
*
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
* if ( error ) { ... table does not exist ... }
*
* buffer = malloc( length );
* if ( buffer == NULL ) { ... not enough memory ... }
*
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
* if ( error ) { ... could not load table ... }
* ```
*
* Note that structures like @TT_Header or @TT_OS2 can't be used with
* this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
* those structures depend on the processor architecture, with varying
* size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
*
*/
FT_EXPORT( FT_Error )
FT_Load_Sfnt_Table( FT_Face face,
FT_ULong tag,
FT_Long offset,
FT_Byte* buffer,
FT_ULong* length );
/**************************************************************************
*
* @function:
* FT_Sfnt_Table_Info
*
* @description:
* Return information on an SFNT table.
*
* @input:
* face ::
* A handle to the source face.
*
* table_index ::
* The index of an SFNT table. The function returns
* FT_Err_Table_Missing for an invalid value.
*
* @inout:
* tag ::
* The name tag of the SFNT table. If the value is `NULL`,
* `table_index` is ignored, and `length` returns the number of SFNT
* tables in the font.
*
* @output:
* length ::
* The length of the SFNT table (or the number of SFNT tables,
* depending on `tag`).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* While parsing fonts, FreeType handles SFNT tables with length zero as
* missing.
*
*/
FT_EXPORT( FT_Error )
FT_Sfnt_Table_Info( FT_Face face,
FT_UInt table_index,
FT_ULong *tag,
FT_ULong *length );
/**************************************************************************
*
* @function:
* FT_Get_CMap_Language_ID
*
* @description:
* Return cmap language ID as specified in the OpenType standard.
* Definitions of language ID values are in file @FT_TRUETYPE_IDS_H.
*
* @input:
* charmap ::
* The target charmap.
*
* @return:
* The language ID of `charmap`. If `charmap` doesn't belong to an SFNT
* face, just return~0 as the default value.
*
* For a format~14 cmap (to access Unicode IVS), the return value is
* 0xFFFFFFFF.
*/
FT_EXPORT( FT_ULong )
FT_Get_CMap_Language_ID( FT_CharMap charmap );
/**************************************************************************
*
* @function:
* FT_Get_CMap_Format
*
* @description:
* Return the format of an SFNT 'cmap' table.
*
* @input:
* charmap ::
* The target charmap.
*
* @return:
* The format of `charmap`. If `charmap` doesn't belong to an SFNT face,
* return -1.
*/
FT_EXPORT( FT_Long )
FT_Get_CMap_Format( FT_CharMap charmap );
/* */
FT_END_HEADER
#endif /* TTTABLES_H_ */
/* END */
/***************************************************************************/ /****************************************************************************
/* */ *
/* tttags.h */ * tttags.h
/* */ *
/* Tags for TrueType and OpenType tables (specification only). */ * Tags for TrueType and OpenType tables (specification only).
/* */ *
/* Copyright 1996-2001, 2004, 2005 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef __TTAGS_H__ #ifndef TTAGS_H_
#define __TTAGS_H__ #define TTAGS_H_
#include <ft2build.h> #include <ft2build.h>
...@@ -40,8 +40,14 @@ FT_BEGIN_HEADER ...@@ -40,8 +40,14 @@ FT_BEGIN_HEADER
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) #define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) #define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) #define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_COLR FT_MAKE_TAG( 'C', 'O', 'L', 'R' )
#define TTAG_CPAL FT_MAKE_TAG( 'C', 'P', 'A', 'L' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) #define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) #define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
...@@ -49,6 +55,7 @@ FT_BEGIN_HEADER ...@@ -49,6 +55,7 @@ FT_BEGIN_HEADER
#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) #define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) #define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) #define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) #define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) #define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) #define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
...@@ -57,6 +64,7 @@ FT_BEGIN_HEADER ...@@ -57,6 +64,7 @@ FT_BEGIN_HEADER
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) #define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) #define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) #define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
#define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) #define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) #define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) #define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
...@@ -67,33 +75,49 @@ FT_BEGIN_HEADER ...@@ -67,33 +75,49 @@ FT_BEGIN_HEADER
#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) #define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) #define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) #define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) #define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) #define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) #define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) #define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) #define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) #define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
#define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) #define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) #define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) #define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) #define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) #define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) #define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) #define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) #define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) #define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) #define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) #define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) #define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) #define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' )
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
#define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' )
#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
/* used by "Keyboard.dfont" on legacy Mac OS X */
#define TTAG_0xA5kbd FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' )
/* used by "LastResort.dfont" on legacy Mac OS X */
#define TTAG_0xA5lst FT_MAKE_TAG( 0xA5, 'l', 's', 't' )
FT_END_HEADER FT_END_HEADER
#endif /* __TTAGS_H__ */ #endif /* TTAGS_H_ */
/* END */ /* END */
/* This is a generated file. */
FT_USE_MODULE(tt_driver_class)
FT_USE_MODULE(t1_driver_class)
FT_USE_MODULE(cff_driver_class)
FT_USE_MODULE(t1cid_driver_class)
FT_USE_MODULE(pfr_driver_class)
FT_USE_MODULE(t42_driver_class)
FT_USE_MODULE(winfnt_driver_class)
FT_USE_MODULE(pcf_driver_class)
FT_USE_MODULE(bdf_driver_class)
FT_USE_MODULE(sfnt_module_class)
FT_USE_MODULE(autofit_module_class)
FT_USE_MODULE(pshinter_module_class)
FT_USE_MODULE(ft_raster1_renderer_class)
FT_USE_MODULE(ft_smooth_renderer_class)
FT_USE_MODULE(ft_smooth_lcd_renderer_class)
FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
FT_USE_MODULE(gxv_module_class)
FT_USE_MODULE(otv_module_class)
FT_USE_MODULE(psaux_module_class)
FT_USE_MODULE(psnames_module_class)
/* EOF */
/***************************************************************************/
/* */
/* ftoption.h */
/* */
/* User-selectable configuration macros (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 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. */
/* */
/***************************************************************************/
#ifndef __FTOPTION_H__
#define __FTOPTION_H__
#include <ft2build.h>
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* USER-SELECTABLE CONFIGURATION MACROS */
/* */
/* This file contains the default configuration macro definitions for */
/* a standard build of the FreeType library. There are three ways to */
/* use this file to build project-specific versions of the library: */
/* */
/* - You can modify this file by hand, but this is not recommended in */
/* cases where you would like to build several versions of the */
/* library from a single source directory. */
/* */
/* - You can put a copy of this file in your build directory, more */
/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
/* is the name of a directory that is included _before_ the FreeType */
/* include path during compilation. */
/* */
/* The default FreeType Makefiles and Jamfiles use the build */
/* directory `builds/<system>' by default, but you can easily change */
/* that for your own projects. */
/* */
/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
/* locate this file during the build. For example, */
/* */
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
/* #include <freetype/config/ftheader.h> */
/* */
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
/* definitions. */
/* */
/* Note also that you can similarly pre-define the macro */
/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
/* that are statically linked to the library at compile time. By */
/* default, this file is <freetype/config/ftmodule.h>. */
/* */
/* We highly recommend using the third method whenever possible. */
/* */
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Uncomment the line below if you want to activate sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times larger than */
/* the original size; the difference will be that each triplet of */
/* subpixels has R=G=B. */
/* */
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
/*************************************************************************/
/* */
/* Many compilers provide a non-ANSI 64-bit data type that can be used */
/* by FreeType to speed up some computations. However, this will create */
/* some problems when compiling the library in strict ANSI mode. */
/* */
/* For this reason, the use of 64-bit integers is normally disabled when */
/* the __STDC__ macro is defined. You can however disable this by */
/* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
/* */
/* For most compilers, this will only create compilation warnings when */
/* building the library. */
/* */
/* ObNote: The compiler-specific 64-bit integers are detected in the */
/* file `ftconfig.h' either statically or through the */
/* `configure' script on supported platforms. */
/* */
#undef FT_CONFIG_OPTION_FORCE_INT64
/*************************************************************************/
/* */
/* LZW-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `compress' program. This is mostly used to parse many of the PCF */
/* files that come with various X11 distributions. The implementation */
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
/* (see src/lzw/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
#define FT_CONFIG_OPTION_USE_LZW
/*************************************************************************/
/* */
/* Gzip-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `gzip' program. This is mostly used to parse many of the PCF files */
/* that come with XFree86. The implementation uses `zlib' to */
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. See also */
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
/* */
#define FT_CONFIG_OPTION_USE_ZLIB
/*************************************************************************/
/* */
/* ZLib library selection */
/* */
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
/* It allows FreeType's `ftgzip' component to link to the system's */
/* installation of the ZLib library. This is useful on systems like */
/* Unix or VMS where it generally is already available. */
/* */
/* If you let it undefined, the component will use its own copy */
/* of the zlib sources instead. These have been modified to be */
/* included directly within the component and *not* export external */
/* function names. This allows you to link any program with FreeType */
/* _and_ ZLib without linking conflicts. */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
/*************************************************************************/
/* */
/* DLL export compilation */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
/* special keyword in front OR after the return type of function */
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
#ifndef __GNUC__
# define __DLL_IMPORT__ __declspec(dllimport)
# define __DLL_EXPORT__ __declspec(dllexport)
#else
# define __DLL_IMPORT__ __attribute__((dllimport)) extern
# define __DLL_EXPORT__ __attribute__((dllexport)) extern
#endif
#if (defined __WIN32__) || (defined _WIN32)
# ifdef BUILD_FREETYPE2_DLL
# define FREETYPE2_DLL_IMPEXP __DLL_EXPORT__
# elif defined(FREETYPE2_STATIC)
# define FREETYPE2_DLL_IMPEXP
# elif defined (USE_FREETYPE2_DLL)
# define FREETYPE2_DLL_IMPEXP __DLL_IMPORT__
# elif defined (USE_FREETYPE2_STATIC)
# define FREETYPE2_DLL_IMPEXP
# else /* assume USE_FREETYPE2_DLL */
# define FREETYPE2_DLL_IMPEXP __DLL_IMPORT__
# endif
#else /* __WIN32__ */
# define FREETYPE2_DLL_IMPEXP
#endif
#define FT_EXPORT(x) FREETYPE2_DLL_IMPEXP x
#define FT_BASE(x) FREETYPE2_DLL_IMPEXP x
/*************************************************************************/
/* */
/* Glyph Postscript Names handling */
/* */
/* By default, FreeType 2 is compiled with the `PSNames' module. This */
/* module is in charge of converting a glyph name string into a */
/* Unicode value, or return a Macintosh standard glyph name for the */
/* use with the TrueType `post' table. */
/* */
/* Undefine this macro if you do not want `PSNames' compiled in your */
/* build of FreeType. This has the following effects: */
/* */
/* - The TrueType driver will provide its own set of glyph names, */
/* if you build it to support postscript names in the TrueType */
/* `post' table. */
/* */
/* - The Type 1 driver will not be able to synthetize a Unicode */
/* charmap out of the glyphs found in the fonts. */
/* */
/* You would normally undefine this configuration macro when building */
/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
/* */
#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
/*************************************************************************/
/* */
/* Postscript Names to Unicode Values support */
/* */
/* By default, FreeType 2 is built with the `PSNames' module compiled */
/* in. Among other things, the module is used to convert a glyph name */
/* into a Unicode value. This is especially useful in order to */
/* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
/* through a big table named the `Adobe Glyph List' (AGL). */
/* */
/* Undefine this macro if you do not want the Adobe Glyph List */
/* compiled in your `PSNames' module. The Type 1 driver will not be */
/* able to synthetize a Unicode charmap out of the glyphs found in the */
/* fonts. */
/* */
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
/*************************************************************************/
/* */
/* Support for Mac fonts */
/* */
/* Define this macro if you want support for outline fonts in Mac */
/* format (mac dfont, mac resource, macbinary containing a mac */
/* resource) on non-Mac platforms. */
/* */
/* Note that the `FOND' resource isn't checked. */
/* */
#define FT_CONFIG_OPTION_MAC_FONTS
/*************************************************************************/
/* */
/* Guessing methods to access embedded resource forks */
/* */
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
/* GNU/Linux). */
/* */
/* Resource forks which include fonts data are stored sometimes in */
/* locations which users or developers don't expected. In some cases, */
/* resource forks start with some offset from the head of a file. In */
/* other cases, the actual resource fork is stored in file different */
/* from what the user specifies. If this option is activated, */
/* FreeType tries to guess whether such offsets or different file */
/* names must be used. */
/* */
/* Note that normal, direct access of resource forks is controlled via */
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
/* */
#ifdef FT_CONFIG_OPTION_MAC_FONTS
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#endif
/*************************************************************************/
/* */
/* Allow the use of FT_Incremental_Interface to load typefaces that */
/* contain no glyph data, but supply it via a callback function. */
/* This allows FreeType to be used with the PostScript language, using */
/* the GhostScript interpreter. */
/* */
/* #define FT_CONFIG_OPTION_INCREMENTAL */
/*************************************************************************/
/* */
/* The size in bytes of the render pool used by the scan-line converter */
/* to do all of its work. */
/* */
/* This must be greater than 4KByte if you use FreeType to rasterize */
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
/* allocation of the render pool. */
/* */
#define FT_RENDER_POOL_SIZE 16384L
/*************************************************************************/
/* */
/* FT_MAX_MODULES */
/* */
/* The maximum number of modules that can be registered in a single */
/* FreeType library object. 32 is the default. */
/* */
#define FT_MAX_MODULES 32
/*************************************************************************/
/* */
/* Debug level */
/* */
/* FreeType can be compiled in debug or trace mode. In debug mode, */
/* errors are reported through the `ftdebug' component. In trace */
/* mode, additional messages are sent to the standard output during */
/* execution. */
/* */
/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
/* */
/* Don't define any of these macros to compile in `release' mode! */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_DEBUG_LEVEL_ERROR */
/* #define FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/
/* */
/* Memory Debugging */
/* */
/* FreeType now comes with an integrated memory debugger that is */
/* capable of detecting simple errors like memory leaks or double */
/* deletes. To compile it within your build of the library, you */
/* should define FT_DEBUG_MEMORY here. */
/* */
/* Note that the memory debugger is only activated at runtime when */
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_DEBUG_MEMORY */
/*************************************************************************/
/* */
/* Module errors */
/* */
/* If this macro is set (which is _not_ the default), the higher byte */
/* of an error code gives the module in which the error has occurred, */
/* while the lower byte is the real error code. */
/* */
/* Setting this macro makes sense for debugging purposes only, since */
/* it would break source compatibility of certain programs that use */
/* FreeType 2. */
/* */
/* More details can be found in the files ftmoderr.h and fterrors.h. */
/* */
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
/* embedded bitmaps in all formats using the SFNT module (namely */
/* TrueType & OpenType). */
/* */
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
/* load and enumerate the glyph Postscript names in a TrueType or */
/* OpenType file. */
/* */
/* Note that when you do not compile the `PSNames' module by undefining */
/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
/* contain additional code used to read the PS Names table from a font. */
/* */
/* (By default, the module uses `PSNames' to extract glyph names.) */
/* */
#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
/* access the internal name table in a SFNT-based format like TrueType */
/* or OpenType. The name table contains various strings used to */
/* describe the font, like family name, copyright, version, etc. It */
/* does not contain any glyph name though. */
/* */
/* Accessing SFNT names is done through the functions declared in */
/* `freetype/ftnames.h'. */
/* */
#define TT_CONFIG_OPTION_SFNT_NAMES
/*************************************************************************/
/* */
/* TrueType CMap support */
/* */
/* Here you can fine-tune which TrueType CMap table format shall be */
/* supported. */
#define TT_CONFIG_CMAP_FORMAT_0
#define TT_CONFIG_CMAP_FORMAT_2
#define TT_CONFIG_CMAP_FORMAT_4
#define TT_CONFIG_CMAP_FORMAT_6
#define TT_CONFIG_CMAP_FORMAT_8
#define TT_CONFIG_CMAP_FORMAT_10
#define TT_CONFIG_CMAP_FORMAT_12
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
/* a bytecode interpreter in the TrueType driver. Note that there are */
/* important patent issues related to the use of the interpreter. */
/* */
/* By undefining this, you will only compile the code necessary to load */
/* TrueType glyphs without hinting. */
/* */
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
/*************************************************************************/
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. Note that the */
/* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */
/* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words, */
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* */
/* This macro is only useful for a small number of font files (mostly */
/* for Asian scripts) that require bytecode interpretation to properly */
/* load glyphs. For all other fonts, this produces unpleasant results, */
/* thus the unpatented interpreter is never used to load glyphs from */
/* TrueType fonts unless one of the following two options is used. */
/* */
/* - The unpatented interpreter is explicitly activated by the user */
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
/* when opening the FT_Face. */
/* */
/* - FreeType detects that the FT_Face corresponds to one of the */
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
/* contains a hard-coded list of font names and other matching */
/* parameters (see function `tt_face_init' in file */
/* `src/truetype/ttobjs.c'). */
/* */
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
/* */
/* { */
/* FT_Parameter parameter; */
/* FT_Open_Args open_args; */
/* */
/* */
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
/* */
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
/* open_args.pathname = my_font_pathname; */
/* open_args.num_params = 1; */
/* open_args.params = &parameter; */
/* */
/* error = FT_Open_Face( library, &open_args, index, &face ); */
/* ... */
/* } */
/* */
#define TT_CONFIG_OPTION_UNPATENTED_HINTING
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
/* bytecode interpreter with a huge switch statement, rather than a call */
/* table. This results in smaller and faster code for a number of */
/* architectures. */
/* */
/* Note however that on some compiler/processor combinations, undefining */
/* this macro will generate faster, though larger, code. */
/* */
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
/* TrueType glyph loader to use Apple's definition of how to handle */
/* component offsets in composite glyphs. */
/* */
/* Apple and MS disagree on the default behavior of component offsets */
/* in composites. Apple says that they should be scaled by the scaling */
/* factors in the transformation matrix (roughly, it's more complex) */
/* while MS says they should not. OpenType defines two bits in the */
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
/* http://partners.adobe.com/asn/developer/opentype/glyf.html */
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
/* support for Apple's distortable font technology (fvar, gvar, cvar, */
/* and avar tables). This has many similarities to Type 1 Multiple */
/* Masters support. */
/* */
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
/* */
#define TT_CONFIG_OPTION_BDF
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
/* required. */
/* */
#define T1_MAX_DICT_DEPTH 5
/*************************************************************************/
/* */
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
/* calls during glyph loading. */
/* */
#define T1_MAX_SUBRS_CALLS 16
/*************************************************************************/
/* */
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
/* minimum of 16 is required. */
/* */
/* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
/* */
#define T1_MAX_CHARSTRINGS_OPERANDS 256
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
/* files into an existing face. Note that if set, the T1 driver will be */
/* unable to produce kerning distances. */
/* */
#undef T1_CONFIG_OPTION_NO_AFM
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of the Multiple Masters font support in the Type 1 */
/* driver. */
/* */
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Compile autofit module with CJK script support. */
/* */
#define AF_CONFIG_OPTION_CJK
/*************************************************************************/
/* */
/* Compile autofit module with Indic script support. */
/* */
#define AF_CONFIG_OPTION_INDIC
/* */
/*
* Define this variable if you want to keep the layout of internal
* structures that was used prior to FreeType 2.2. This also compiles in
* a few obsolete functions to avoid linking problems on typical Unix
* distributions.
*
* For embedded systems or building a new distribution from scratch, it
* is recommended to disable the macro since it reduces the library's code
* size and activates a few memory-saving optimizations as well.
*/
/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
/*
* This variable is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
#define TT_USE_BYTECODE_INTERPRETER
#endif
FT_END_HEADER
#endif /* __FTOPTION_H__ */
/* END */
/***************************************************************************/
/* */
/* ftstdlib.h */
/* */
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 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. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file is used to group all #includes to the ANSI C library that */
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines __FTSTDLIB_H__ before this one to override */
/* it. */
/* */
/*************************************************************************/
#ifndef __FTSTDLIB_H__
#define __FTSTDLIB_H__
#include <stddef.h>
#define ft_ptrdiff_t ptrdiff_t
/**********************************************************************/
/* */
/* integer limits */
/* */
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
/* of `int' and `long' in bytes at compile-time. So far, this works */
/* for all platforms the library has been tested on. */
/* */
/* Note that on the extremely rare platforms that do not provide */
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
/* old Crays where `int' is 36 bits), we do not make any guarantee */
/* about the correct behaviour of FT2 with all fonts. */
/* */
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */
/* */
/* IMPORTANT NOTE: We do not define aliases for heap management and */
/* i/o routines (i.e. malloc/free/fopen/fread/...) */
/* since these functions should all be encapsulated */
/* by platform-specific implementations of */
/* `ftsystem.c'. */
/* */
/**********************************************************************/
#include <limits.h>
#define FT_CHAR_BIT CHAR_BIT
#define FT_INT_MAX INT_MAX
#define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/
/* */
/* character and string processing */
/* */
/**********************************************************************/
#include <string.h>
#define ft_memchr memchr
#define ft_memcmp memcmp
#define ft_memcpy memcpy
#define ft_memmove memmove
#define ft_memset memset
#define ft_strcat strcat
#define ft_strcmp strcmp
#define ft_strcpy strcpy
#define ft_strlen strlen
#define ft_strncmp strncmp
#define ft_strncpy strncpy
#define ft_strrchr strrchr
#define ft_strstr strstr
/**********************************************************************/
/* */
/* file handling */
/* */
/**********************************************************************/
#include <stdio.h>
#define FT_FILE FILE
#define ft_fclose fclose
#define ft_fopen fopen
#define ft_fread fread
#define ft_fseek fseek
#define ft_ftell ftell
#define ft_sprintf sprintf
/**********************************************************************/
/* */
/* sorting */
/* */
/**********************************************************************/
#include <stdlib.h>
#define ft_qsort qsort
#define ft_exit exit /* only used to exit from unhandled exceptions */
/**********************************************************************/
/* */
/* memory allocation */
/* */
/**********************************************************************/
#define ft_scalloc calloc
#define ft_sfree free
#define ft_smalloc malloc
#define ft_srealloc realloc
/**********************************************************************/
/* */
/* miscellaneous */
/* */
/**********************************************************************/
#define ft_atol atol
#define ft_labs labs
/**********************************************************************/
/* */
/* execution control */
/* */
/**********************************************************************/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */
/* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
#include <stdarg.h>
#endif /* __FTSTDLIB_H__ */
/* END */
This source diff could not be displayed because it is too large. You can view the blob instead.
/***************************************************************************/
/* */
/* ftbbox.h */
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2001, 2003 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. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */
/* */
/* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */
/* */
/*************************************************************************/
#ifndef __FTBBOX_H__
#define __FTBBOX_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_BBox */
/* */
/* <Description> */
/* Computes the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm which returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bézier arcs are walked over to */
/* extract their extrema. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline. */
/* */
/* <Output> */
/* abbox :: The outline's exact bounding box. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
/* */
FT_END_HEADER
#endif /* __FTBBOX_H__ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/***************************************************************************/
/* */
/* ftbdf.h */
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
/* Copyright 2002, 2003, 2004, 2006 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 __FTBDF_H__
#define __FTBDF_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bdf_fonts */
/* */
/* <Title> */
/* BDF Files */
/* */
/* <Abstract> */
/* BDF specific API. */
/* */
/* <Description> */
/* This section contains the declaration of BDF specific functions. */
/* */
/*************************************************************************/
/**********************************************************************
*
* @enum:
* FT_PropertyType
*
* @description:
* A list of BDF property types.
*
* @values:
* BDF_PROPERTY_TYPE_NONE ::
* Value 0 is used to indicate a missing property.
*
* BDF_PROPERTY_TYPE_ATOM ::
* Property is a string atom.
*
* BDF_PROPERTY_TYPE_INTEGER ::
* Property is a 32-bit signed integer.
*
* BDF_PROPERTY_TYPE_CARDINAL ::
* Property is a 32-bit unsigned integer.
*/
typedef enum BDF_PropertyType_
{
BDF_PROPERTY_TYPE_NONE = 0,
BDF_PROPERTY_TYPE_ATOM = 1,
BDF_PROPERTY_TYPE_INTEGER = 2,
BDF_PROPERTY_TYPE_CARDINAL = 3
} BDF_PropertyType;
/**********************************************************************
*
* @type:
* BDF_Property
*
* @description:
* A handle to a @BDF_PropertyRec structure to model a given
* BDF/PCF property.
*/
typedef struct BDF_PropertyRec_* BDF_Property;
/**********************************************************************
*
* @struct:
* BDF_PropertyRec
*
* @description:
* This structure models a given BDF/PCF property.
*
* @fields:
* type ::
* The property type.
*
* u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
*
* u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
*
* u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/
typedef struct BDF_PropertyRec_
{
BDF_PropertyType type;
union {
const char* atom;
FT_Int32 integer;
FT_UInt32 cardinal;
} u;
} BDF_PropertyRec;
/**********************************************************************
*
* @function:
* FT_Get_BDF_Charset_ID
*
* @description:
* Retrieves a BDF font character set identity, according to
* the BDF specification.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* acharset_encoding ::
* Charset encoding, as a C string, owned by the face.
*
* acharset_registry ::
* Charset registry, as a C string, owned by the face.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function only works with BDF faces, returning an error otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry );
/**********************************************************************
*
* @function:
* FT_Get_BDF_Property
*
* @description:
* Retrieves a BDF property from a BDF or PCF font file.
*
* @input:
* face :: A handle to the input face.
*
* name :: The property name.
*
* @output:
* aproperty :: The property.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function works with BDF _and_ PCF fonts. It returns an error
* otherwise. It also returns an error if the property is not in the
* font.
*
* In case of error, `aproperty->type' is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face,
const char* prop_name,
BDF_PropertyRec *aproperty );
/* */
FT_END_HEADER
#endif /* __FTBDF_H__ */
/* END */
/***************************************************************************/
/* */
/* ftbitmap.h */
/* */
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
/* bitmaps into 8bpp format (specification). */
/* */
/* Copyright 2004, 2005, 2006 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 __FTBITMAP_H__
#define __FTBITMAP_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bitmap_handling */
/* */
/* <Title> */
/* Bitmap Handling */
/* */
/* <Abstract> */
/* Handling FT_Bitmap objects. */
/* */
/* <Description> */
/* This section contains functions for converting FT_Bitmap objects. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_New */
/* */
/* <Description> */
/* Initialize a pointer to an @FT_Bitmap structure. */
/* */
/* <InOut> */
/* abitmap :: A pointer to the bitmap structure. */
/* */
FT_EXPORT( void )
FT_Bitmap_New( FT_Bitmap *abitmap );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Copy */
/* */
/* <Description> */
/* Copies an bitmap into another one. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: A handle to the source bitmap. */
/* */
/* <Output> */
/* target :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target);
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Embolden */
/* */
/* <Description> */
/* Embolden a bitmap. The new bitmap will be about `xStrength' */
/* pixels wider and `yStrength' pixels higher. The left and bottom */
/* borders are kept unchanged. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* xStrength :: How strong the glyph is emboldened horizontally. */
/* Expressed in 26.6 pixel format. */
/* */
/* yStrength :: How strong the glyph is emboldened vertically. */
/* Expressed in 26.6 pixel format. */
/* */
/* <InOut> */
/* bitmap :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The current implementation restricts `xStrength' to be less than */
/* or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
/* */
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
FT_Pos xStrength,
FT_Pos yStrength );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Convert */
/* */
/* <Description> */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
/* bitmap object with depth 8bpp, making the number of used bytes per */
/* line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: The source bitmap. */
/* */
/* alignment :: The pitch of the bitmap is a multiple of this */
/* parameter. Common values are 1, 2, or 4. */
/* */
/* <Output> */
/* target :: The target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* It is possible to call @FT_Bitmap_Convert multiple times without */
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
/* */
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
/* */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target,
FT_Int alignment );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Done */
/* */
/* <Description> */
/* Destroy a bitmap object created with @FT_Bitmap_New. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* bitmap :: The bitmap object to be freed. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap );
/* */
FT_END_HEADER
#endif /* __FTBITMAP_H__ */
/* END */
/***************************************************************************/
/* */
/* ftcache.h */
/* */
/* FreeType Cache subsystem (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 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. */
/* */
/***************************************************************************/
#ifndef __FTCACHE_H__
#define __FTCACHE_H__
#include <ft2build.h>
#include FT_GLYPH_H
FT_BEGIN_HEADER
/*************************************************************************
*
* <Section>
* cache_subsystem
*
* <Title>
* Cache Sub-System
*
* <Abstract>
* How to cache face, size, and glyph data with FreeType 2.
*
* <Description>
* This section describes the FreeType 2 cache sub-system, which is used
* to limit the number of concurrently opened @FT_Face and @FT_Size
* objects, as well as caching information like character maps and glyph
* images while limiting their maximum memory usage.
*
* Note that all types and functions begin with the `FTC_' prefix.
*
* The cache is highly portable and thus doesn't know anything about the
* fonts installed on your system, or how to access them. This implies
* the following scheme:
*
* First, available or installed font faces are uniquely identified by
* @FTC_FaceID values, provided to the cache by the client. Note that
* the cache only stores and compares these values, and doesn't try to
* interpret them in any way.
*
* Second, the cache calls, only when needed, a client-provided function
* to convert a @FTC_FaceID into a new @FT_Face object. The latter is
* then completely managed by the cache, including its termination
* through @FT_Done_Face.
*
* Clients are free to map face IDs to anything else. The most simple
* usage is to associate them to a (pathname,face_index) pair that is
* used to call @FT_New_Face. However, more complex schemes are also
* possible.
*
* Note that for the cache to work correctly, the face ID values must be
* *persistent*, which means that the contents they point to should not
* change at runtime, or that their value should not become invalid.
*
* If this is unavoidable (e.g., when a font is uninstalled at runtime),
* you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
* the cache get rid of any references to the old @FTC_FaceID it may
* keep internally. Failure to do so will lead to incorrect behaviour
* or even crashes.
*
* To use the cache, start with calling @FTC_Manager_New to create a new
* @FTC_Manager object, which models a single cache instance. You can
* then look up @FT_Face and @FT_Size objects with
* @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
*
* If you want to use the charmap caching, call @FTC_CMapCache_New, then
* later use @FTC_CMapCache_Lookup to perform the equivalent of
* @FT_Get_Char_Index, only much faster.
*
* If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
* later use @FTC_ImageCache_Lookup to retrieve the corresponding
* @FT_Glyph objects from the cache.
*
* If you need lots of small bitmaps, it is much more memory efficient
* to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
* returns @FTC_SBitRec structures, which are used to store small
* bitmaps directly. (A small bitmap is one whose metrics and
* dimensions all fit into 8-bit integers).
*
* We hope to also provide a kerning cache in the near future.
*
*
* <Order>
* FTC_Manager
* FTC_FaceID
* FTC_Face_Requester
*
* FTC_Manager_New
* FTC_Manager_Reset
* FTC_Manager_Done
* FTC_Manager_LookupFace
* FTC_Manager_LookupSize
* FTC_Manager_RemoveFaceID
*
* FTC_Node
* FTC_Node_Unref
*
* FTC_ImageCache
* FTC_ImageCache_New
* FTC_ImageCache_Lookup
*
* FTC_SBit
* FTC_SBitCache
* FTC_SBitCache_New
* FTC_SBitCache_Lookup
*
* FTC_CMapCache
* FTC_CMapCache_New
* FTC_CMapCache_Lookup
*
*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** BASIC TYPE DEFINITIONS *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************
*
* @type: FTC_FaceID
*
* @description:
* An opaque pointer type that is used to identity face objects. The
* contents of such objects is application-dependent.
*
* These pointers are typically used to point to a user-defined
* structure containing a font file path, and face index.
*
* @note:
* Never use NULL as a valid @FTC_FaceID.
*
* Face IDs are passed by the client to the cache manager, which calls,
* when needed, the @FTC_Face_Requester to translate them into new
* @FT_Face objects.
*
* If the content of a given face ID changes at runtime, or if the value
* becomes invalid (e.g., when uninstalling a font), you should
* immediately call @FTC_Manager_RemoveFaceID before any other cache
* function.
*
* Failure to do so will result in incorrect behaviour or even
* memory leaks and crashes.
*/
typedef struct FTC_FaceIDRec_* FTC_FaceID;
/************************************************************************
*
* @functype:
* FTC_Face_Requester
*
* @description:
* A callback function provided by client applications. It is used by
* the cache manager to translate a given @FTC_FaceID into a new valid
* @FT_Face object, on demand.
*
* <Input>
* face_id ::
* The face ID to resolve.
*
* library ::
* A handle to a FreeType library object.
*
* req_data ::
* Application-provided request data (see note below).
*
* <Output>
* aface ::
* A new @FT_Face handle.
*
* <Return>
* FreeType error code. 0 means success.
*
* <Note>
* The third parameter `req_data' is the same as the one passed by the
* client when @FTC_Manager_New is called.
*
* The face requester should not perform funny things on the returned
* face object, like creating a new @FT_Size for it, or setting a
* transformation through @FT_Set_Transform!
*/
typedef FT_Error
(*FTC_Face_Requester)( FTC_FaceID face_id,
FT_Library library,
FT_Pointer request_data,
FT_Face* aface );
/* */
#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
#define FTC_FACE_ID_HASH( i ) \
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** CACHE MANAGER OBJECT *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* <Type> */
/* FTC_Manager */
/* */
/* <Description> */
/* This object corresponds to one instance of the cache-subsystem. */
/* It is used to cache one or more @FT_Face objects, along with */
/* corresponding @FT_Size objects. */
/* */
/* The manager intentionally limits the total number of opened */
/* @FT_Face and @FT_Size objects to control memory usage. See the */
/* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
/* */
/* The manager is also used to cache `nodes' of various types while */
/* limiting their total memory usage. */
/* */
/* All limitations are enforced by keeping lists of managed objects */
/* in most-recently-used order, and flushing old nodes to make room */
/* for new ones. */
/* */
typedef struct FTC_ManagerRec_* FTC_Manager;
/*************************************************************************/
/* */
/* <Type> */
/* FTC_Node */
/* */
/* <Description> */
/* An opaque handle to a cache node object. Each cache node is */
/* reference-counted. A node with a count of 0 might be flushed */
/* out of a full cache whenever a lookup request is performed. */
/* */
/* If you lookup nodes, you have the ability to `acquire' them, i.e., */
/* to increment their reference count. This will prevent the node */
/* from being flushed out of the cache until you explicitly `release' */
/* it (see @FTC_Node_Unref). */
/* */
/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
/* */
typedef struct FTC_NodeRec_* FTC_Node;
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_New */
/* */
/* <Description> */
/* Creates a new cache manager. */
/* */
/* <Input> */
/* library :: The parent FreeType library handle to use. */
/* */
/* max_faces :: Maximum number of opened @FT_Face objects managed by */
/* this cache instance. Use 0 for defaults. */
/* */
/* max_sizes :: Maximum number of opened @FT_Size objects managed by */
/* this cache instance. Use 0 for defaults. */
/* */
/* max_bytes :: Maximum number of bytes to use for cached data nodes. */
/* Use 0 for defaults. Note that this value does not */
/* account for managed @FT_Face and @FT_Size objects. */
/* */
/* requester :: An application-provided callback used to translate */
/* face IDs into real @FT_Face objects. */
/* */
/* req_data :: A generic pointer that is passed to the requester */
/* each time it is called (see @FTC_Face_Requester). */
/* */
/* <Output> */
/* amanager :: A handle to a new manager object. 0 in case of */
/* failure. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FTC_Manager_New( FT_Library library,
FT_UInt max_faces,
FT_UInt max_sizes,
FT_ULong max_bytes,
FTC_Face_Requester requester,
FT_Pointer req_data,
FTC_Manager *amanager );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_Reset */
/* */
/* <Description> */
/* Empties a given cache manager. This simply gets rid of all the */
/* currently cached @FT_Face and @FT_Size objects within the manager. */
/* */
/* <InOut> */
/* manager :: A handle to the manager. */
/* */
FT_EXPORT( void )
FTC_Manager_Reset( FTC_Manager manager );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_Done */
/* */
/* <Description> */
/* Destroys a given manager after emptying it. */
/* */
/* <Input> */
/* manager :: A handle to the target cache manager object. */
/* */
FT_EXPORT( void )
FTC_Manager_Done( FTC_Manager manager );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_LookupFace */
/* */
/* <Description> */
/* Retrieves the @FT_Face object that corresponds to a given face ID */
/* through a cache manager. */
/* */
/* <Input> */
/* manager :: A handle to the cache manager. */
/* */
/* face_id :: The ID of the face object. */
/* */
/* <Output> */
/* aface :: A handle to the face object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The returned @FT_Face object is always owned by the manager. You */
/* should never try to discard it yourself. */
/* */
/* The @FT_Face object doesn't necessarily have a current size object */
/* (i.e., face->size can be 0). If you need a specific `font size', */
/* use @FTC_Manager_LookupSize instead. */
/* */
/* Never change the face's transformation matrix (i.e., never call */
/* the @FT_Set_Transform function) on a returned face! If you need */
/* to transform glyphs, do it yourself after glyph loading. */
/* */
/* When you perform a lookup, out-of-memory errors are detected */
/* _within_ the lookup and force incremental flushes of the cache */
/* until enough memory is released for the lookup to succeed. */
/* */
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
/* already been completely flushed, and still no memory was available */
/* for the operation. */
/* */
FT_EXPORT( FT_Error )
FTC_Manager_LookupFace( FTC_Manager manager,
FTC_FaceID face_id,
FT_Face *aface );
/*************************************************************************/
/* */
/* <Struct> */
/* FTC_ScalerRec */
/* */
/* <Description> */
/* A structure used to describe a given character size in either */
/* pixels or points to the cache manager. See */
/* @FTC_Manager_LookupSize. */
/* */
/* <Fields> */
/* face_id :: The source face ID. */
/* */
/* width :: The character width. */
/* */
/* height :: The character height. */
/* */
/* pixel :: A Boolean. If 1, the `width' and `height' fields are */
/* interpreted as integer pixel character sizes. */
/* Otherwise, they are expressed as 1/64th of points. */
/* */
/* x_res :: Only used when `pixel' is value 0 to indicate the */
/* horizontal resolution in dpi. */
/* */
/* y_res :: Only used when `pixel' is value 0 to indicate the */
/* vertical resolution in dpi. */
/* */
/* <Note> */
/* This type is mainly used to retrieve @FT_Size objects through the */
/* cache manager. */
/* */
typedef struct FTC_ScalerRec_
{
FTC_FaceID face_id;
FT_UInt width;
FT_UInt height;
FT_Int pixel;
FT_UInt x_res;
FT_UInt y_res;
} FTC_ScalerRec, *FTC_Scaler;
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Manager_LookupSize */
/* */
/* <Description> */
/* Retrieve the @FT_Size object that corresponds to a given */
/* @FTC_ScalerRec pointer through a cache manager. */
/* */
/* <Input> */
/* manager :: A handle to the cache manager. */
/* */
/* scaler :: A scaler handle. */
/* */
/* <Output> */
/* asize :: A handle to the size object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The returned @FT_Size object is always owned by the manager. You */
/* should never try to discard it by yourself. */
/* */
/* You can access the parent @FT_Face object simply as `size->face' */
/* if you need it. Note that this object is also owned by the */
/* manager. */
/* */
/* <Note> */
/* When you perform a lookup, out-of-memory errors are detected */
/* _within_ the lookup and force incremental flushes of the cache */
/* until enough memory is released for the lookup to succeed. */
/* */
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
/* already been completely flushed, and still no memory is available */
/* for the operation. */
/* */
FT_EXPORT( FT_Error )
FTC_Manager_LookupSize( FTC_Manager manager,
FTC_Scaler scaler,
FT_Size *asize );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Node_Unref */
/* */
/* <Description> */
/* Decrement a cache node's internal reference count. When the count */
/* reaches 0, it is not destroyed but becomes eligible for subsequent */
/* cache flushes. */
/* */
/* <Input> */
/* node :: The cache node handle. */
/* */
/* manager :: The cache manager handle. */
/* */
FT_EXPORT( void )
FTC_Node_Unref( FTC_Node node,
FTC_Manager manager );
/*************************************************************************
*
* @function:
* FTC_Manager_RemoveFaceID
*
* @description:
* A special function used to indicate to the cache manager that
* a given @FTC_FaceID is no longer valid, either because its
* content changed, or because it was deallocated or uninstalled.
*
* @input:
* manager ::
* The cache manager handle.
*
* face_id ::
* The @FTC_FaceID to be removed.
*
* @note:
* This function flushes all nodes from the cache corresponding to this
* `face_id', with the exception of nodes with a non-null reference
* count.
*
* Such nodes are however modified internally so as to never appear
* in later lookups with the same `face_id' value, and to be immediately
* destroyed when released by all their users.
*
*/
FT_EXPORT( void )
FTC_Manager_RemoveFaceID( FTC_Manager manager,
FTC_FaceID face_id );
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
* FTC_CMapCache
*
* @description:
* An opaque handle used to model a charmap cache. This cache is to
* hold character codes -> glyph indices mappings.
*
*/
typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
/*************************************************************************
*
* @function:
* FTC_CMapCache_New
*
* @description:
* Create a new charmap cache.
*
* @input:
* manager ::
* A handle to the cache manager.
*
* @output:
* acache ::
* A new cache handle. NULL in case of error.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* Like all other caches, this one will be destroyed with the cache
* manager.
*
*/
FT_EXPORT( FT_Error )
FTC_CMapCache_New( FTC_Manager manager,
FTC_CMapCache *acache );
/************************************************************************
*
* @function:
* FTC_CMapCache_Lookup
*
* @description:
* Translate a character code into a glyph index, using the charmap
* cache.
*
* @input:
* cache ::
* A charmap cache handle.
*
* face_id ::
* The source face ID.
*
* cmap_index ::
* The index of the charmap in the source face.
*
* char_code ::
* The character code (in the corresponding charmap).
*
* @return:
* Glyph index. 0 means `no glyph'.
*
*/
FT_EXPORT( FT_UInt )
FTC_CMapCache_Lookup( FTC_CMapCache cache,
FTC_FaceID face_id,
FT_Int cmap_index,
FT_UInt32 char_code );
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** IMAGE CACHE OBJECT *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************
*
* @struct:
* FTC_ImageTypeRec
*
* @description:
* A structure used to model the type of images in a glyph cache.
*
* @fields:
* face_id ::
* The face ID.
*
* width ::
* The width in pixels.
*
* height ::
* The height in pixels.
*
* flags ::
* The load flags, as in @FT_Load_Glyph.
*
*/
typedef struct FTC_ImageTypeRec_
{
FTC_FaceID face_id;
FT_Int width;
FT_Int height;
FT_Int32 flags;
} FTC_ImageTypeRec;
/*************************************************************************
*
* @type:
* FTC_ImageType
*
* @description:
* A handle to an @FTC_ImageTypeRec structure.
*
*/
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
/* */
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
( (d1)->face_id == (d2)->face_id && \
(d1)->width == (d2)->width && \
(d1)->flags == (d2)->flags )
#define FTC_IMAGE_TYPE_HASH( d ) \
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
( (d)->width << 8 ) ^ (d)->height ^ \
( (d)->flags << 4 ) )
/*************************************************************************/
/* */
/* <Type> */
/* FTC_ImageCache */
/* */
/* <Description> */
/* A handle to an glyph image cache object. They are designed to */
/* hold many distinct glyph images while not exceeding a certain */
/* memory threshold. */
/* */
typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
/*************************************************************************/
/* */
/* <Function> */
/* FTC_ImageCache_New */
/* */
/* <Description> */
/* Creates a new glyph image cache. */
/* */
/* <Input> */
/* manager :: The parent manager for the image cache. */
/* */
/* <Output> */
/* acache :: A handle to the new glyph image cache object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FTC_ImageCache_New( FTC_Manager manager,
FTC_ImageCache *acache );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_ImageCache_Lookup */
/* */
/* <Description> */
/* Retrieves a given glyph image from a glyph image cache. */
/* */
/* <Input> */
/* cache :: A handle to the source glyph image cache. */
/* */
/* type :: A pointer to a glyph image type descriptor. */
/* */
/* gindex :: The glyph index to retrieve. */
/* */
/* <Output> */
/* aglyph :: The corresponding @FT_Glyph object. 0 in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The returned glyph is owned and managed by the glyph image cache. */
/* Never try to transform or discard it manually! You can however */
/* create a copy with @FT_Glyph_Copy and modify the new one. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the glyph image, after increasing its reference */
/* count. This ensures that the node (as well as the @FT_Glyph) will */
/* always be kept in the cache until you call @FTC_Node_Unref to */
/* `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the @FT_Glyph could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_ImageCache_Lookup( FTC_ImageCache cache,
FTC_ImageType type,
FT_UInt gindex,
FT_Glyph *aglyph,
FTC_Node *anode );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_ImageCache_LookupScaler */
/* */
/* <Description> */
/* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */
/* to specify the face ID and its size. */
/* */
/* <Input> */
/* cache :: A handle to the source glyph image cache. */
/* */
/* scaler :: A pointer to a scaler descriptor. */
/* */
/* load_flags :: The corresponding load flags. */
/* */
/* gindex :: The glyph index to retrieve. */
/* */
/* <Output> */
/* aglyph :: The corresponding @FT_Glyph object. 0 in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The returned glyph is owned and managed by the glyph image cache. */
/* Never try to transform or discard it manually! You can however */
/* create a copy with @FT_Glyph_Copy and modify the new one. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the glyph image, after increasing its reference */
/* count. This ensures that the node (as well as the @FT_Glyph) will */
/* always be kept in the cache until you call @FTC_Node_Unref to */
/* `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the @FT_Glyph could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_ImageCache_LookupScaler( FTC_ImageCache cache,
FTC_Scaler scaler,
FT_ULong load_flags,
FT_UInt gindex,
FT_Glyph *aglyph,
FTC_Node *anode );
/*************************************************************************/
/* */
/* <Type> */
/* FTC_SBit */
/* */
/* <Description> */
/* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
/* structure for details. */
/* */
typedef struct FTC_SBitRec_* FTC_SBit;
/*************************************************************************/
/* */
/* <Struct> */
/* FTC_SBitRec */
/* */
/* <Description> */
/* A very compact structure used to describe a small glyph bitmap. */
/* */
/* <Fields> */
/* width :: The bitmap width in pixels. */
/* */
/* height :: The bitmap height in pixels. */
/* */
/* left :: The horizontal distance from the pen position to the */
/* left bitmap border (a.k.a. `left side bearing', or */
/* `lsb'). */
/* */
/* top :: The vertical distance from the pen position (on the */
/* baseline) to the upper bitmap border (a.k.a. `top */
/* side bearing'). The distance is positive for upwards */
/* Y coordinates. */
/* */
/* format :: The format of the glyph bitmap (monochrome or gray). */
/* */
/* max_grays :: Maximum gray level value (in the range 1 to 255). */
/* */
/* pitch :: The number of bytes per bitmap line. May be positive */
/* or negative. */
/* */
/* xadvance :: The horizontal advance width in pixels. */
/* */
/* yadvance :: The vertical advance height in pixels. */
/* */
/* buffer :: A pointer to the bitmap pixels. */
/* */
typedef struct FTC_SBitRec_
{
FT_Byte width;
FT_Byte height;
FT_Char left;
FT_Char top;
FT_Byte format;
FT_Byte max_grays;
FT_Short pitch;
FT_Char xadvance;
FT_Char yadvance;
FT_Byte* buffer;
} FTC_SBitRec;
/*************************************************************************/
/* */
/* <Type> */
/* FTC_SBitCache */
/* */
/* <Description> */
/* A handle to a small bitmap cache. These are special cache objects */
/* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
/* much more efficient way than the traditional glyph image cache */
/* implemented by @FTC_ImageCache. */
/* */
typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_New */
/* */
/* <Description> */
/* Creates a new cache to store small glyph bitmaps. */
/* */
/* <Input> */
/* manager :: A handle to the source cache manager. */
/* */
/* <Output> */
/* acache :: A handle to the new sbit cache. NULL in case of error. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_New( FTC_Manager manager,
FTC_SBitCache *acache );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_Lookup */
/* */
/* <Description> */
/* Looks up a given small glyph bitmap in a given sbit cache and */
/* `lock' it to prevent its flushing from the cache until needed. */
/* */
/* <Input> */
/* cache :: A handle to the source sbit cache. */
/* */
/* type :: A pointer to the glyph image type descriptor. */
/* */
/* gindex :: The glyph index. */
/* */
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The small bitmap descriptor and its bit buffer are owned by the */
/* cache and should never be freed by the application. They might */
/* as well disappear from memory on the next cache lookup, so don't */
/* treat them as persistent data. */
/* */
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
/* glyph bitmap. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the bitmap, after increasing its reference count. */
/* This ensures that the node (as well as the image) will always be */
/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the bitmap could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_Lookup( FTC_SBitCache cache,
FTC_ImageType type,
FT_UInt gindex,
FTC_SBit *sbit,
FTC_Node *anode );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_LookupScaler */
/* */
/* <Description> */
/* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */
/* to specify the face ID and its size. */
/* */
/* <Input> */
/* cache :: A handle to the source sbit cache. */
/* */
/* scaler :: A pointer to the scaler descriptor. */
/* */
/* load_flags :: The corresponding load flags. */
/* */
/* gindex :: The glyph index. */
/* */
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The small bitmap descriptor and its bit buffer are owned by the */
/* cache and should never be freed by the application. They might */
/* as well disappear from memory on the next cache lookup, so don't */
/* treat them as persistent data. */
/* */
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
/* glyph bitmap. */
/* */
/* If `anode' is _not_ NULL, it receives the address of the cache */
/* node containing the bitmap, after increasing its reference count. */
/* This ensures that the node (as well as the image) will always be */
/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
/* */
/* If `anode' is NULL, the cache node is left unchanged, which means */
/* that the bitmap could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_LookupScaler( FTC_SBitCache cache,
FTC_Scaler scaler,
FT_ULong load_flags,
FT_UInt gindex,
FTC_SBit *sbit,
FTC_Node *anode );
/* */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
/*@***********************************************************************/
/* */
/* <Struct> */
/* FTC_FontRec */
/* */
/* <Description> */
/* A simple structure used to describe a given `font' to the cache */
/* manager. Note that a `font' is the combination of a given face */
/* with a given character size. */
/* */
/* <Fields> */
/* face_id :: The ID of the face to use. */
/* */
/* pix_width :: The character width in integer pixels. */
/* */
/* pix_height :: The character height in integer pixels. */
/* */
typedef struct FTC_FontRec_
{
FTC_FaceID face_id;
FT_UShort pix_width;
FT_UShort pix_height;
} FTC_FontRec;
/* */
#define FTC_FONT_COMPARE( f1, f2 ) \
( (f1)->face_id == (f2)->face_id && \
(f1)->pix_width == (f2)->pix_width && \
(f1)->pix_height == (f2)->pix_height )
#define FTC_FONT_HASH( f ) \
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
((f)->pix_width << 8) ^ \
((f)->pix_height) )
typedef FTC_FontRec* FTC_Font;
FT_EXPORT( FT_Error )
FTC_Manager_Lookup_Face( FTC_Manager manager,
FTC_FaceID face_id,
FT_Face *aface );
FT_EXPORT( FT_Error )
FTC_Manager_Lookup_Size( FTC_Manager manager,
FTC_Font font,
FT_Face *aface,
FT_Size *asize );
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/* */
FT_END_HEADER
#endif /* __FTCACHE_H__ */
/* END */
/***************************************************************************/
/* */
/* This file defines the structure of the FreeType reference. */
/* It is used by the python script which generates the HTML files. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* general_remarks */
/* */
/* <Title> */
/* General Remarks */
/* */
/* <Sections> */
/* user_allocation */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* core_api */
/* */
/* <Title> */
/* Core API */
/* */
/* <Sections> */
/* version */
/* basic_types */
/* base_interface */
/* glyph_management */
/* mac_specific */
/* sizes_management */
/* header_file_macros */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* format_specific */
/* */
/* <Title> */
/* Format-Specific API */
/* */
/* <Sections> */
/* multiple_masters */
/* truetype_tables */
/* type1_tables */
/* sfnt_names */
/* bdf_fonts */
/* pfr_fonts */
/* winfnt_fonts */
/* font_formats */
/* gasp_table */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* cache_subsystem */
/* */
/* <Title> */
/* Cache Sub-System */
/* */
/* <Sections> */
/* cache_subsystem */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* support_api */
/* */
/* <Title> */
/* Support API */
/* */
/* <Sections> */
/* computations */
/* list_processing */
/* outline_processing */
/* bitmap_handling */
/* raster */
/* glyph_stroker */
/* system_interface */
/* module_management */
/* gzip */
/* lzw */
/* lcd_filtering */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* ftglyph.h */
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006 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. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file contains the definition of several convenience functions */
/* that can be used by client applications to easily retrieve glyph */
/* bitmaps and outlines from a given face. */
/* */
/* These functions should be optional if you are writing a font server */
/* or text layout engine on top of FreeType. However, they are pretty */
/* handy for many other simple uses of the library. */
/* */
/*************************************************************************/
#ifndef __FTGLYPH_H__
#define __FTGLYPH_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* glyph_management */
/* */
/* <Title> */
/* Glyph Management */
/* */
/* <Abstract> */
/* Generic interface to manage individual glyph data. */
/* */
/* <Description> */
/* This section contains definitions used to manage glyph data */
/* through generic FT_Glyph objects. Each of them can contain a */
/* bitmap, a vector outline, or even images in other formats. */
/* */
/*************************************************************************/
/* forward declaration to a private type */
typedef struct FT_Glyph_Class_ FT_Glyph_Class;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Glyph */
/* */
/* <Description> */
/* Handle to an object used to model generic glyph images. It is a */
/* pointer to the @FT_GlyphRec structure and can contain a glyph */
/* bitmap or pointer. */
/* */
/* <Note> */
/* Glyph objects are not owned by the library. You must thus release */
/* them manually (through @FT_Done_Glyph) _before_ calling */
/* @FT_Done_FreeType. */
/* */
typedef struct FT_GlyphRec_* FT_Glyph;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_GlyphRec */
/* */
/* <Description> */
/* The root glyph structure contains a given glyph image plus its */
/* advance width in 16.16 fixed float format. */
/* */
/* <Fields> */
/* library :: A handle to the FreeType library object. */
/* */
/* clazz :: A pointer to the glyph's class. Private. */
/* */
/* format :: The format of the glyph's image. */
/* */
/* advance :: A 16.16 vector that gives the glyph's advance width. */
/* */
typedef struct FT_GlyphRec_
{
FT_Library library;
const FT_Glyph_Class* clazz;
FT_Glyph_Format format;
FT_Vector advance;
} FT_GlyphRec;
/*************************************************************************/
/* */
/* <Type> */
/* FT_BitmapGlyph */
/* */
/* <Description> */
/* A handle to an object used to model a bitmap glyph image. This is */
/* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
/* */
typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_BitmapGlyphRec */
/* */
/* <Description> */
/* A structure used for bitmap glyph images. This really is a */
/* `sub-class' of @FT_GlyphRec. */
/* */
/* <Fields> */
/* root :: The root @FT_Glyph fields. */
/* */
/* left :: The left-side bearing, i.e., the horizontal distance */
/* from the current pen position to the left border of the */
/* glyph bitmap. */
/* */
/* top :: The top-side bearing, i.e., the vertical distance from */
/* the current pen position to the top border of the glyph */
/* bitmap. This distance is positive for upwards-y! */
/* */
/* bitmap :: A descriptor for the bitmap. */
/* */
/* <Note> */
/* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
/* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
/* the bitmap's contents easily. */
/* */
/* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
/* and is thus created and destroyed with it. */
/* */
typedef struct FT_BitmapGlyphRec_
{
FT_GlyphRec root;
FT_Int left;
FT_Int top;
FT_Bitmap bitmap;
} FT_BitmapGlyphRec;
/*************************************************************************/
/* */
/* <Type> */
/* FT_OutlineGlyph */
/* */
/* <Description> */
/* A handle to an object used to model an outline glyph image. This */
/* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
/* */
typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_OutlineGlyphRec */
/* */
/* <Description> */
/* A structure used for outline (vectorial) glyph images. This */
/* really is a `sub-class' of @FT_GlyphRec. */
/* */
/* <Fields> */
/* root :: The root @FT_Glyph fields. */
/* */
/* outline :: A descriptor for the outline. */
/* */
/* <Note> */
/* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */
/* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
/* the outline's content easily. */
/* */
/* As the outline is extracted from a glyph slot, its coordinates are */
/* expressed normally in 26.6 pixels, unless the flag */
/* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
/* */
/* The outline's tables are always owned by the object and are */
/* destroyed with it. */
/* */
typedef struct FT_OutlineGlyphRec_
{
FT_GlyphRec root;
FT_Outline outline;
} FT_OutlineGlyphRec;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Glyph */
/* */
/* <Description> */
/* A function used to extract a glyph image from a slot. */
/* */
/* <Input> */
/* slot :: A handle to the source glyph slot. */
/* */
/* <Output> */
/* aglyph :: A handle to the glyph object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph( FT_GlyphSlot slot,
FT_Glyph *aglyph );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_Copy */
/* */
/* <Description> */
/* A function used to copy a glyph image. Note that the created */
/* @FT_Glyph object must be released with @FT_Done_Glyph. */
/* */
/* <Input> */
/* source :: A handle to the source glyph object. */
/* */
/* <Output> */
/* target :: A handle to the target glyph object. 0 in case of */
/* error. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Glyph_Copy( FT_Glyph source,
FT_Glyph *target );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_Transform */
/* */
/* <Description> */
/* Transforms a glyph image if its format is scalable. */
/* */
/* <InOut> */
/* glyph :: A handle to the target glyph object. */
/* */
/* <Input> */
/* matrix :: A pointer to a 2x2 matrix to apply. */
/* */
/* delta :: A pointer to a 2d vector to apply. Coordinates are */
/* expressed in 1/64th of a pixel. */
/* */
/* <Return> */
/* FreeType error code (if not 0, the glyph format is not scalable). */
/* */
/* <Note> */
/* The 2x2 transformation matrix is also applied to the glyph's */
/* advance vector. */
/* */
FT_EXPORT( FT_Error )
FT_Glyph_Transform( FT_Glyph glyph,
FT_Matrix* matrix,
FT_Vector* delta );
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Glyph_BBox_Mode */
/* */
/* <Description> */
/* The mode how the values of @FT_Glyph_Get_CBox are returned. */
/* */
/* <Values> */
/* FT_GLYPH_BBOX_UNSCALED :: */
/* Return unscaled font units. */
/* */
/* FT_GLYPH_BBOX_SUBPIXELS :: */
/* Return unfitted 26.6 coordinates. */
/* */
/* FT_GLYPH_BBOX_GRIDFIT :: */
/* Return grid-fitted 26.6 coordinates. */
/* */
/* FT_GLYPH_BBOX_TRUNCATE :: */
/* Return coordinates in integer pixels. */
/* */
/* FT_GLYPH_BBOX_PIXELS :: */
/* Return grid-fitted pixel coordinates. */
/* */
typedef enum FT_Glyph_BBox_Mode_
{
FT_GLYPH_BBOX_UNSCALED = 0,
FT_GLYPH_BBOX_SUBPIXELS = 0,
FT_GLYPH_BBOX_GRIDFIT = 1,
FT_GLYPH_BBOX_TRUNCATE = 2,
FT_GLYPH_BBOX_PIXELS = 3
} FT_Glyph_BBox_Mode;
/*************************************************************************/
/* */
/* <Enum> */
/* ft_glyph_bbox_xxx */
/* */
/* <Description> */
/* These constants are deprecated. Use the corresponding */
/* @FT_Glyph_BBox_Mode values instead. */
/* */
/* <Values> */
/* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
/* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
/* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
/* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
/* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
/* */
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_Get_CBox */
/* */
/* <Description> */
/* Return a glyph's `control box'. The control box encloses all the */
/* outline's points, including Bézier control points. Though it */
/* coincides with the exact bounding box for most glyphs, it can be */
/* slightly larger in some situations (like when rotating an outline */
/* which contains Bézier outside arcs). */
/* */
/* Computing the control box is very fast, while getting the bounding */
/* box can take much more time as it needs to walk over all segments */
/* and arcs in the outline. To get the latter, you can use the */
/* `ftbbox' component which is dedicated to this single task. */
/* */
/* <Input> */
/* glyph :: A handle to the source glyph object. */
/* */
/* mode :: The mode which indicates how to interpret the returned */
/* bounding box values. */
/* */
/* <Output> */
/* acbox :: The glyph coordinate bounding box. Coordinates are */
/* expressed in 1/64th of pixels if it is grid-fitted. */
/* */
/* <Note> */
/* Coordinates are relative to the glyph origin, using the Y-upwards */
/* convention. */
/* */
/* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
/* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
/* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
/* is another name for this constant. */
/* */
/* Note that the maximum coordinates are exclusive, which means that */
/* one can compute the width and height of the glyph image (be it in */
/* integer or 26.6 pixels) as: */
/* */
/* { */
/* width = bbox.xMax - bbox.xMin; */
/* height = bbox.yMax - bbox.yMin; */
/* } */
/* */
/* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
/* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
/* which corresponds to: */
/* */
/* { */
/* bbox.xMin = FLOOR(bbox.xMin); */
/* bbox.yMin = FLOOR(bbox.yMin); */
/* bbox.xMax = CEILING(bbox.xMax); */
/* bbox.yMax = CEILING(bbox.yMax); */
/* } */
/* */
/* To get the bbox in pixel coordinates, set `bbox_mode' to */
/* @FT_GLYPH_BBOX_TRUNCATE. */
/* */
/* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
/* to @FT_GLYPH_BBOX_PIXELS. */
/* */
FT_EXPORT( void )
FT_Glyph_Get_CBox( FT_Glyph glyph,
FT_UInt bbox_mode,
FT_BBox *acbox );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Glyph_To_Bitmap */
/* */
/* <Description> */
/* Converts a given glyph object to a bitmap glyph object. */
/* */
/* <InOut> */
/* the_glyph :: A pointer to a handle to the target glyph. */
/* */
/* <Input> */
/* render_mode :: An enumeration that describe how the data is */
/* rendered. */
/* */
/* origin :: A pointer to a vector used to translate the glyph */
/* image before rendering. Can be 0 (if no */
/* translation). The origin is expressed in */
/* 26.6 pixels. */
/* */
/* destroy :: A boolean that indicates that the original glyph */
/* image should be destroyed by this function. It is */
/* never destroyed in case of error. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The glyph image is translated with the `origin' vector before */
/* rendering. */
/* */
/* The first parameter is a pointer to an @FT_Glyph handle, that will */
/* be replaced by this function. Typically, you would use (omitting */
/* error handling): */
/* */
/* */
/* { */
/* FT_Glyph glyph; */
/* FT_BitmapGlyph glyph_bitmap; */
/* */
/* */
/* // load glyph */
/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
/* */
/* // extract glyph image */
/* error = FT_Get_Glyph( face->glyph, &glyph ); */
/* */
/* // convert to a bitmap (default render mode + destroy old) */
/* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
/* { */
/* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */
/* 0, 1 ); */
/* if ( error ) // glyph unchanged */
/* ... */
/* } */
/* */
/* // access bitmap content by typecasting */
/* glyph_bitmap = (FT_BitmapGlyph)glyph; */
/* */
/* // do funny stuff with it, like blitting/drawing */
/* ... */
/* */
/* // discard glyph image (bitmap or not) */
/* FT_Done_Glyph( glyph ); */
/* } */
/* */
/* */
/* This function does nothing if the glyph format isn't scalable. */
/* */
FT_EXPORT( FT_Error )
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
FT_Render_Mode render_mode,
FT_Vector* origin,
FT_Bool destroy );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Glyph */
/* */
/* <Description> */
/* Destroys a given glyph. */
/* */
/* <Input> */
/* glyph :: A handle to the target glyph object. */
/* */
FT_EXPORT( void )
FT_Done_Glyph( FT_Glyph glyph );
/* */
/* other helpful functions */
/*************************************************************************/
/* */
/* <Section> */
/* computations */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Matrix_Multiply */
/* */
/* <Description> */
/* Performs the matrix operation `b = a*b'. */
/* */
/* <Input> */
/* a :: A pointer to matrix `a'. */
/* */
/* <InOut> */
/* b :: A pointer to matrix `b'. */
/* */
/* <Note> */
/* The result is undefined if either `a' or `b' is zero. */
/* */
FT_EXPORT( void )
FT_Matrix_Multiply( const FT_Matrix* a,
FT_Matrix* b );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Matrix_Invert */
/* */
/* <Description> */
/* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */
/* */
/* <InOut> */
/* matrix :: A pointer to the target matrix. Remains untouched in */
/* case of error. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Matrix_Invert( FT_Matrix* matrix );
/* */
FT_END_HEADER
#endif /* __FTGLYPH_H__ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/***************************************************************************/
/* */
/* ftgxval.h */
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004, 2005, 2006 by */
/* Masatake YAMATO, Redhat K.K, */
/* 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. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
#ifndef __FTGXVAL_H__
#define __FTGXVAL_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* gx_validation */
/* */
/* <Title> */
/* TrueTypeGX/AAT Validation */
/* */
/* <Abstract> */
/* An API to validate TrueTypeGX/AAT tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
/* trak, prop, lcar). */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* */
/* Warning: Use FT_VALIDATE_XXX to validate a table. */
/* Following definitions are for gxvalid developers. */
/* */
/* */
/*************************************************************************/
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
#define FT_VALIDATE_morx_INDEX 2
#define FT_VALIDATE_bsln_INDEX 3
#define FT_VALIDATE_just_INDEX 4
#define FT_VALIDATE_kern_INDEX 5
#define FT_VALIDATE_opbd_INDEX 6
#define FT_VALIDATE_trak_INDEX 7
#define FT_VALIDATE_prop_INDEX 8
#define FT_VALIDATE_lcar_INDEX 9
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
/*************************************************************************
*
* @macro:
* FT_VALIDATE_GX_LENGTH
*
* @description:
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
/* */
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
*
* @enum:
* FT_VALIDATE_GXXXX
*
* @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated.
*
* @values:
* FT_VALIDATE_feat ::
* Validate `feat' table.
*
* FT_VALIDATE_mort ::
* Validate `mort' table.
*
* FT_VALIDATE_morx ::
* Validate `morx' table.
*
* FT_VALIDATE_bsln ::
* Validate `bsln' table.
*
* FT_VALIDATE_just ::
* Validate `just' table.
*
* FT_VALIDATE_kern ::
* Validate `kern' table.
*
* FT_VALIDATE_opbd ::
* Validate `opbd' table.
*
* FT_VALIDATE_trak ::
* Validate `trak' table.
*
* FT_VALIDATE_prop ::
* Validate `prop' table.
*
* FT_VALIDATE_lcar ::
* Validate `lcar' table.
*
* FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar).
*
*/
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
FT_VALIDATE_mort | \
FT_VALIDATE_morx | \
FT_VALIDATE_bsln | \
FT_VALIDATE_just | \
FT_VALIDATE_kern | \
FT_VALIDATE_opbd | \
FT_VALIDATE_trak | \
FT_VALIDATE_prop | \
FT_VALIDATE_lcar )
/* */
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Validate
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed.
*
* @output:
* tables ::
* The array where all validated sfnt tables are stored.
* The array itself must be allocated by a client.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
* indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table.
*/
FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
FT_UInt table_length );
/* */
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Free
*
* @description:
* Free the buffer allocated by TrueTypeGX validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer allocated by
* @FT_TrueTypeGX_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only.
*/
FT_EXPORT( void )
FT_TrueTypeGX_Free( FT_Face face,
FT_Bytes table );
/* */
/**********************************************************************
*
* @enum:
* FT_VALIDATE_CKERNXXX
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate
* to indicate the classic kern dialect or dialects. If the selected
* type doesn't fit, @FT_ClassicKern_Validate regards the table as
* invalid.
*
* @values:
* FT_VALIDATE_MS ::
* Handle the `kern' table as a classic Microsoft kern table.
*
* FT_VALIDATE_APPLE ::
* Handle the `kern' table as a classic Apple kern table.
*
* FT_VALIDATE_CKERN ::
* Handle the `kern' as either classic Apple or Microsoft kern table.
*/
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/* */
/**********************************************************************
*
* @function:
* FT_ClassicKern_Validate
*
* @description:
* Validate classic (16bit format) kern table to assure that the offsets
* and indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32bit format and the classic 16bit format, while
* FT_ClassicKern_Validate only supports the classic 16bit format.
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
* ckern_table ::
* A pointer to the kern table.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* After use, the application should deallocate the buffers pointed to by
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
* indicates that the table doesn't exist in the font.
*/
FT_EXPORT( FT_Error )
FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *ckern_table );
/* */
/**********************************************************************
*
* @function:
* FT_ClassicKern_Free
*
* @description:
* Free the buffer allocated by classic Kern validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only.
*/
FT_EXPORT( void )
FT_ClassicKern_Free( FT_Face face,
FT_Bytes table );
/* */
FT_END_HEADER
#endif /* __FTGXVAL_H__ */
/* END */
/***************************************************************************/
/* */
/* ftgzip.h */
/* */
/* Gzip-compressed stream support. */
/* */
/* Copyright 2002, 2003, 2004, 2006 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 __FTGZIP_H__
#define __FTGZIP_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* gzip */
/* */
/* <Title> */
/* GZIP Streams */
/* */
/* <Abstract> */
/* Using gzip-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of Gzip-specific functions. */
/* */
/*************************************************************************/
/************************************************************************
*
* @function:
* FT_Stream_OpenGzip
*
* @description:
* Open a new stream to parse gzip-compressed font files. This is
* mainly used to support the compressed `*.pcf.gz' fonts that come
* with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from
* it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenGzip( FT_Stream stream,
FT_Stream source );
/* */
FT_END_HEADER
#endif /* __FTGZIP_H__ */
/* END */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment