зеркало из https://github.com/mozilla/pjs.git
Update to freetype 2.1.0 - not part of the build.
This commit is contained in:
Родитель
fa6d9c6a74
Коммит
1e632eef6d
|
@ -1,201 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcglyph.h */
|
||||
/* */
|
||||
/* FreeType abstract glyph cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Important: The functions defined in this file are only used to */
|
||||
/* implement an abstract glyph cache class. You need to */
|
||||
/* provide additional logic to implement a complete cache. */
|
||||
/* For example, see `ftcimage.h' and `ftcimage.c' which */
|
||||
/* implement a FT_Glyph cache based on this code. */
|
||||
/* */
|
||||
/* NOTE: For now, each glyph set is implemented as a static hash table. */
|
||||
/* It would be interesting to experiment with dynamic hashes to */
|
||||
/* see whether this improves performance or not (I don't know why */
|
||||
/* but something tells me it won't). */
|
||||
/* */
|
||||
/* In all cases, this change should not affect any derived glyph */
|
||||
/* cache class. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/********* *********/
|
||||
/********* WARNING, THIS IS BETA CODE. *********/
|
||||
/********* *********/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCGLYPH_H__
|
||||
#define __FTCGLYPH_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_MANAGER_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* each glyph set is characterized by a "glyph set type" which must be */
|
||||
/* defined by sub-classes */
|
||||
typedef struct FTC_GlyphFamilyRec_* FTC_GlyphFamily;
|
||||
|
||||
/* handle to a glyph cache node */
|
||||
typedef struct FTC_GlyphNodeRec_* FTC_GlyphNode;
|
||||
|
||||
|
||||
/* size should be 24 + chunk size on 32-bit machines; */
|
||||
/* note that the node's hash is ((gfam->hash << 16) | glyph_index) -- */
|
||||
/* this _must_ be set properly by the glyph node initializer */
|
||||
/* */
|
||||
typedef struct FTC_GlyphNodeRec_
|
||||
{
|
||||
FTC_NodeRec node;
|
||||
FT_UShort item_count;
|
||||
FT_UShort item_start;
|
||||
|
||||
} FTC_GlyphNodeRec;
|
||||
|
||||
|
||||
#define FTC_GLYPH_NODE( x ) ( (FTC_GlyphNode)(x) )
|
||||
#define FTC_GLYPH_NODE_P( x ) ( (FTC_GlyphNode*)(x) )
|
||||
|
||||
|
||||
typedef struct FTC_GlyphQueryRec_
|
||||
{
|
||||
FTC_QueryRec query;
|
||||
FT_UInt gindex;
|
||||
|
||||
} FTC_GlyphQueryRec, *FTC_GlyphQuery;
|
||||
|
||||
|
||||
#define FTC_GLYPH_QUERY( x ) ( (FTC_GlyphQuery)(x) )
|
||||
|
||||
|
||||
/* a glyph set is used to categorize glyphs of a given type */
|
||||
typedef struct FTC_GlyphFamilyRec_
|
||||
{
|
||||
FTC_FamilyRec family;
|
||||
FT_UInt32 hash;
|
||||
FT_UInt item_total; /* total number of glyphs in family */
|
||||
FT_UInt item_count; /* number of glyph items per node */
|
||||
|
||||
} FTC_GlyphFamilyRec;
|
||||
|
||||
|
||||
#define FTC_GLYPH_FAMILY( x ) ( (FTC_GlyphFamily)(x) )
|
||||
#define FTC_GLYPH_FAMILY_P( x ) ( (FTC_GlyphFamily*)(x) )
|
||||
|
||||
#define FTC_GLYPH_FAMILY_MEMORY( x ) FTC_FAMILY(x)->cache->memory
|
||||
|
||||
|
||||
/* each glyph node contains a 'chunk' of glyph items; */
|
||||
/* translate a glyph index into a chunk index */
|
||||
#define FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) \
|
||||
( ( gindex ) / FTC_GLYPH_FAMILY( gfam )->item_count )
|
||||
|
||||
/* find a glyph index's chunk, and return its start index */
|
||||
#define FTC_GLYPH_FAMILY_START( gfam, gindex ) \
|
||||
( FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) * \
|
||||
FTC_GLYPH_FAMILY( gfam )->item_count )
|
||||
|
||||
/* compute a glyph request's hash value */
|
||||
#define FTC_GLYPH_FAMILY_HASH( gfam, gindex ) \
|
||||
( (FT_UFast)( \
|
||||
( FTC_GLYPH_FAMILY( gfam )->hash << 16 ) | \
|
||||
( FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) & 0xFFFF ) ) )
|
||||
|
||||
/* must be called in an FTC_Family_CompareFunc to update the query */
|
||||
/* whenever a glyph set is matched in the lookup, or when it */
|
||||
/* is created */
|
||||
#define FTC_GLYPH_FAMILY_FOUND( gfam, gquery ) \
|
||||
do \
|
||||
{ \
|
||||
FTC_QUERY( gquery )->family = FTC_FAMILY( gfam ); \
|
||||
FTC_QUERY( gquery )->hash = \
|
||||
FTC_GLYPH_FAMILY_HASH( gfam, \
|
||||
FTC_GLYPH_QUERY( gquery )->gindex ); \
|
||||
} while ( 0 )
|
||||
|
||||
/* retrieve glyph index of glyph node */
|
||||
#define FTC_GLYPH_NODE_GINDEX( x ) \
|
||||
( (FT_UInt)( FTC_GLYPH_NODE( x )->node.hash & 0xFFFF ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* These functions are exported so that they can be called from */
|
||||
/* user-provided cache classes; otherwise, they are really part of the */
|
||||
/* cache sub-system internals. */
|
||||
/* */
|
||||
|
||||
/* must be called by derived FTC_Node_InitFunc routines */
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_node_init( FTC_GlyphNode node,
|
||||
FT_UInt gindex, /* glyph index for node */
|
||||
FTC_GlyphFamily gfam );
|
||||
|
||||
/* returns TRUE iff the query's glyph index correspond to the node; */
|
||||
/* this assumes that the "family" and "hash" fields of the query are */
|
||||
/* already correctly set */
|
||||
FT_EXPORT( FT_Bool )
|
||||
ftc_glyph_node_compare( FTC_GlyphNode gnode,
|
||||
FTC_GlyphQuery gquery );
|
||||
|
||||
/* must be called by derived FTC_Node_DoneFunc routines */
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_node_done( FTC_GlyphNode node,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
/* must be called by derived FTC_Family_InitFunc; */
|
||||
/* calls "ftc_family_init" */
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_glyph_family_init( FTC_GlyphFamily gfam,
|
||||
FT_UInt32 hash,
|
||||
FT_UInt item_count,
|
||||
FT_UInt item_total,
|
||||
FTC_GlyphQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_family_done( FTC_GlyphFamily gfam );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCGLYPH_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,244 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcmanag.h */
|
||||
/* */
|
||||
/* FreeType Cache Manager (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A cache manager is in charge of the following: */
|
||||
/* */
|
||||
/* - Maintain a mapping between generic FTC_FaceIDs and live FT_Face */
|
||||
/* objects. The mapping itself is performed through a user-provided */
|
||||
/* callback. However, the manager maintains a small cache of FT_Face */
|
||||
/* and FT_Size objects in order to speed up things considerably. */
|
||||
/* */
|
||||
/* - Manage one or more cache objects. Each cache is in charge of */
|
||||
/* holding a varying number of `cache nodes'. Each cache node */
|
||||
/* represents a minimal amount of individually accessible cached */
|
||||
/* data. For example, a cache node can be an FT_Glyph image */
|
||||
/* containing a vector outline, or some glyph metrics, or anything */
|
||||
/* else. */
|
||||
/* */
|
||||
/* Each cache node has a certain size in bytes that is added to the */
|
||||
/* total amount of `cache memory' within the manager. */
|
||||
/* */
|
||||
/* All cache nodes are located in a global LRU list, where the oldest */
|
||||
/* node is at the tail of the list. */
|
||||
/* */
|
||||
/* Each node belongs to a single cache, and includes a reference */
|
||||
/* count to avoid destroying it (due to caching). */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/********* *********/
|
||||
/********* WARNING, THIS IS BETA CODE. *********/
|
||||
/********* *********/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCMANAG_H__
|
||||
#define __FTCMANAG_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_INTERNAL_LRU_H
|
||||
#include FT_CACHE_INTERNAL_CACHE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FTC_MAX_FACES_DEFAULT 2
|
||||
#define FTC_MAX_SIZES_DEFAULT 4
|
||||
#define FTC_MAX_BYTES_DEFAULT 200000L /* ~200kByte by default */
|
||||
|
||||
/* maximum number of caches registered in a single manager */
|
||||
#define FTC_MAX_CACHES 16
|
||||
|
||||
|
||||
typedef struct FTC_FamilyEntryRec_
|
||||
{
|
||||
FTC_Family family;
|
||||
FTC_Cache cache;
|
||||
FT_UInt index;
|
||||
FT_UInt link;
|
||||
|
||||
} FTC_FamilyEntryRec, *FTC_FamilyEntry;
|
||||
|
||||
|
||||
#define FTC_FAMILY_ENTRY_NONE ( (FT_UInt)-1 )
|
||||
|
||||
|
||||
typedef struct FTC_FamilyTableRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
FT_UInt size;
|
||||
FTC_FamilyEntry entries;
|
||||
FT_UInt free;
|
||||
|
||||
} FTC_FamilyTableRec, *FTC_FamilyTable;
|
||||
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_family_table_alloc( FTC_FamilyTable table,
|
||||
FT_Memory memory,
|
||||
FTC_FamilyEntry *aentry );
|
||||
|
||||
FT_EXPORT( void )
|
||||
ftc_family_table_free( FTC_FamilyTable table,
|
||||
FT_UInt index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_ManagerRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The cache manager structure. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* library :: A handle to a FreeType library instance. */
|
||||
/* */
|
||||
/* faces_list :: The lru list of @FT_Face objects in the cache. */
|
||||
/* */
|
||||
/* sizes_list :: The lru list of @FT_Size objects in the cache. */
|
||||
/* */
|
||||
/* max_weight :: The maximum cache pool weight. */
|
||||
/* */
|
||||
/* cur_weight :: The current cache pool weight. */
|
||||
/* */
|
||||
/* num_nodes :: The current number of nodes in the manager. */
|
||||
/* */
|
||||
/* nodes_list :: The global lru list of all cache nodes. */
|
||||
/* */
|
||||
/* caches :: A table of installed/registered cache objects. */
|
||||
/* */
|
||||
/* request_data :: User-provided data passed to the requester. */
|
||||
/* */
|
||||
/* request_face :: User-provided function used to implement a mapping */
|
||||
/* between abstract @FTC_FaceID values and real */
|
||||
/* @FT_Face objects. */
|
||||
/* */
|
||||
/* families :: Global table of families. */
|
||||
/* */
|
||||
typedef struct FTC_ManagerRec_
|
||||
{
|
||||
FT_Library library;
|
||||
FT_LruList faces_list;
|
||||
FT_LruList sizes_list;
|
||||
|
||||
FT_ULong max_weight;
|
||||
FT_ULong cur_weight;
|
||||
|
||||
FT_UInt num_nodes;
|
||||
FTC_Node nodes_list;
|
||||
|
||||
FTC_Cache caches[FTC_MAX_CACHES];
|
||||
|
||||
FT_Pointer request_data;
|
||||
FTC_Face_Requester request_face;
|
||||
|
||||
FTC_FamilyTableRec families;
|
||||
|
||||
} FTC_ManagerRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_Manager_Compress */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This function is used to check the state of the cache manager if */
|
||||
/* its `num_bytes' field is greater than its `max_bytes' field. It */
|
||||
/* will flush as many old cache nodes as possible (ignoring cache */
|
||||
/* nodes with a non-zero reference count). */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Client applications should not call this function directly. It is */
|
||||
/* normally invoked by specific cache implementations. */
|
||||
/* */
|
||||
/* The reason this function is exported is to allow client-specific */
|
||||
/* cache classes. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FTC_Manager_Compress( FTC_Manager manager );
|
||||
|
||||
|
||||
/* this must be used internally for the moment */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Register_Cache( FTC_Manager manager,
|
||||
FTC_Cache_Class clazz,
|
||||
FTC_Cache *acache );
|
||||
|
||||
|
||||
/* can be called to increment a node's reference count */
|
||||
FT_EXPORT( void )
|
||||
FTC_Node_Ref( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <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 );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCMANAG_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,326 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftconfig.h */
|
||||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 header file contains a number of macro definitions that are used */
|
||||
/* by the rest of the engine. Most of the macros here are automatically */
|
||||
/* determined at compile time, and you should not need to change it to */
|
||||
/* port FreeType, except to compile the library with a non-ANSI */
|
||||
/* compiler. */
|
||||
/* */
|
||||
/* Note however that if some specific modifications are needed, we */
|
||||
/* advise you to place a modified copy in your build directory. */
|
||||
/* */
|
||||
/* The build directory is usually `freetype/builds/<system>', and */
|
||||
/* contains system-specific files that are always included first when */
|
||||
/* building the library. */
|
||||
/* */
|
||||
/* This ANSI version should stay in `include/freetype/config'. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCONFIG_H__
|
||||
#define __FTCONFIG_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* These macros can be toggled to suit a specific system. The current */
|
||||
/* ones are defaults used to compile FreeType in an ANSI C environment */
|
||||
/* (16bit compilers are also supported). Copy this file to your own */
|
||||
/* `freetype/builds/<system>' directory, and edit it to port the engine. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* We use <limits.h> values to know the sizes of the types. */
|
||||
#include <limits.h>
|
||||
|
||||
/* The number of bytes in an `int' type. */
|
||||
#if UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT 4
|
||||
#elif UINT_MAX == 0xFFFFU
|
||||
#define FT_SIZEOF_INT 2
|
||||
#elif UINT_MAX > 0xFFFFFFFFU && UINT_MAX == 0xFFFFFFFFFFFFFFFFU
|
||||
#define FT_SIZEOF_INT 8
|
||||
#else
|
||||
#error "Unsupported number of bytes in `int' type!"
|
||||
#endif
|
||||
|
||||
/* The number of bytes in a `long' type. */
|
||||
#if ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG 4
|
||||
#elif ULONG_MAX > 0xFFFFFFFFU && ULONG_MAX == 0xFFFFFFFFFFFFFFFFU
|
||||
#define FT_SIZEOF_LONG 8
|
||||
#else
|
||||
#error "Unsupported number of bytes in `long' type!"
|
||||
#endif
|
||||
|
||||
|
||||
/* Preferred alignment of data */
|
||||
#define FT_ALIGNMENT 8
|
||||
|
||||
|
||||
/* UNUSED is a macro used to indicate that a given parameter is not used */
|
||||
/* -- this is only used to get rid of unpleasant compiler warnings */
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* AUTOMATIC CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* These macros are computed from the ones defined above. Don't touch */
|
||||
/* their definition, unless you know precisely what you are doing. No */
|
||||
/* porter should need to mess with them. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* IntN types */
|
||||
/* */
|
||||
/* Used to guarantee the size of some specific integers. */
|
||||
/* */
|
||||
typedef signed short FT_Int16;
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == 4
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
/* now, lookup for an integer type that is at least 32 bits */
|
||||
#if FT_SIZEOF_INT >= 4
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= 4
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit int type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == 8
|
||||
|
||||
/* FT_LONG64 must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
|
||||
#elif defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of __BORLANDC__ in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
/* I don't know if it provides 64-bit data types, any suggestion */
|
||||
/* is welcome. */
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the "long long" type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#endif /* !FT_LONG64 */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A 64-bit data type will create compilation problems if you compile */
|
||||
/* in strict ANSI mode. To avoid them, we disable their use if */
|
||||
/* __STDC__ is defined. You can however ignore this rule by */
|
||||
/* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
|
||||
/* */
|
||||
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#ifdef __STDC__
|
||||
|
||||
/* undefine the 64-bit macros in strict ANSI compilation mode */
|
||||
#undef FT_LONG64
|
||||
#undef FT_INT64
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
|
||||
|
||||
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#define FT_LOCAL static
|
||||
#define FT_LOCAL_DEF static
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_LOCAL extern "C"
|
||||
#define FT_LOCAL_DEF extern "C"
|
||||
#else
|
||||
#define FT_LOCAL extern
|
||||
#define FT_LOCAL_DEF extern
|
||||
#endif
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
|
||||
#ifndef FT_BASE
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE */
|
||||
|
||||
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_VAR
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_VAR( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_VAR( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_VAR */
|
||||
|
||||
/* The following macros are needed to compile the library with a */
|
||||
/* C++ compiler and with 16bit compilers. */
|
||||
/* */
|
||||
|
||||
/* This is special. Within C++, you must specify `extern "C"' for */
|
||||
/* functions which are used via function pointers, and you also */
|
||||
/* must do that for structures which contain function pointers to */
|
||||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
||||
/* functions which are accessed by (global) function pointers. */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_CALLBACK_DEF is used to _define_ a callback function. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
||||
/* contains pointers to callback functions. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
||||
/* that contains pointers to callback functions. */
|
||||
/* */
|
||||
/* */
|
||||
/* Some 16bit compilers have to redefine these macros to insert */
|
||||
/* the infamous `_cdecl' or `__fastcall' declarations. */
|
||||
/* */
|
||||
#ifndef FT_CALLBACK_DEF
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_DEF */
|
||||
|
||||
#ifndef FT_CALLBACK_TABLE
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
#else
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF /* nothing */
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_TABLE */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCONFIG_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,493 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftheader.h */
|
||||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FT_HEADER_H__
|
||||
#define __FT_HEADER_H__
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_BEGIN_HEADER */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used in association with @FT_END_HEADER in header */
|
||||
/* files to ensure that the declarations within are properly */
|
||||
/* encapsulated in an `extern "C" { .. }' block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
#define FT_BEGIN_HEADER extern "C" {
|
||||
#else
|
||||
#define FT_BEGIN_HEADER /* nothing */
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_END_HEADER */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used in association with @FT_BEGIN_HEADER in header */
|
||||
/* files to ensure that the declarations within are properly */
|
||||
/* encapsulated in an `extern "C" { .. }' block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
#define FT_END_HEADER }
|
||||
#else
|
||||
#define FT_END_HEADER /* nothing */
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Aliases for the FreeType 2 public and configuration files. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* header_file_macros */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Header File Macros */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* Macro definitions used to #include specific header files. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The following macros are defined to the name of specific */
|
||||
/* FreeType 2 header files. They can be used directly in #include */
|
||||
/* statements as in: */
|
||||
/* */
|
||||
/* { */
|
||||
/* #include FT_FREETYPE_H */
|
||||
/* #include FT_MULTIPLE_MASTERS_H */
|
||||
/* #include FT_GLYPH_H */
|
||||
/* } */
|
||||
/* */
|
||||
/* There are several reasons why we are now using macros to name */
|
||||
/* public header files. The first one is that such macros are not */
|
||||
/* limited to the infamous 8.3 naming rule required by DOS (and */
|
||||
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
|
||||
/* */
|
||||
/* The second reason is that is allows for more flexibility in the */
|
||||
/* way FreeType 2 is installed on a given system. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/* configuration files */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_CONFIG_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* FreeType 2 configuration data. */
|
||||
/* */
|
||||
#ifndef FT_CONFIG_CONFIG_H
|
||||
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_OPTIONS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* FreeType 2 project-specific configuration options. */
|
||||
/* */
|
||||
#ifndef FT_CONFIG_OPTIONS_H
|
||||
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_MODULES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list of FreeType 2 modules that are statically linked to new */
|
||||
/* library instances in @FT_Init_FreeType. */
|
||||
/* */
|
||||
#ifndef FT_CONFIG_MODULES_H
|
||||
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
|
||||
#endif
|
||||
|
||||
/* public headers */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_FREETYPE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the base FreeType 2 API. */
|
||||
/* */
|
||||
#define FT_FREETYPE_H <freetype/freetype.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ERRORS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list of FreeType 2 error codes (and messages). */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
#define FT_ERRORS_H <freetype/fterrors.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MODULE_ERRORS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list of FreeType 2 module error offsets (and messages). */
|
||||
/* */
|
||||
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_SYSTEM_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the FreeType 2 interface to low-level operations (i.e. memory */
|
||||
/* management and stream i/o). */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
#define FT_SYSTEM_H <freetype/ftsystem.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_IMAGE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* types definitions related to glyph images (i.e. bitmaps, outlines, */
|
||||
/* scan-converter parameters). */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
#define FT_IMAGE_H <freetype/ftimage.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TYPES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the basic data types defined by FreeType 2. */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
#define FT_TYPES_H <freetype/fttypes.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_LIST_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list management API of FreeType 2. */
|
||||
/* */
|
||||
/* (Most applications will never need to include this file.) */
|
||||
/* */
|
||||
#define FT_LIST_H <freetype/ftlist.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_OUTLINE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the scalable outline management API of FreeType 2. */
|
||||
/* */
|
||||
#define FT_OUTLINE_H <freetype/ftoutln.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_SIZES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API used to manage multiple @FT_Size objects per face. */
|
||||
/* */
|
||||
#define FT_SIZES_H <freetype/ftsizes.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MODULE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the module management API of FreeType 2. */
|
||||
/* */
|
||||
#define FT_MODULE_H <freetype/ftmodule.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_RENDER_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the renderer module management API of FreeType 2. */
|
||||
/* */
|
||||
#define FT_RENDER_H <freetype/ftrender.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TYPE1_TABLES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the types and API specific to the Type 1 format. */
|
||||
/* */
|
||||
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TRUETYPE_IDS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the enumeration values used to identify name strings, languages, */
|
||||
/* encodings, etc. This file really contains a _large_ set of */
|
||||
/* constant macro definitions, taken from the TrueType and OpenType */
|
||||
/* specifications. */
|
||||
/* */
|
||||
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TRUETYPE_TABLES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the types and API specific to the TrueType (as well as OpenType) */
|
||||
/* format. */
|
||||
/* */
|
||||
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TRUETYPE_TAGS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of TrueType 4-byte `tags' used to identify blocks */
|
||||
/* in SFNT-based font formats (i.e. TrueType and OpenType). */
|
||||
/* */
|
||||
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_GLYPH_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional glyph management component. */
|
||||
/* */
|
||||
#define FT_GLYPH_H <freetype/ftglyph.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_BBOX_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional exact bounding box computation routines. */
|
||||
/* */
|
||||
#define FT_BBOX_H <freetype/ftbbox.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_BEZIER_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* a small useful API to handle bezier arcs. Note that you _must_ */
|
||||
/* include FT_FREETYPE_H or FT_IMAGE_H before this header. */
|
||||
/* */
|
||||
#define FT_BEZIER_H <freetype/ftbezier.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
#define FT_CACHE_H <freetype/ftcache.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_IMAGE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `glyph image' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/* It is used to define a cache for @FT_Glyph elements. You can also */
|
||||
/* see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need */
|
||||
/* to store small glyph bitmaps, as it will use less memory. */
|
||||
/* */
|
||||
#define FT_CACHE_IMAGE_H <freetype/cache/ftcimage.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_SMALL_BITMAPS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `small bitmaps' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/* It is used to define a cache for small glyph bitmaps in a */
|
||||
/* relatively memory-efficient way. You can also use the API defined */
|
||||
/* in @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, */
|
||||
/* including scalable outlines. */
|
||||
/* */
|
||||
#define FT_CACHE_SMALL_BITMAPS_H <freetype/cache/ftcsbits.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_CHARMAP_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `charmap' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
#define FT_CACHE_CHARMAP_H <freetype/cache/ftccmap.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MAC_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the Macintosh-specific FreeType 2 API. The latter is used to */
|
||||
/* access fonts embedded in resource forks. */
|
||||
/* */
|
||||
/* This header file must be explicitly included by client */
|
||||
/* applications compiled on the Mac (note that the base API still */
|
||||
/* works though). */
|
||||
/* */
|
||||
#define FT_MAC_H <freetype/ftmac.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MULTIPLE_MASTERS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the optional multiple-masters management API of FreeType 2. */
|
||||
/* */
|
||||
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_SFNT_NAMES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the optional FreeType 2 API used to access embedded `name' strings */
|
||||
/* in SFNT-based font formats (i.e. TrueType and OpenType). */
|
||||
/* */
|
||||
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
|
||||
|
||||
/* */
|
||||
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
|
||||
#define FT_CACHE_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
|
||||
#define FT_CACHE_INTERNAL_LRU_H <freetype/cache/ftlru.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/cache/ftcglyph.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/cache/ftccache.h>
|
||||
|
||||
/* now include internal headers definitions from <freetype/internal/...> */
|
||||
|
||||
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
|
||||
#include FT_INTERNAL_INTERNAL_H
|
||||
|
||||
|
||||
#endif /* __FT2_BUILD_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,464 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftoption.h */
|
||||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Convenience functions support */
|
||||
/* */
|
||||
/* Some functions of the FreeType 2 API are provided as a convenience */
|
||||
/* for client applications and developers. However, they are not */
|
||||
/* required to build and run the library itself. */
|
||||
/* */
|
||||
/* By defining this configuration macro, you'll disable the */
|
||||
/* compilation of these functions at build time. This can be useful */
|
||||
/* to reduce the library's code size when you don't need any of */
|
||||
/* these functions. */
|
||||
/* */
|
||||
/* All convenience functions are declared as such in their */
|
||||
/* documentation. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Alternate Glyph Image Format support */
|
||||
/* */
|
||||
/* By default, the glyph images returned by the FreeType glyph loader */
|
||||
/* can either be a pixmap or a vectorial outline defined through */
|
||||
/* Bezier control points. When defining the following configuration */
|
||||
/* macro, some font drivers will be able to register alternate */
|
||||
/* glyph image formats. */
|
||||
/* */
|
||||
/* Unset this macro if you are sure that you will never use a font */
|
||||
/* driver with an alternate glyph format; this will reduce the size of */
|
||||
/* the base layer code. */
|
||||
/* */
|
||||
/* Note that a few Type 1 fonts, as well as Windows `vector' fonts */
|
||||
/* use a vector `plotter' format that isn't supported when this */
|
||||
/* macro is undefined. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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 ints is normally disabled when */
|
||||
/* the __STDC__ macro is defined. You can however disable this by */
|
||||
/* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */
|
||||
/* */
|
||||
/* 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 Autoconf */
|
||||
/* on platforms that support it. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_FORCE_INT64
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
#undef FT_EXPORT
|
||||
#undef FT_EXPORT_DEF
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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! */
|
||||
/* */
|
||||
#undef FT_DEBUG_LEVEL_ERROR
|
||||
#undef 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 "FT_DEBUG_MEMORY" is also defined! */
|
||||
/* */
|
||||
#undef FT_DEBUG_MEMORY
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Computation Algorithms */
|
||||
/* */
|
||||
/* Used for debugging, this configuration macro should disappear */
|
||||
/* soon. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
#define FT_RENDER_POOL_SIZE 32768L
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MAX_MODULES */
|
||||
/* */
|
||||
/* The maximum number of modules that can be registered in a single */
|
||||
/* FreeType library object. 16 is the default. */
|
||||
/* */
|
||||
#define FT_MAX_MODULES 16
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MAX_EXTENSIONS */
|
||||
/* */
|
||||
/* The maximum number of extensions that can be registered in a single */
|
||||
/* font driver. 8 is the default. */
|
||||
/* */
|
||||
/* If you don't know what this means, you certainly do not need to */
|
||||
/* change this value. */
|
||||
/* */
|
||||
#define FT_MAX_EXTENSIONS 8
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** 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
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** 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. */
|
||||
/* */
|
||||
#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** 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 T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate a */
|
||||
/* driver with no hinter. This can be useful to debug the parser. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_DISABLE_HINTER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTOPTION_H__ */
|
||||
|
||||
|
||||
/* END */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,383 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* fterrors.h */
|
||||
/* */
|
||||
/* FreeType error codes (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 special header file is used to define the FT2 enumeration */
|
||||
/* constants. It can also be used to generate error message strings */
|
||||
/* with a small macro trick explained below. */
|
||||
/* */
|
||||
/* I - Error Formats */
|
||||
/* ----------------- */
|
||||
/* */
|
||||
/* Since release 2.1, the error constants have changed. The lower */
|
||||
/* byte of the error value gives the "generic" error code, while the */
|
||||
/* higher byte indicates in which module the error occured. */
|
||||
/* */
|
||||
/* You can use the macro FT_ERROR_BASE(x) macro to extract the generic */
|
||||
/* error code from an FT_Error value. */
|
||||
/* */
|
||||
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
|
||||
/* undefined in ftoption.h in order to make the higher byte always */
|
||||
/* zero, in case you need to be compatible with previous versions of */
|
||||
/* FreeType 2. */
|
||||
/* */
|
||||
/* */
|
||||
/* II - Error Message strings */
|
||||
/* -------------------------- */
|
||||
/* */
|
||||
/* The error definitions below are made through special macros that */
|
||||
/* allow client applications to build a table of error message strings */
|
||||
/* if they need it. The strings are not included in a normal build of */
|
||||
/* FreeType 2 to save space (most client applications do not use */
|
||||
/* them). */
|
||||
/* */
|
||||
/* To do so, you have to define the following macros before including */
|
||||
/* this file: */
|
||||
/* */
|
||||
/* FT_ERROR_START_LIST :: */
|
||||
/* This macro is called before anything else to define the start of */
|
||||
/* the error list. It is followed by several FT_ERROR_DEF calls */
|
||||
/* (see below). */
|
||||
/* */
|
||||
/* FT_ERROR_DEF( e, v, s ) :: */
|
||||
/* This macro is called to define one single error. */
|
||||
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
|
||||
/* `v' is the error numerical value. */
|
||||
/* `s' is the corresponding error string. */
|
||||
/* */
|
||||
/* FT_ERROR_END_LIST :: */
|
||||
/* This macro ends the list. */
|
||||
/* */
|
||||
/* Additionally, you have to undefine __FTERRORS_H__ before #including */
|
||||
/* this file. */
|
||||
/* */
|
||||
/* Here is a simple example: */
|
||||
/* */
|
||||
/* { */
|
||||
/* #undef __FTERRORS_H__ */
|
||||
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
|
||||
/* #define FT_ERROR_START_LIST { */
|
||||
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
|
||||
/* */
|
||||
/* const struct */
|
||||
/* { */
|
||||
/* int err_code; */
|
||||
/* const char* err_msg */
|
||||
/* } ft_errors[] = */
|
||||
/* */
|
||||
/* #include FT_ERRORS_H */
|
||||
/* } */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTERRORS_H__
|
||||
#define __FTERRORS_H__
|
||||
|
||||
|
||||
/* include module base error codes */
|
||||
#include FT_MODULE_ERRORS_H
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
/***** *****/
|
||||
/***** SETUP MACROS *****/
|
||||
/***** *****/
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
#undef FT_NEED_EXTERN_C
|
||||
#define FT_ERR_XCAT( x, y ) x ## y
|
||||
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
|
||||
|
||||
|
||||
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
|
||||
/* By default, we use `FT_Err_'. */
|
||||
/* */
|
||||
#ifndef FT_ERR_PREFIX
|
||||
#define FT_ERR_PREFIX FT_Err_
|
||||
#endif
|
||||
|
||||
|
||||
/* FT_ERR_BASE is used as the base for module-specific errors. */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
|
||||
|
||||
#ifndef FT_ERR_BASE
|
||||
#define FT_ERR_BASE FT_Mod_Err_Base
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#undef FT_ERR_BASE
|
||||
#define FT_ERR_BASE 0
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
|
||||
|
||||
|
||||
/* If FT_ERRORDEF is not defined, we need to define a simple */
|
||||
/* enumeration type. */
|
||||
/* */
|
||||
#ifndef FT_ERRORDEF
|
||||
|
||||
#define FT_ERRORDEF( e, v, s ) e = v,
|
||||
#define FT_ERROR_START_LIST enum {
|
||||
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_NEED_EXTERN_C
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#endif /* !FT_ERRORDEF */
|
||||
|
||||
|
||||
/* this macro is used to define an error */
|
||||
#define FT_ERRORDEF_( e, v, s ) \
|
||||
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
|
||||
|
||||
/* this is only used for FT_Err_Ok, which must be 0! */
|
||||
#define FT_NOERRORDEF_( e, v, s ) \
|
||||
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
/***** *****/
|
||||
/***** LIST OF ERROR CODES/MESSAGES *****/
|
||||
/***** *****/
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
#ifdef FT_ERROR_START_LIST
|
||||
FT_ERROR_START_LIST
|
||||
#endif
|
||||
|
||||
|
||||
/* generic errors */
|
||||
|
||||
FT_NOERRORDEF_( Ok, 0x00, \
|
||||
"no error" )
|
||||
|
||||
FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
|
||||
"cannot open resource" )
|
||||
FT_ERRORDEF_( Unknown_File_Format, 0x02, \
|
||||
"unknown file format" )
|
||||
FT_ERRORDEF_( Invalid_File_Format, 0x03, \
|
||||
"broken file" )
|
||||
FT_ERRORDEF_( Invalid_Version, 0x04, \
|
||||
"invalid FreeType version" )
|
||||
FT_ERRORDEF_( Lower_Module_Version, 0x05, \
|
||||
"module version is too low" )
|
||||
FT_ERRORDEF_( Invalid_Argument, 0x06, \
|
||||
"invalid argument" )
|
||||
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
|
||||
"unimplemented feature" )
|
||||
|
||||
/* glyph/character errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
|
||||
"invalid glyph index" )
|
||||
FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
|
||||
"invalid character code" )
|
||||
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
|
||||
"unsupported glyph image format" )
|
||||
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
|
||||
"cannot render this glyph format" )
|
||||
FT_ERRORDEF_( Invalid_Outline, 0x14, \
|
||||
"invalid outline" )
|
||||
FT_ERRORDEF_( Invalid_Composite, 0x15, \
|
||||
"invalid composite glyph" )
|
||||
FT_ERRORDEF_( Too_Many_Hints, 0x16, \
|
||||
"too many hints" )
|
||||
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
|
||||
"invalid pixel size" )
|
||||
|
||||
/* handle errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Handle, 0x20, \
|
||||
"invalid object handle" )
|
||||
FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
|
||||
"invalid library handle" )
|
||||
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
|
||||
"invalid module handle" )
|
||||
FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
|
||||
"invalid face handle" )
|
||||
FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
|
||||
"invalid size handle" )
|
||||
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
|
||||
"invalid glyph slot handle" )
|
||||
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
|
||||
"invalid charmap handle" )
|
||||
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
|
||||
"invalid cache manager handle" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
|
||||
"invalid stream handle" )
|
||||
|
||||
/* driver errors */
|
||||
|
||||
FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
|
||||
"too many modules" )
|
||||
FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
|
||||
"too many extensions" )
|
||||
|
||||
/* memory errors */
|
||||
|
||||
FT_ERRORDEF_( Out_Of_Memory, 0x40, \
|
||||
"out of memory" )
|
||||
FT_ERRORDEF_( Unlisted_Object, 0x41, \
|
||||
"unlisted object" )
|
||||
|
||||
/* stream errors */
|
||||
|
||||
FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
|
||||
"cannot open stream" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
|
||||
"invalid stream seek" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
|
||||
"invalid stream skip" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
|
||||
"invalid stream read" )
|
||||
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
|
||||
"invalid stream operation" )
|
||||
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
|
||||
"invalid frame operation" )
|
||||
FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
|
||||
"nested frame access" )
|
||||
FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
|
||||
"invalid frame read" )
|
||||
|
||||
/* raster errors */
|
||||
|
||||
FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
|
||||
"raster uninitialized" )
|
||||
FT_ERRORDEF_( Raster_Corrupted, 0x61, \
|
||||
"raster corrupted" )
|
||||
FT_ERRORDEF_( Raster_Overflow, 0x62, \
|
||||
"raster overflow" )
|
||||
FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
|
||||
"negative height while rastering" )
|
||||
|
||||
/* cache errors */
|
||||
|
||||
FT_ERRORDEF_( Too_Many_Caches, 0x70, \
|
||||
"too many registered caches" )
|
||||
|
||||
/* TrueType and SFNT errors */
|
||||
|
||||
FT_ERRORDEF_( Invalid_Opcode, 0x80, \
|
||||
"invalid opcode" )
|
||||
FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
|
||||
"too few arguments" )
|
||||
FT_ERRORDEF_( Stack_Overflow, 0x82, \
|
||||
"stack overflow" )
|
||||
FT_ERRORDEF_( Code_Overflow, 0x83, \
|
||||
"code overflow" )
|
||||
FT_ERRORDEF_( Bad_Argument, 0x84, \
|
||||
"bad argument" )
|
||||
FT_ERRORDEF_( Divide_By_Zero, 0x85, \
|
||||
"division by zero" )
|
||||
FT_ERRORDEF_( Invalid_Reference, 0x86, \
|
||||
"invalid reference" )
|
||||
FT_ERRORDEF_( Debug_OpCode, 0x87, \
|
||||
"found debug opcode" )
|
||||
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
|
||||
"found ENDF opcode in execution stream" )
|
||||
FT_ERRORDEF_( Nested_DEFS, 0x89, \
|
||||
"nested DEFS" )
|
||||
FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
|
||||
"invalid code range" )
|
||||
FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
|
||||
"execution context too long" )
|
||||
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
|
||||
"too many function definitions" )
|
||||
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
|
||||
"too many instruction definitions" )
|
||||
FT_ERRORDEF_( Table_Missing, 0x8E, \
|
||||
"SFNT font table missing" )
|
||||
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
|
||||
"horizontal header (hhea) table missing" )
|
||||
FT_ERRORDEF_( Locations_Missing, 0x90, \
|
||||
"locations (loca) table missing" )
|
||||
FT_ERRORDEF_( Name_Table_Missing, 0x91, \
|
||||
"name table missing" )
|
||||
FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
|
||||
"character map (cmap) table missing" )
|
||||
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
|
||||
"horizontal metrics (hmtx) table missing" )
|
||||
FT_ERRORDEF_( Post_Table_Missing, 0x94, \
|
||||
"PostScript (post) table missing" )
|
||||
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
|
||||
"invalid horizontal metrics" )
|
||||
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
|
||||
"invalid character map (cmap) format" )
|
||||
FT_ERRORDEF_( Invalid_PPem, 0x97, \
|
||||
"invalid ppem value" )
|
||||
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
|
||||
"invalid vertical metrics" )
|
||||
FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
|
||||
"could not find context" )
|
||||
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
|
||||
"invalid PostScript (post) table format" )
|
||||
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
|
||||
"invalid PostScript (post) table" )
|
||||
|
||||
/* CFF, CID, and Type 1 errors */
|
||||
|
||||
FT_ERRORDEF_( Syntax_Error, 0xA0, \
|
||||
"opcode syntax error" )
|
||||
FT_ERRORDEF_( Stack_Underflow, 0xA1, \
|
||||
"argument stack underflow" )
|
||||
|
||||
|
||||
#ifdef FT_ERROR_END_LIST
|
||||
FT_ERROR_END_LIST
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
/***** *****/
|
||||
/***** SIMPLE CLEANUP *****/
|
||||
/***** *****/
|
||||
/*******************************************************************/
|
||||
/*******************************************************************/
|
||||
|
||||
#ifdef FT_NEED_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef FT_ERROR_START_LIST
|
||||
#undef FT_ERROR_END_LIST
|
||||
|
||||
#undef FT_ERRORDEF
|
||||
#undef FT_ERRORDEF_
|
||||
#undef FT_NOERRORDEF_
|
||||
|
||||
#undef FT_NEED_EXTERN_C
|
||||
#undef FT_ERR_PREFIX
|
||||
#undef FT_ERR_BASE
|
||||
#undef FT_ERR_CONCAT
|
||||
|
||||
#endif /* __FTERRORS_H__ */
|
||||
|
||||
/* END */
|
|
@ -1,161 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftsnames.h */
|
||||
/* */
|
||||
/* Simple interface to access SFNT name tables (which are used */
|
||||
/* to hold font names, copyright info, notices, etc.) (specification). */
|
||||
/* */
|
||||
/* This is _not_ used to retrieve glyph names! */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FT_SFNT_NAMES_H__
|
||||
#define __FT_SFNT_NAMES_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* sfnt_names */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* SFNT Names */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* Access the names embedded in TrueType and OpenType files. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The TrueType and OpenType specification allow the inclusion of */
|
||||
/* a special `names table' in font files. This table contains */
|
||||
/* textual (and internationalized) information regarding the font, */
|
||||
/* like family name, copyright, version, etc. */
|
||||
/* */
|
||||
/* The definitions below are used to access them if available. */
|
||||
/* */
|
||||
/* Note that this has nothing to do with glyph names! */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_SfntName */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model an SFNT `name' table entry. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* platform_id :: The platform ID for `string'. */
|
||||
/* */
|
||||
/* encoding_id :: The encoding ID for `string'. */
|
||||
/* */
|
||||
/* language_id :: The language ID for `string'. */
|
||||
/* */
|
||||
/* name_id :: An identifier for `string'. */
|
||||
/* */
|
||||
/* string :: The `name' string. Note that its format differs */
|
||||
/* depending on the (platform,encoding) pair. It can */
|
||||
/* be a Pascal String, a UTF-16 one, etc.. */
|
||||
/* */
|
||||
/* Generally speaking, the string is not */
|
||||
/* zero-terminated. Please refer to the TrueType */
|
||||
/* specification for details.. */
|
||||
/* */
|
||||
/* string_len :: The length of `string' in bytes. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Possible values for `platform_id', `encoding_id', `language_id', */
|
||||
/* and `name_id' are given in the file `ttnameid.h'. For details */
|
||||
/* please refer to the TrueType or OpenType specification. */
|
||||
/* */
|
||||
typedef struct FT_SfntName_
|
||||
{
|
||||
FT_UShort platform_id;
|
||||
FT_UShort encoding_id;
|
||||
FT_UShort language_id;
|
||||
FT_UShort name_id;
|
||||
|
||||
FT_Byte* string; /* this string is *not* null-terminated! */
|
||||
FT_UInt string_len; /* in bytes */
|
||||
|
||||
} FT_SfntName;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Sfnt_Name_Count */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the number of name strings in the SFNT `name' table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The number of strings in the `name' table. */
|
||||
/* */
|
||||
FT_EXPORT( FT_UInt )
|
||||
FT_Get_Sfnt_Name_Count( FT_Face face );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Sfnt_Name */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves a string of the SFNT `name' table for a given index. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* index :: The index of the `name' string. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aname :: The indexed FT_SfntName structure. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The `string' array returned in the `aname' structure is not */
|
||||
/* null-terminated. */
|
||||
/* */
|
||||
/* Use FT_Get_Sfnt_Name_Count() to get the total number of available */
|
||||
/* `name' table entries, then do a loop until you get the right */
|
||||
/* platform, encoding, and name ID. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_Sfnt_Name( FT_Face face,
|
||||
FT_UInt index,
|
||||
FT_SfntName *aname );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_SFNT_NAMES_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,307 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftsystem.h */
|
||||
/* */
|
||||
/* FreeType low-level system interface definition (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FTSYSTEM_H__
|
||||
#define __FTSYSTEM_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* system_interface */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* System Interface */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* How FreeType manages memory and i/o. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains various definitions related to memory */
|
||||
/* management and i/o access. You need to understand this */
|
||||
/* information if you want to use a custom memory manager or you own */
|
||||
/* input i/o streams. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* M E M O R Y M A N A G E M E N T */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Memory */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to a given memory manager object, defined with a */
|
||||
/* @FT_MemoryRec structure. */
|
||||
/* */
|
||||
typedef struct FT_MemoryRec_* FT_Memory;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Alloc_Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to allocate `size' bytes from `memory'. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* memory :: A handle to the source memory manager. */
|
||||
/* */
|
||||
/* size :: The size in bytes to allocate. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Address of new memory block. 0 in case of failure. */
|
||||
/* */
|
||||
typedef void*
|
||||
(*FT_Alloc_Func)( FT_Memory memory,
|
||||
long size );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Free_Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to release a given block of memory. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* memory :: A handle to the source memory manager. */
|
||||
/* */
|
||||
/* block :: The address of the target memory block. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_Free_Func)( FT_Memory memory,
|
||||
void* block );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Realloc_Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* a function used to re-allocate a given block of memory. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* memory :: A handle to the source memory manager. */
|
||||
/* */
|
||||
/* cur_size :: The block's current size in bytes. */
|
||||
/* */
|
||||
/* new_size :: The block's requested new size. */
|
||||
/* */
|
||||
/* block :: The block's current address. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* New block address. 0 in case of memory shortage. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* In case of error, the old block must still be available. */
|
||||
/* */
|
||||
typedef void*
|
||||
(*FT_Realloc_Func)( FT_Memory memory,
|
||||
long cur_size,
|
||||
long new_size,
|
||||
void* block );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FT_MemoryRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure used to describe a given memory manager to FreeType 2. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* user :: A generic typeless pointer for user data. */
|
||||
/* */
|
||||
/* alloc :: A pointer type to an allocation function. */
|
||||
/* */
|
||||
/* free :: A pointer type to an memory freeing function. */
|
||||
/* */
|
||||
/* realloc :: A pointer type to a reallocation function. */
|
||||
/* */
|
||||
struct FT_MemoryRec_
|
||||
{
|
||||
void* user;
|
||||
FT_Alloc_Func alloc;
|
||||
FT_Free_Func free;
|
||||
FT_Realloc_Func realloc;
|
||||
};
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* I / O M A N A G E M E N T */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Stream */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to an input stream. */
|
||||
/* */
|
||||
typedef struct FT_StreamRec_* FT_Stream;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FT_StreamDesc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* 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. */
|
||||
/* */
|
||||
typedef union FT_StreamDesc_
|
||||
{
|
||||
long value;
|
||||
void* pointer;
|
||||
|
||||
} FT_StreamDesc;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Stream_IO */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to seek and read data from a given input stream. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* stream :: A handle to the source stream. */
|
||||
/* */
|
||||
/* offset :: The offset of read in stream (always from start). */
|
||||
/* */
|
||||
/* buffer :: The address of the read buffer. */
|
||||
/* */
|
||||
/* count :: The number of bytes to read from the stream. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The number of bytes effectively read by the stream. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* This function might be called to perform a seek or skip operation */
|
||||
/* with a `count' of 0. */
|
||||
/* */
|
||||
typedef unsigned long
|
||||
(*FT_Stream_IO)( FT_Stream stream,
|
||||
unsigned long offset,
|
||||
unsigned char* buffer,
|
||||
unsigned long count );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Stream_Close */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to close a given input stream. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* stream :: A handle to the target stream. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_Stream_Close)( FT_Stream stream );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FT_StreamRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure used to describe an input stream. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* base :: For memory-based streams, this is the address of the */
|
||||
/* first stream byte in memory. This field should */
|
||||
/* always be set to NULL for disk-based streams. */
|
||||
/* */
|
||||
/* size :: The stream size in bytes. */
|
||||
/* */
|
||||
/* pos :: The current position within the stream. */
|
||||
/* */
|
||||
/* descriptor :: 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* pointers. */
|
||||
/* */
|
||||
/* pathname :: This field is completely ignored by FreeType. */
|
||||
/* However, it is often useful during debugging to use */
|
||||
/* it to store the stream's filename (where available). */
|
||||
/* */
|
||||
/* read :: The stream's input function. */
|
||||
/* */
|
||||
/* close :: The stream;s close function. */
|
||||
/* */
|
||||
/* memory :: The memory manager to use to preload frames. This is */
|
||||
/* set internally by FreeType and shouldn't be touched */
|
||||
/* by stream implementations. */
|
||||
/* */
|
||||
/* cursor :: This field is set and used internally by FreeType */
|
||||
/* when parsing frames. */
|
||||
/* */
|
||||
/* limit :: This field is set and used internally by FreeType */
|
||||
/* when parsing frames. */
|
||||
/* */
|
||||
struct FT_StreamRec_
|
||||
{
|
||||
unsigned char* base;
|
||||
unsigned long size;
|
||||
unsigned long pos;
|
||||
|
||||
FT_StreamDesc descriptor;
|
||||
FT_StreamDesc pathname;
|
||||
FT_Stream_IO read;
|
||||
FT_Stream_Close close;
|
||||
|
||||
FT_Memory memory;
|
||||
unsigned char* cursor;
|
||||
unsigned char* limit;
|
||||
};
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSYSTEM_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,204 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* autohint.h */
|
||||
/* */
|
||||
/* High-level `autohint' module-specific interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The auto-hinter is used to load and automatically hint glyphs if a */
|
||||
/* format-specific hinter isn't available. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AUTOHINT_H__
|
||||
#define __AUTOHINT_H__
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A small technical note regarding automatic hinting in order to */
|
||||
/* clarify this module interface. */
|
||||
/* */
|
||||
/* An automatic hinter might compute two kinds of data for a given face: */
|
||||
/* */
|
||||
/* - global hints: Usually some metrics that describe global properties */
|
||||
/* of the face. It is computed by scanning more or less */
|
||||
/* agressively the glyphs in the face, and thus can be */
|
||||
/* very slow to compute (even if the size of global */
|
||||
/* hints is really small). */
|
||||
/* */
|
||||
/* - glyph hints: These describe some important features of the glyph */
|
||||
/* outline, as well as how to align them. They are */
|
||||
/* generally much faster to compute than global hints. */
|
||||
/* */
|
||||
/* The current FreeType auto-hinter does a pretty good job while */
|
||||
/* performing fast computations for both global and glyph hints. */
|
||||
/* However, we might be interested in introducing more complex and */
|
||||
/* powerful algorithms in the future, like the one described in the John */
|
||||
/* D. Hobby paper, which unfortunately requires a lot more horsepower. */
|
||||
/* */
|
||||
/* Because a sufficiently sophisticated font management system would */
|
||||
/* typically implement an LRU cache of opened face objects to reduce */
|
||||
/* memory usage, it is a good idea to be able to avoid recomputing */
|
||||
/* global hints every time the same face is re-opened. */
|
||||
/* */
|
||||
/* We thus provide the ability to cache global hints outside of the face */
|
||||
/* object, in order to speed up font re-opening time. Of course, this */
|
||||
/* feature is purely optional, so most client programs won't even notice */
|
||||
/* it. */
|
||||
/* */
|
||||
/* I initially thought that it would be a good idea to cache the glyph */
|
||||
/* hints too. However, my general idea now is that if you really need */
|
||||
/* to cache these too, you are simply in need of a new font format, */
|
||||
/* where all this information could be stored within the font file and */
|
||||
/* decoded on the fly. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Get_Global_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the global hints computed for a given face object the */
|
||||
/* resulting data is dissociated from the face and will survive a */
|
||||
/* call to FT_Done_Face(). It must be discarded through the API */
|
||||
/* FT_AutoHinter_Done_Global_Func(). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hinter :: A handle to the source auto-hinter. */
|
||||
/* */
|
||||
/* face :: A handle to the source face object. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* global_hints :: A typeless pointer to the global hints. */
|
||||
/* */
|
||||
/* global_len :: The size in bytes of the global hints. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_AutoHinter_Get_Global_Func)( FT_AutoHinter hinter,
|
||||
FT_Face face,
|
||||
void** global_hints,
|
||||
long* global_len );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Done_Global_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Discards the global hints retrieved through */
|
||||
/* FT_AutoHinter_Get_Global_Func(). This is the only way these hints */
|
||||
/* are freed from memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hinter :: A handle to the auto-hinter module. */
|
||||
/* */
|
||||
/* global :: A pointer to retrieved global hints to discard. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_AutoHinter_Done_Global_Func)( FT_AutoHinter hinter,
|
||||
void* global );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Reset_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This function is used to recompute the global metrics in a given */
|
||||
/* font. This is useful when global font data changes (e.g. Multiple */
|
||||
/* Masters fonts where blend coordinates change). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hinter :: A handle to the source auto-hinter. */
|
||||
/* */
|
||||
/* face :: A handle to the face. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_AutoHinter_Reset_Func)( FT_AutoHinter hinter,
|
||||
FT_Face face );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Load_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This function is used to load, scale, and automatically hint a */
|
||||
/* glyph from a given face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the face. */
|
||||
/* glyph_index :: The glyph index. */
|
||||
/* load_flags :: The load flags. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is capable of loading composite glyphs by hinting */
|
||||
/* each sub-glyph independently (which improves quality). */
|
||||
/* */
|
||||
/* It will call the font driver with FT_Load_Glyph(), with */
|
||||
/* FT_LOAD_NO_SCALE set. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*FT_AutoHinter_Load_Func)( FT_AutoHinter hinter,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_ULong load_flags );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_AutoHinter_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The auto-hinter module's interface. */
|
||||
/* */
|
||||
typedef struct FT_AutoHinter_Interface
|
||||
{
|
||||
FT_AutoHinter_Reset_Func reset_face;
|
||||
FT_AutoHinter_Load_Func load_glyph;
|
||||
|
||||
FT_AutoHinter_Get_Global_Func get_global_hints;
|
||||
FT_AutoHinter_Done_Global_Func done_global_hints;
|
||||
|
||||
} FT_AutoHinter_Interface;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AUTOHINT_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,252 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* cfftypes.h */
|
||||
/* */
|
||||
/* Basic OpenType/CFF type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __CFFTYPES_H__
|
||||
#define __CFFTYPES_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* CFF_Index */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a CFF Index table. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* stream :: The source input stream. */
|
||||
/* */
|
||||
/* count :: The number of elements in the index. */
|
||||
/* */
|
||||
/* off_size :: The size in bytes of object offsets in index. */
|
||||
/* */
|
||||
/* data_offset :: The position of first data byte in the index's */
|
||||
/* bytes. */
|
||||
/* */
|
||||
/* offsets :: A table of element offsets in the index. */
|
||||
/* */
|
||||
/* bytes :: If the index is loaded in memory, its bytes. */
|
||||
/* */
|
||||
typedef struct CFF_Index_
|
||||
{
|
||||
FT_Stream stream;
|
||||
FT_UInt count;
|
||||
FT_Byte off_size;
|
||||
FT_ULong data_offset;
|
||||
|
||||
FT_ULong* offsets;
|
||||
FT_Byte* bytes;
|
||||
|
||||
} CFF_Index;
|
||||
|
||||
|
||||
typedef struct CFF_Encoding_
|
||||
{
|
||||
FT_UInt format;
|
||||
FT_ULong offset;
|
||||
|
||||
FT_UShort* sids;
|
||||
FT_UShort* codes;
|
||||
|
||||
} CFF_Encoding;
|
||||
|
||||
|
||||
typedef struct CFF_Charset_
|
||||
{
|
||||
|
||||
FT_UInt format;
|
||||
FT_ULong offset;
|
||||
|
||||
FT_UShort* sids;
|
||||
|
||||
} CFF_Charset;
|
||||
|
||||
|
||||
typedef struct CFF_Font_Dict_
|
||||
{
|
||||
FT_UInt version;
|
||||
FT_UInt notice;
|
||||
FT_UInt copyright;
|
||||
FT_UInt full_name;
|
||||
FT_UInt family_name;
|
||||
FT_UInt weight;
|
||||
FT_Bool is_fixed_pitch;
|
||||
FT_Fixed italic_angle;
|
||||
FT_Pos underline_position;
|
||||
FT_Pos underline_thickness;
|
||||
FT_Int paint_type;
|
||||
FT_Int charstring_type;
|
||||
FT_Matrix font_matrix;
|
||||
FT_UShort units_per_em;
|
||||
FT_Vector font_offset;
|
||||
FT_ULong unique_id;
|
||||
FT_BBox font_bbox;
|
||||
FT_Pos stroke_width;
|
||||
FT_ULong charset_offset;
|
||||
FT_ULong encoding_offset;
|
||||
FT_ULong charstrings_offset;
|
||||
FT_ULong private_offset;
|
||||
FT_ULong private_size;
|
||||
FT_Long synthetic_base;
|
||||
FT_UInt embedded_postscript;
|
||||
FT_UInt base_font_name;
|
||||
FT_UInt postscript;
|
||||
|
||||
/* these should only be used for the top-level font dictionary */
|
||||
FT_UInt cid_registry;
|
||||
FT_UInt cid_ordering;
|
||||
FT_ULong cid_supplement;
|
||||
|
||||
FT_Long cid_font_version;
|
||||
FT_Long cid_font_revision;
|
||||
FT_Long cid_font_type;
|
||||
FT_Long cid_count;
|
||||
FT_ULong cid_uid_base;
|
||||
FT_ULong cid_fd_array_offset;
|
||||
FT_ULong cid_fd_select_offset;
|
||||
FT_UInt cid_font_name;
|
||||
|
||||
} CFF_Font_Dict;
|
||||
|
||||
|
||||
typedef struct CFF_Private_
|
||||
{
|
||||
FT_Byte num_blue_values;
|
||||
FT_Byte num_other_blues;
|
||||
FT_Byte num_family_blues;
|
||||
FT_Byte num_family_other_blues;
|
||||
|
||||
FT_Pos blue_values[14];
|
||||
FT_Pos other_blues[10];
|
||||
FT_Pos family_blues[14];
|
||||
FT_Pos family_other_blues[10];
|
||||
|
||||
FT_Fixed blue_scale;
|
||||
FT_Pos blue_shift;
|
||||
FT_Pos blue_fuzz;
|
||||
FT_Pos standard_width;
|
||||
FT_Pos standard_height;
|
||||
|
||||
FT_Byte num_snap_widths;
|
||||
FT_Byte num_snap_heights;
|
||||
FT_Pos snap_widths[13];
|
||||
FT_Pos snap_heights[13];
|
||||
FT_Bool force_bold;
|
||||
FT_Fixed force_bold_threshold;
|
||||
FT_Int lenIV;
|
||||
FT_Int language_group;
|
||||
FT_Fixed expansion_factor;
|
||||
FT_Long initial_random_seed;
|
||||
FT_ULong local_subrs_offset;
|
||||
FT_Pos default_width;
|
||||
FT_Pos nominal_width;
|
||||
|
||||
} CFF_Private;
|
||||
|
||||
|
||||
typedef struct CFF_FD_Select_
|
||||
{
|
||||
FT_Byte format;
|
||||
FT_UInt range_count;
|
||||
|
||||
/* that's the table, taken from the file `as is' */
|
||||
FT_Byte* data;
|
||||
FT_UInt data_size;
|
||||
|
||||
/* small cache for format 3 only */
|
||||
FT_UInt cache_first;
|
||||
FT_UInt cache_count;
|
||||
FT_Byte cache_fd;
|
||||
|
||||
} CFF_FD_Select;
|
||||
|
||||
|
||||
/* A SubFont packs a font dict and a private dict together. They are */
|
||||
/* needed to support CID-keyed CFF fonts. */
|
||||
typedef struct CFF_SubFont_
|
||||
{
|
||||
CFF_Font_Dict font_dict;
|
||||
CFF_Private private_dict;
|
||||
|
||||
CFF_Index local_subrs_index;
|
||||
FT_UInt num_local_subrs;
|
||||
FT_Byte** local_subrs;
|
||||
|
||||
} CFF_SubFont;
|
||||
|
||||
|
||||
/* maximum number of sub-fonts in a CID-keyed file */
|
||||
#define CFF_MAX_CID_FONTS 16
|
||||
|
||||
|
||||
typedef struct CFF_Font_
|
||||
{
|
||||
FT_Stream stream;
|
||||
FT_Memory memory;
|
||||
FT_UInt num_faces;
|
||||
FT_UInt num_glyphs;
|
||||
|
||||
FT_Byte version_major;
|
||||
FT_Byte version_minor;
|
||||
FT_Byte header_size;
|
||||
FT_Byte absolute_offsize;
|
||||
|
||||
|
||||
CFF_Index name_index;
|
||||
CFF_Index top_dict_index;
|
||||
CFF_Index string_index;
|
||||
CFF_Index global_subrs_index;
|
||||
|
||||
CFF_Encoding encoding;
|
||||
CFF_Charset charset;
|
||||
|
||||
CFF_Index charstrings_index;
|
||||
CFF_Index font_dict_index;
|
||||
CFF_Index private_index;
|
||||
CFF_Index local_subrs_index;
|
||||
|
||||
FT_String* font_name;
|
||||
FT_UInt num_global_subrs;
|
||||
FT_Byte** global_subrs;
|
||||
|
||||
CFF_SubFont top_font;
|
||||
FT_UInt num_subfonts;
|
||||
CFF_SubFont* subfonts[CFF_MAX_CID_FONTS];
|
||||
|
||||
CFF_FD_Select fd_select;
|
||||
|
||||
/* interface to PostScript hinter */
|
||||
void* pshinter;
|
||||
|
||||
} CFF_Font;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __CFFTYPES_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,155 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* fnttypes.h */
|
||||
/* */
|
||||
/* Basic Windows FNT/FON type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FNTTYPES_H__
|
||||
#define __FNTTYPES_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef struct WinMZ_Header_
|
||||
{
|
||||
FT_UShort magic;
|
||||
/* skipped content */
|
||||
FT_UShort lfanew;
|
||||
|
||||
} WinMZ_Header;
|
||||
|
||||
|
||||
typedef struct WinNE_Header_
|
||||
{
|
||||
FT_UShort magic;
|
||||
/* skipped content */
|
||||
FT_UShort resource_tab_offset;
|
||||
FT_UShort rname_tab_offset;
|
||||
|
||||
} WinNE_Header;
|
||||
|
||||
|
||||
typedef struct WinNameInfo_
|
||||
{
|
||||
FT_UShort offset;
|
||||
FT_UShort length;
|
||||
FT_UShort flags;
|
||||
FT_UShort id;
|
||||
FT_UShort handle;
|
||||
FT_UShort usage;
|
||||
|
||||
} WinNameInfo;
|
||||
|
||||
|
||||
typedef struct WinResourceInfo_
|
||||
{
|
||||
FT_UShort type_id;
|
||||
FT_UShort count;
|
||||
|
||||
} WinResourceInfo;
|
||||
|
||||
|
||||
#define WINFNT_MZ_MAGIC 0x5A4D
|
||||
#define WINFNT_NE_MAGIC 0x454E
|
||||
|
||||
|
||||
typedef struct WinFNT_Header_
|
||||
{
|
||||
FT_UShort version;
|
||||
FT_ULong file_size;
|
||||
FT_Byte copyright[60];
|
||||
FT_UShort file_type;
|
||||
FT_UShort nominal_point_size;
|
||||
FT_UShort vertical_resolution;
|
||||
FT_UShort horizontal_resolution;
|
||||
FT_UShort ascent;
|
||||
FT_UShort internal_leading;
|
||||
FT_UShort external_leading;
|
||||
FT_Byte italic;
|
||||
FT_Byte underline;
|
||||
FT_Byte strike_out;
|
||||
FT_UShort weight;
|
||||
FT_Byte charset;
|
||||
FT_UShort pixel_width;
|
||||
FT_UShort pixel_height;
|
||||
FT_Byte pitch_and_family;
|
||||
FT_UShort avg_width;
|
||||
FT_UShort max_width;
|
||||
FT_Byte first_char;
|
||||
FT_Byte last_char;
|
||||
FT_Byte default_char;
|
||||
FT_Byte break_char;
|
||||
FT_UShort bytes_per_row;
|
||||
FT_ULong device_offset;
|
||||
FT_ULong face_name_offset;
|
||||
FT_ULong bits_pointer;
|
||||
FT_ULong bits_offset;
|
||||
FT_Byte reserved;
|
||||
FT_ULong flags;
|
||||
FT_UShort A_space;
|
||||
FT_UShort B_space;
|
||||
FT_UShort C_space;
|
||||
FT_UShort color_table_offset;
|
||||
FT_Byte reserved2[4];
|
||||
|
||||
} WinFNT_Header;
|
||||
|
||||
|
||||
typedef struct FNT_Font_
|
||||
{
|
||||
FT_ULong offset;
|
||||
FT_Int size_shift;
|
||||
|
||||
WinFNT_Header header;
|
||||
|
||||
FT_Byte* fnt_frame;
|
||||
FT_ULong fnt_size;
|
||||
|
||||
} FNT_Font;
|
||||
|
||||
|
||||
typedef struct FNT_SizeRec_
|
||||
{
|
||||
FT_SizeRec root;
|
||||
FNT_Font* font;
|
||||
|
||||
} FNT_SizeRec, *FNT_Size;
|
||||
|
||||
|
||||
typedef struct FNT_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
|
||||
FT_UInt num_fonts;
|
||||
FNT_Font* fonts;
|
||||
|
||||
FT_CharMap charmap_handle;
|
||||
FT_CharMapRec charmap; /* a single charmap per face */
|
||||
|
||||
} FNT_FaceRec, *FNT_Face;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FNTTYPES_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,234 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcalc.h */
|
||||
/* */
|
||||
/* Arithmetic computations (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FTCALC_H__
|
||||
#define __FTCALC_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* OLD 64-bits internal API */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
#ifdef FT_LONG64
|
||||
|
||||
typedef FT_INT64 FT_Int64;
|
||||
|
||||
#define ADD_64( x, y, z ) z = (x) + (y)
|
||||
#define MUL_64( x, y, z ) z = (FT_Int64)(x) * (y)
|
||||
#define DIV_64( x, y ) ( (x) / (y) )
|
||||
|
||||
#define SQRT_64( z ) FT_Sqrt64( z )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 64-bit value. That sounds stupid, */
|
||||
/* but it is needed to obtain maximal accuracy in the TrueType */
|
||||
/* bytecode interpreter. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* l :: A 64-bit integer. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The 32-bit square-root. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_Sqrt64( FT_Int64 l );
|
||||
|
||||
|
||||
#else /* !FT_LONG64 */
|
||||
|
||||
|
||||
typedef struct FT_Int64_
|
||||
{
|
||||
FT_UInt32 lo;
|
||||
FT_UInt32 hi;
|
||||
|
||||
} FT_Int64;
|
||||
|
||||
|
||||
#define ADD_64( x, y, z ) FT_Add64( &x, &y, &z )
|
||||
#define MUL_64( x, y, z ) FT_MulTo64( x, y, &z )
|
||||
#define DIV_64( x, y ) FT_Div64by32( &x, y )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Add64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Add two Int64 values. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: A pointer to the first value to be added. */
|
||||
/* y :: A pointer to the second value to be added. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* z :: A pointer to the result of `x + y'. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Will be wrapped by the ADD_64() macro. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Add64( FT_Int64* x,
|
||||
FT_Int64* y,
|
||||
FT_Int64 *z );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_MulTo64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Multiplies two Int32 integers. Returns an Int64 integer. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: The first multiplier. */
|
||||
/* y :: The second multiplier. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* z :: A pointer to the result of `x * y'. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Will be wrapped by the MUL_64() macro. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_MulTo64( FT_Int32 x,
|
||||
FT_Int32 y,
|
||||
FT_Int64 *z );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Div64by32 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Divides an Int64 value by an Int32 value. Returns an Int32 */
|
||||
/* integer. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: A pointer to the dividend. */
|
||||
/* y :: The divisor. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `x / y'. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Will be wrapped by the DIV_64() macro. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_Div64by32( FT_Int64* x,
|
||||
FT_Int32 y );
|
||||
|
||||
|
||||
#define SQRT_64( z ) FT_Sqrt64( &z )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt64 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of a 64-bits value. That sounds stupid, */
|
||||
/* but it is needed to obtain maximal accuracy in the TrueType */
|
||||
/* bytecode interpreter. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* z :: A pointer to a 64-bit integer. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The 32-bit square-root. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_Sqrt64( FT_Int64* x );
|
||||
|
||||
|
||||
#endif /* !FT_LONG64 */
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_CALCS */
|
||||
|
||||
|
||||
|
||||
FT_EXPORT( FT_Int32 ) FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
#define SQRT_32( x ) FT_Sqrt32( x )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Sqrt32 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the square root of an Int32 integer (which will be */
|
||||
/* handled as an unsigned long value). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* x :: The value to compute the root for. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `sqrt(x)'. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_Sqrt32( FT_Int32 x );
|
||||
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_OLD_CALCS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
|
||||
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
|
||||
#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
|
||||
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
|
||||
#define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
|
||||
|
||||
#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
|
||||
: ( -( ( 32 - (x) ) & -64 ) ) )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCALC_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,247 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftdebug.h */
|
||||
/* */
|
||||
/* Debugging and logging component (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FTDEBUG_H__
|
||||
#define __FTDEBUG_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
|
||||
/* note that not all levels are used currently */
|
||||
|
||||
typedef enum FT_Trace_
|
||||
{
|
||||
/* the first level must always be `trace_any' */
|
||||
trace_any = 0,
|
||||
|
||||
/* base components */
|
||||
trace_aaraster, /* anti-aliasing raster (ftgrays.c) */
|
||||
trace_calc, /* calculations (ftcalc.c) */
|
||||
trace_extend, /* extension manager (ftextend.c) */
|
||||
trace_glyph, /* glyph manager (ftglyph.c) */
|
||||
trace_io, /* i/o monitoring (ftsystem.c) */
|
||||
trace_init, /* initialization (ftinit.c) */
|
||||
trace_list, /* list manager (ftlist.c) */
|
||||
trace_memory, /* memory manager (ftobjs.c) */
|
||||
trace_mm, /* MM interface (ftmm.c) */
|
||||
trace_objs, /* base objects (ftobjs.c) */
|
||||
trace_outline, /* outline management (ftoutln.c) */
|
||||
trace_raster, /* rasterizer (ftraster.c) */
|
||||
trace_stream, /* stream manager (ftstream.c) */
|
||||
|
||||
/* Cache sub-system */
|
||||
trace_cache,
|
||||
|
||||
/* SFNT driver components */
|
||||
trace_sfobjs, /* SFNT object handler (sfobjs.c) */
|
||||
trace_ttcmap, /* charmap handler (ttcmap.c) */
|
||||
trace_ttload, /* basic TrueType tables (ttload.c) */
|
||||
trace_ttpost, /* PS table processing (ttpost.c) */
|
||||
trace_ttsbit, /* TrueType sbit handling (ttsbit.c) */
|
||||
|
||||
/* TrueType driver components */
|
||||
trace_ttdriver, /* TT font driver (ttdriver.c) */
|
||||
trace_ttgload, /* TT glyph loader (ttgload.c) */
|
||||
trace_ttinterp, /* bytecode interpreter (ttinterp.c) */
|
||||
trace_ttobjs, /* TT objects manager (ttobjs.c) */
|
||||
trace_ttpload, /* TT data/program loader (ttpload.c) */
|
||||
|
||||
/* Type 1 driver components */
|
||||
trace_t1driver,
|
||||
trace_t1gload,
|
||||
trace_t1hint,
|
||||
trace_t1load,
|
||||
trace_t1objs,
|
||||
trace_t1parse,
|
||||
|
||||
/* PostScript helper module `psaux' */
|
||||
trace_t1decode,
|
||||
trace_psobjs,
|
||||
|
||||
/* PostScript hinting module `pshinter' */
|
||||
trace_pshrec,
|
||||
trace_pshalgo1,
|
||||
trace_pshalgo2,
|
||||
|
||||
/* Type 2 driver components */
|
||||
trace_cffdriver,
|
||||
trace_cffgload,
|
||||
trace_cffload,
|
||||
trace_cffobjs,
|
||||
trace_cffparse,
|
||||
|
||||
/* CID driver components */
|
||||
trace_cidafm,
|
||||
trace_ciddriver,
|
||||
trace_cidgload,
|
||||
trace_cidload,
|
||||
trace_cidobjs,
|
||||
trace_cidparse,
|
||||
|
||||
/* Windows fonts component */
|
||||
trace_winfnt,
|
||||
|
||||
/* PCF fonts component */
|
||||
trace_pcfdriver,
|
||||
trace_pcfread,
|
||||
|
||||
/* the last level must always be `trace_max' */
|
||||
trace_max
|
||||
|
||||
} FT_Trace;
|
||||
|
||||
|
||||
/* declared in ftdebug.c */
|
||||
extern char ft_trace_levels[trace_max];
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* IMPORTANT! */
|
||||
/* */
|
||||
/* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
|
||||
/* value before using any TRACE macro. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_TRACE( level, varformat ) \
|
||||
do \
|
||||
{ \
|
||||
if ( ft_trace_levels[FT_COMPONENT] >= level ) \
|
||||
FT_Message varformat; \
|
||||
} while ( 0 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_SetTraceLevel */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Sets the trace level for debugging. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* component :: The component which should be traced. See above for */
|
||||
/* a complete list. If set to `trace_any', all */
|
||||
/* components will be traced. */
|
||||
/* */
|
||||
/* level :: The tracing level. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_SetTraceLevel( FT_Trace component,
|
||||
char level );
|
||||
|
||||
|
||||
#elif defined( FT_DEBUG_LEVEL_ERROR )
|
||||
|
||||
|
||||
#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
|
||||
|
||||
|
||||
#else /* release mode */
|
||||
|
||||
|
||||
#define FT_Assert( condition ) do ; while ( 0 ) /* nothing */
|
||||
|
||||
#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
|
||||
#define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */
|
||||
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE, FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define macros and functions that are common to the debug and trace */
|
||||
/* modes. */
|
||||
/* */
|
||||
/* You need vprintf() to be able to compile ftdebug.c. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#if defined( FT_DEBUG_LEVEL_TRACE ) || defined( FT_DEBUG_LEVEL_ERROR )
|
||||
|
||||
|
||||
#include "stdio.h" /* for vprintf() */
|
||||
|
||||
|
||||
#define FT_Assert( condition ) \
|
||||
do \
|
||||
{ \
|
||||
if ( !( condition ) ) \
|
||||
FT_Panic( "assertion failed on line %d of file %s\n", \
|
||||
__LINE__, __FILE__ ); \
|
||||
} while ( 0 )
|
||||
|
||||
/* print a message */
|
||||
FT_EXPORT( void )
|
||||
FT_Message( const char* fmt, ... );
|
||||
|
||||
/* print a message and exit */
|
||||
FT_EXPORT( void )
|
||||
FT_Panic( const char* fmt, ... );
|
||||
|
||||
#define FT_ERROR( varformat ) FT_Message varformat
|
||||
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* You need two opening resp. closing parentheses! */
|
||||
/* */
|
||||
/* Example: FT_TRACE0(( "Value is %i", foo )) */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
|
||||
#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
|
||||
#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
|
||||
#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
|
||||
#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
|
||||
#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
|
||||
#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
|
||||
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
|
||||
|
||||
|
||||
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* we disable the warning `conditional expression is constant' here */
|
||||
/* in order to compile cleanly with the maximum level of warnings */
|
||||
#pragma warning( disable : 4127 )
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTDEBUG_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,205 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftdriver.h */
|
||||
/* */
|
||||
/* FreeType font driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FTDRIVER_H__
|
||||
#define __FTDRIVER_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_initFace)( FT_Stream stream,
|
||||
FT_Face face,
|
||||
FT_Int typeface_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* parameters );
|
||||
|
||||
typedef void
|
||||
(*FTDriver_doneFace)( FT_Face face );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_initSize)( FT_Size size );
|
||||
|
||||
typedef void
|
||||
(*FTDriver_doneSize)( FT_Size size );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_initGlyphSlot)( FT_GlyphSlot slot );
|
||||
|
||||
typedef void
|
||||
(*FTDriver_doneGlyphSlot)( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_setCharSizes)( FT_Size size,
|
||||
FT_F26Dot6 char_width,
|
||||
FT_F26Dot6 char_height,
|
||||
FT_UInt horz_resolution,
|
||||
FT_UInt vert_resolution );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_setPixelSizes)( FT_Size size,
|
||||
FT_UInt pixel_width,
|
||||
FT_UInt pixel_height );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_loadGlyph)( FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int load_flags );
|
||||
|
||||
|
||||
typedef FT_UInt
|
||||
(*FTDriver_getCharIndex)( FT_CharMap charmap,
|
||||
FT_Long charcode );
|
||||
|
||||
typedef FT_Long
|
||||
(*FTDriver_getNextChar)( FT_CharMap charmap,
|
||||
FT_Long charcode );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_getKerning)( FT_Face face,
|
||||
FT_UInt left_glyph,
|
||||
FT_UInt right_glyph,
|
||||
FT_Vector* kerning );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_attachFile)( FT_Face face,
|
||||
FT_Stream stream );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FTDriver_getAdvances)( FT_Face face,
|
||||
FT_UInt first,
|
||||
FT_UInt count,
|
||||
FT_Bool vertical,
|
||||
FT_UShort* advances );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Driver_Class */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The font driver class. This structure mostly contains pointers to */
|
||||
/* driver methods. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The parent module. */
|
||||
/* */
|
||||
/* face_object_size :: The size of a face object in bytes. */
|
||||
/* */
|
||||
/* size_object_size :: The size of a size object in bytes. */
|
||||
/* */
|
||||
/* slot_object_size :: The size of a glyph object in bytes. */
|
||||
/* */
|
||||
/* init_face :: The format-specific face constructor. */
|
||||
/* */
|
||||
/* done_face :: The format-specific face destructor. */
|
||||
/* */
|
||||
/* init_size :: The format-specific size constructor. */
|
||||
/* */
|
||||
/* done_size :: The format-specific size destructor. */
|
||||
/* */
|
||||
/* init_slot :: The format-specific slot constructor. */
|
||||
/* */
|
||||
/* done_slot :: The format-specific slot destructor. */
|
||||
/* */
|
||||
/* set_char_sizes :: A handle to a function used to set the new */
|
||||
/* character size in points + resolution. Can be */
|
||||
/* set to 0 to indicate default behaviour. */
|
||||
/* */
|
||||
/* set_pixel_sizes :: A handle to a function used to set the new */
|
||||
/* character size in pixels. Can be set to 0 to */
|
||||
/* indicate default behaviour. */
|
||||
/* */
|
||||
/* load_glyph :: A function handle to load a given glyph image */
|
||||
/* in a slot. This field is mandatory! */
|
||||
/* */
|
||||
/* get_char_index :: A function handle to return the glyph index of */
|
||||
/* a given character for a given charmap. This */
|
||||
/* field is mandatory! */
|
||||
/* */
|
||||
/* get_kerning :: A function handle to return the unscaled */
|
||||
/* kerning for a given pair of glyphs. Can be */
|
||||
/* set to 0 if the format doesn't support */
|
||||
/* kerning. */
|
||||
/* */
|
||||
/* attach_file :: This function handle is used to read */
|
||||
/* additional data for a face from another */
|
||||
/* file/stream. For example, this can be used to */
|
||||
/* add data from AFM or PFM files on a Type 1 */
|
||||
/* face, or a CIDMap on a CID-keyed face. */
|
||||
/* */
|
||||
/* get_advances :: A function handle used to return the advances */
|
||||
/* of 'count' glyphs, starting at `index'. the */
|
||||
/* `vertical' flags must be set when vertical */
|
||||
/* advances are queried. The advances buffer is */
|
||||
/* caller-allocated. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Most function pointers, with the exception of `load_glyph' and */
|
||||
/* `get_char_index' can be set to 0 to indicate a default behaviour. */
|
||||
/* */
|
||||
typedef struct FT_Driver_Class_
|
||||
{
|
||||
FT_Module_Class root;
|
||||
|
||||
FT_Int face_object_size;
|
||||
FT_Int size_object_size;
|
||||
FT_Int slot_object_size;
|
||||
|
||||
FTDriver_initFace init_face;
|
||||
FTDriver_doneFace done_face;
|
||||
|
||||
FTDriver_initSize init_size;
|
||||
FTDriver_doneSize done_size;
|
||||
|
||||
FTDriver_initGlyphSlot init_slot;
|
||||
FTDriver_doneGlyphSlot done_slot;
|
||||
|
||||
FTDriver_setCharSizes set_char_sizes;
|
||||
FTDriver_setPixelSizes set_pixel_sizes;
|
||||
|
||||
FTDriver_loadGlyph load_glyph;
|
||||
FTDriver_getCharIndex get_char_index;
|
||||
|
||||
FTDriver_getKerning get_kerning;
|
||||
FTDriver_attachFile attach_file;
|
||||
|
||||
FTDriver_getAdvances get_advances;
|
||||
|
||||
FTDriver_getNextChar get_next_char;
|
||||
} FT_Driver_Class;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTDRIVER_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,268 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftmemory.h */
|
||||
/* */
|
||||
/* The FreeType memory management macros (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FTMEMORY_H__
|
||||
#define __FTMEMORY_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
#include FT_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_SET_ERROR */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used to set an implicit `error' variable to a given */
|
||||
/* expression's value (usually a function call), and convert it to a */
|
||||
/* boolean which is set whenever the value is != 0. */
|
||||
/* */
|
||||
#undef FT_SET_ERROR
|
||||
#define FT_SET_ERROR( expression ) \
|
||||
( ( error = (expression) ) != 0 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** M E M O R Y ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Alloc_Debug( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Realloc_Debug( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Free_Debug( FT_Memory memory,
|
||||
FT_Pointer block,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Alloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Allocates a new block of memory. The returned area is always */
|
||||
/* zero-filled; this is a strong convention in many FreeType parts. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* allocation. */
|
||||
/* */
|
||||
/* size :: The size in bytes of the block to allocate. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* P :: A pointer to the fresh new block. It should be set to */
|
||||
/* NULL if `size' is 0, or in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Realloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Reallocates a block of memory pointed to by `*P' to `Size' bytes */
|
||||
/* from the heap, possibly changing `*P'. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* reallocation. */
|
||||
/* */
|
||||
/* current :: The current block size in bytes. */
|
||||
/* */
|
||||
/* size :: The new block size in bytes. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* P :: A pointer to the fresh new block. It should be set to */
|
||||
/* NULL if `size' is 0, or in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* All callers of FT_Realloc() _must_ provide the current block size */
|
||||
/* as well as the new one. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Realloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void** P );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Free */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Releases a given block of memory allocated through FT_Alloc(). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* memory deallocation */
|
||||
/* */
|
||||
/* P :: This is the _address_ of a _pointer_ which points to the */
|
||||
/* allocated block. It is always set to NULL on exit. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* If P or *P are NULL, this function should return successfully. */
|
||||
/* This is a strong convention within all of FreeType and its */
|
||||
/* drivers. */
|
||||
/* */
|
||||
FT_BASE( void )
|
||||
FT_Free( FT_Memory memory,
|
||||
void** P );
|
||||
|
||||
|
||||
/* This `#include' is needed by the MEM_xxx() macros; it should be */
|
||||
/* available on all platforms we know of. */
|
||||
#include <string.h>
|
||||
|
||||
#define MEM_Set( dest, byte, count ) memset( dest, byte, count )
|
||||
|
||||
#define MEM_Copy( dest, source, count ) memcpy( dest, source, count )
|
||||
|
||||
#define MEM_Move( dest, source, count ) memmove( dest, source, count )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* We now support closures to produce completely reentrant code. This */
|
||||
/* means the allocation functions now takes an additional argument */
|
||||
/* (`memory'). It is a handle to a given memory object, responsible for */
|
||||
/* all low-level operations, including memory management and */
|
||||
/* synchronisation. */
|
||||
/* */
|
||||
/* In order to keep our code readable and use the same macros in the */
|
||||
/* font drivers and the rest of the library, MEM_Alloc(), ALLOC(), and */
|
||||
/* ALLOC_ARRAY() now use an implicit variable, `memory'. It must be */
|
||||
/* defined at all locations where a memory operation is queried. */
|
||||
/* */
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
#define MEM_Alloc( _pointer_, _size_ ) \
|
||||
FT_Alloc_Debug( memory, _size_, \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Alloc_Array( _pointer_, _count_, _type_ ) \
|
||||
FT_Alloc_Debug( memory, (_count_)*sizeof ( _type_ ), \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Realloc( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc_Debug( memory, _current_, _size_, \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Realloc_Array( _pointer_, _current_, _new_, _type_ ) \
|
||||
FT_Realloc_Debug( memory, (_current_)*sizeof ( _type_ ), \
|
||||
(_new_)*sizeof ( _type_ ), \
|
||||
(void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#define MEM_Free( _pointer_ ) \
|
||||
FT_Free_Debug( memory, (void**)&(_pointer_), __FILE__, __LINE__ )
|
||||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
||||
#define MEM_Alloc( _pointer_, _size_ ) \
|
||||
FT_Alloc( memory, _size_, (void**)&(_pointer_) )
|
||||
|
||||
#define MEM_Alloc_Array( _pointer_, _count_, _type_ ) \
|
||||
FT_Alloc( memory, (_count_)*sizeof ( _type_ ), \
|
||||
(void**)&(_pointer_) )
|
||||
|
||||
#define MEM_Realloc( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc( memory, _current_, _size_, (void**)&(_pointer_) )
|
||||
|
||||
#define MEM_Realloc_Array( _pointer_, _current_, _new_, _type_ ) \
|
||||
FT_Realloc( memory, (_current_)*sizeof ( _type_ ), \
|
||||
(_new_)*sizeof ( _type_ ), (void**)&(_pointer_) )
|
||||
|
||||
#define MEM_Free( _pointer_ ) \
|
||||
FT_Free( memory, (void**)&(_pointer_) )
|
||||
|
||||
#endif /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
#define ALLOC( _pointer_, _size_ ) \
|
||||
FT_SET_ERROR( MEM_Alloc( _pointer_, _size_ ) )
|
||||
|
||||
#define REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_SET_ERROR( MEM_Realloc( _pointer_, _current_, _size_ ) )
|
||||
|
||||
#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
|
||||
FT_SET_ERROR( MEM_Alloc( _pointer_, \
|
||||
(_count_)*sizeof ( _type_ ) ) )
|
||||
|
||||
#define REALLOC_ARRAY( _pointer_, _current_, _count_, _type_ ) \
|
||||
FT_SET_ERROR( MEM_Realloc( _pointer_, \
|
||||
(_current_)*sizeof ( _type_ ), \
|
||||
(_count_)*sizeof ( _type_ ) ) )
|
||||
|
||||
#define FREE( _pointer_ ) \
|
||||
MEM_Free( _pointer_ )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTMEMORY_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,739 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftobjs.h */
|
||||
/* */
|
||||
/* The FreeType private base classes (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 all internal FreeType classes. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTOBJS_H__
|
||||
#define __FTOBJS_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_RENDER_H
|
||||
#include FT_SIZES_H
|
||||
#include FT_INTERNAL_MEMORY_H
|
||||
#include FT_INTERNAL_DRIVER_H
|
||||
#include FT_INTERNAL_AUTOHINT_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Some generic definitions. */
|
||||
/* */
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void*)0
|
||||
#endif
|
||||
|
||||
#ifndef UNUSED
|
||||
#define UNUSED( arg ) ( (arg)=(arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The min and max functions missing in C. As usual, be careful not to */
|
||||
/* write things like MIN( a++, b++ ) to avoid side effects. */
|
||||
/* */
|
||||
#ifndef MIN
|
||||
#define MIN( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS( a ) ( (a) < 0 ? -(a) : (a) )
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_GlyphLoader */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The glyph loader is an internal object used to load several glyphs */
|
||||
/* together (for example, in the case of composites). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The glyph loader implementation is not part of the high-level API, */
|
||||
/* hence the forward structure declaration. */
|
||||
/* */
|
||||
typedef struct FT_GlyphLoader_ FT_GlyphLoader;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Face_InternalRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This structure contains the internal fields of each FT_Face */
|
||||
/* object. These fields may change between different releases of */
|
||||
/* FreeType. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* max_points :: The maximal number of points used to store the */
|
||||
/* vectorial outline of any glyph in this face. */
|
||||
/* If this value cannot be known in advance, or */
|
||||
/* if the face isn't scalable, this should be set */
|
||||
/* to 0. Only relevant for scalable formats. */
|
||||
/* */
|
||||
/* max_contours :: The maximal number of contours used to store */
|
||||
/* the vectorial outline of any glyph in this */
|
||||
/* face. If this value cannot be known in */
|
||||
/* advance, or if the face isn't scalable, this */
|
||||
/* should be set to 0. Only relevant for */
|
||||
/* scalable formats. */
|
||||
/* */
|
||||
/* transform_matrix :: A 2x2 matrix of 16.16 coefficients used to */
|
||||
/* transform glyph outlines after they are loaded */
|
||||
/* from the font. Only used by the convenience */
|
||||
/* functions. */
|
||||
/* */
|
||||
/* transform_delta :: A translation vector used to transform glyph */
|
||||
/* outlines after they are loaded from the font. */
|
||||
/* Only used by the convenience functions. */
|
||||
/* */
|
||||
/* transform_flags :: Some flags used to classify the transform. */
|
||||
/* Only used by the convenience functions. */
|
||||
/* */
|
||||
/* postscript_name :: Postscript font name for this face. */
|
||||
/* */
|
||||
typedef struct FT_Face_InternalRec_
|
||||
{
|
||||
FT_UShort max_points;
|
||||
FT_Short max_contours;
|
||||
|
||||
FT_Matrix transform_matrix;
|
||||
FT_Vector transform_delta;
|
||||
FT_Int transform_flags;
|
||||
|
||||
const char* postscript_name;
|
||||
|
||||
} FT_Face_InternalRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Slot_InternalRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This structure contains the internal fields of each FT_GlyphSlot */
|
||||
/* object. These fields may change between different releases of */
|
||||
/* FreeType. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* loader :: The glyph loader object used to load outlines */
|
||||
/* into the glyph slot. */
|
||||
/* */
|
||||
/* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */
|
||||
/* must be transformed through a specific */
|
||||
/* font transformation. This is _not_ the same */
|
||||
/* as the face transform set through */
|
||||
/* FT_Set_Transform(). */
|
||||
/* */
|
||||
/* glyph_matrix :: The 2x2 matrix corresponding to the glyph */
|
||||
/* transformation, if necessary. */
|
||||
/* */
|
||||
/* glyph_delta :: The 2d translation vector corresponding to */
|
||||
/* the glyph transformation, if necessary. */
|
||||
/* */
|
||||
/* glyph_hints :: Format-specific glyph hints management. */
|
||||
/* */
|
||||
typedef struct FT_Slot_InternalRec_
|
||||
{
|
||||
FT_GlyphLoader* loader;
|
||||
FT_Bool glyph_transformed;
|
||||
FT_Matrix glyph_matrix;
|
||||
FT_Vector glyph_delta;
|
||||
void* glyph_hints;
|
||||
|
||||
} FT_GlyphSlot_InternalRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** M O D U L E S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_ModuleRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A module object instance. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* clazz :: A pointer to the module's class. */
|
||||
/* */
|
||||
/* library :: A handle to the parent library object. */
|
||||
/* */
|
||||
/* memory :: A handle to the memory manager. */
|
||||
/* */
|
||||
/* generic :: A generic structure for user-level extensibility (?). */
|
||||
/* */
|
||||
typedef struct FT_ModuleRec_
|
||||
{
|
||||
FT_Module_Class* clazz;
|
||||
FT_Library library;
|
||||
FT_Memory memory;
|
||||
FT_Generic generic;
|
||||
|
||||
} FT_ModuleRec;
|
||||
|
||||
|
||||
/* typecast an object to a FT_Module */
|
||||
#define FT_MODULE( x ) ((FT_Module)(x))
|
||||
#define FT_MODULE_CLASS( x ) FT_MODULE(x)->clazz
|
||||
#define FT_MODULE_LIBRARY( x ) FT_MODULE(x)->library
|
||||
#define FT_MODULE_MEMORY( x ) FT_MODULE(x)->memory
|
||||
|
||||
#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_font_driver )
|
||||
|
||||
#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_renderer )
|
||||
|
||||
#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_hinter )
|
||||
|
||||
#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_styler )
|
||||
|
||||
#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS(x)->module_flags & \
|
||||
ft_module_driver_scalable )
|
||||
|
||||
#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS(x)->module_flags & \
|
||||
ft_module_driver_no_outlines )
|
||||
|
||||
#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS(x)->module_flags & \
|
||||
ft_module_driver_has_hinter )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Module_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Finds a module and returns its specific interface as a typeless */
|
||||
/* pointer. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object. */
|
||||
/* */
|
||||
/* module_name :: The module's name (as an ASCII string). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* A module-specific interface if available, 0 otherwise. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should better be familiar with FreeType internals to know */
|
||||
/* which module to look for, and what its interface is :-) */
|
||||
/* */
|
||||
FT_BASE( const void* )
|
||||
FT_Get_Module_Interface( FT_Library library,
|
||||
const char* mod_name );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** FACE, SIZE & GLYPH SLOT OBJECTS ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* a few macros used to perform easy typecasts with minimal brain damage */
|
||||
|
||||
#define FT_FACE( x ) ((FT_Face)(x))
|
||||
#define FT_SIZE( x ) ((FT_Size)(x))
|
||||
#define FT_SLOT( x ) ((FT_GlyphSlot)(x))
|
||||
|
||||
#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
|
||||
#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
|
||||
#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
|
||||
|
||||
#define FT_SIZE_FACE( x ) FT_SIZE( x )->face
|
||||
#define FT_SLOT_FACE( x ) FT_SLOT( x )->face
|
||||
|
||||
#define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
|
||||
#define FT_FACE_SIZE( x ) FT_FACE( x )->size
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_GlyphSlot */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* It is sometimes useful to have more than one glyph slot for a */
|
||||
/* given face object. This function is used to create additional */
|
||||
/* slots. All of them are automatically discarded when the face is */
|
||||
/* destroyed. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to a parent face object. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aslot :: A handle to a new glyph slot object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_New_GlyphSlot( FT_Face face,
|
||||
FT_GlyphSlot *aslot );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Done_GlyphSlot */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys a given glyph slot. Remember however that all slots are */
|
||||
/* automatically destroyed with its parent. Using this function is */
|
||||
/* not always mandatory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* slot :: A handle to a target glyph slot. */
|
||||
/* */
|
||||
FT_BASE( void )
|
||||
FT_Done_GlyphSlot( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** G L Y P H L O A D E R ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
|
||||
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
|
||||
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
|
||||
#define FT_SUBGLYPH_FLAG_SCALE 8
|
||||
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
|
||||
#define FT_SUBGLYPH_FLAG_2X2 0x80
|
||||
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
ft_glyph_own_bitmap = 1
|
||||
};
|
||||
|
||||
|
||||
struct FT_SubGlyph_
|
||||
{
|
||||
FT_Int index;
|
||||
FT_UShort flags;
|
||||
FT_Int arg1;
|
||||
FT_Int arg2;
|
||||
FT_Matrix transform;
|
||||
};
|
||||
|
||||
|
||||
typedef struct FT_GlyphLoad_
|
||||
{
|
||||
FT_Outline outline; /* outline */
|
||||
FT_UInt num_subglyphs; /* number of subglyphs */
|
||||
FT_SubGlyph* subglyphs; /* subglyphs */
|
||||
FT_Vector* extra_points; /* extra points table */
|
||||
|
||||
} FT_GlyphLoad;
|
||||
|
||||
|
||||
struct FT_GlyphLoader_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_UInt max_points;
|
||||
FT_UInt max_contours;
|
||||
FT_UInt max_subglyphs;
|
||||
FT_Bool use_extra;
|
||||
|
||||
FT_GlyphLoad base;
|
||||
FT_GlyphLoad current;
|
||||
|
||||
void* other; /* for possible future extension? */
|
||||
|
||||
};
|
||||
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_New( FT_Memory memory,
|
||||
FT_GlyphLoader* *aloader );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_Create_Extra( FT_GlyphLoader* loader );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Done( FT_GlyphLoader* loader );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Reset( FT_GlyphLoader* loader );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Rewind( FT_GlyphLoader* loader );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_Check_Points( FT_GlyphLoader* loader,
|
||||
FT_UInt n_points,
|
||||
FT_UInt n_contours );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_Check_Subglyphs( FT_GlyphLoader* loader,
|
||||
FT_UInt n_subs );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Prepare( FT_GlyphLoader* loader );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Add( FT_GlyphLoader* loader );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_Copy_Points( FT_GlyphLoader* target,
|
||||
FT_GlyphLoader* source );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** R E N D E R E R S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_RENDERER( x ) ((FT_Renderer)( x ))
|
||||
#define FT_GLYPH( x ) ((FT_Glyph)( x ))
|
||||
#define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
|
||||
#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
|
||||
|
||||
|
||||
typedef struct FT_RendererRec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
FT_Renderer_Class* clazz;
|
||||
FT_Glyph_Format glyph_format;
|
||||
FT_Glyph_Class glyph_class;
|
||||
|
||||
FT_Raster raster;
|
||||
FT_Raster_Render_Func raster_render;
|
||||
FTRenderer_render render;
|
||||
|
||||
} FT_RendererRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** F O N T D R I V E R S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* typecast a module into a driver easily */
|
||||
#define FT_DRIVER( x ) ((FT_Driver)(x))
|
||||
|
||||
/* typecast a module as a driver, and get its driver class */
|
||||
#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_DriverRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The root font driver class. A font driver is responsible for */
|
||||
/* managing and loading font files of a given format. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: Contains the fields of the root module class. */
|
||||
/* */
|
||||
/* clazz :: A pointer to the font driver's class. Note that */
|
||||
/* this is NOT root.clazz. `class' wasn't used */
|
||||
/* as it is a reserved word in C++. */
|
||||
/* */
|
||||
/* faces_list :: The list of faces currently opened by this */
|
||||
/* driver. */
|
||||
/* */
|
||||
/* extensions :: A typeless pointer to the driver's extensions */
|
||||
/* registry, if they are supported through the */
|
||||
/* configuration macro FT_CONFIG_OPTION_EXTENSIONS. */
|
||||
/* */
|
||||
/* glyph_loader :: The glyph loader for all faces managed by this */
|
||||
/* driver. This object isn't defined for unscalable */
|
||||
/* formats. */
|
||||
/* */
|
||||
typedef struct FT_DriverRec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
FT_Driver_Class* clazz;
|
||||
|
||||
FT_ListRec faces_list;
|
||||
void* extensions;
|
||||
|
||||
FT_GlyphLoader* glyph_loader;
|
||||
|
||||
} FT_DriverRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** L I B R A R I E S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_DEBUG_HOOK_TRUETYPE 0
|
||||
#define FT_DEBUG_HOOK_TYPE1 1
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_LibraryRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The FreeType library class. This is the root of all FreeType */
|
||||
/* data. Use FT_New_Library() to create a library object, and */
|
||||
/* FT_Done_Library() to discard it and all child objects. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* memory :: The library's memory object. Manages memory */
|
||||
/* allocation. */
|
||||
/* */
|
||||
/* generic :: Client data variable. Used to extend the */
|
||||
/* Library class by higher levels and clients. */
|
||||
/* */
|
||||
/* num_modules :: The number of modules currently registered */
|
||||
/* within this library. This is set to 0 for new */
|
||||
/* libraries. New modules are added through the */
|
||||
/* FT_Add_Module() API function. */
|
||||
/* */
|
||||
/* modules :: A table used to store handles to the currently */
|
||||
/* registered modules. Note that each font driver */
|
||||
/* contains a list of its opened faces. */
|
||||
/* */
|
||||
/* renderers :: The list of renderers currently registered */
|
||||
/* within the library. */
|
||||
/* */
|
||||
/* cur_renderer :: The current outline renderer. This is a */
|
||||
/* shortcut used to avoid parsing the list on */
|
||||
/* each call to FT_Outline_Render(). It is a */
|
||||
/* handle to the current renderer for the */
|
||||
/* ft_glyph_format_outline format. */
|
||||
/* */
|
||||
/* auto_hinter :: XXX */
|
||||
/* */
|
||||
/* raster_pool :: The raster object's render pool. This can */
|
||||
/* ideally be changed dynamically at run-time. */
|
||||
/* */
|
||||
/* raster_pool_size :: The size of the render pool in bytes. */
|
||||
/* */
|
||||
/* debug_hooks :: XXX */
|
||||
/* */
|
||||
typedef struct FT_LibraryRec_
|
||||
{
|
||||
FT_Memory memory; /* library's memory manager */
|
||||
|
||||
FT_Generic generic;
|
||||
|
||||
FT_UInt num_modules;
|
||||
FT_Module modules[FT_MAX_MODULES]; /* module objects */
|
||||
|
||||
FT_ListRec renderers; /* list of renderers */
|
||||
FT_Renderer cur_renderer; /* current outline renderer */
|
||||
FT_Module auto_hinter;
|
||||
|
||||
FT_Byte* raster_pool; /* scan-line conversion */
|
||||
/* render pool */
|
||||
FT_ULong raster_pool_size; /* size of render pool in bytes */
|
||||
|
||||
FT_DebugHook_Func debug_hooks[4];
|
||||
|
||||
} FT_LibraryRec;
|
||||
|
||||
|
||||
FT_BASE( FT_Renderer )
|
||||
FT_Lookup_Renderer( FT_Library library,
|
||||
FT_Glyph_Format format,
|
||||
FT_ListNode* node );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Render_Glyph_Internal( FT_Library library,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt render_mode );
|
||||
|
||||
typedef const char*
|
||||
(*FT_PSName_Requester)( FT_Face face );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Glyph_Name_Requester)( FT_Face face,
|
||||
FT_UInt glyph_index,
|
||||
FT_Pointer buffer,
|
||||
FT_UInt buffer_max );
|
||||
|
||||
typedef FT_UInt
|
||||
(*FT_Name_Index_Requester)( FT_Face face,
|
||||
FT_String* glyph_name );
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Stream */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new stream object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* filepathname :: The name of the stream (usually a file) to be */
|
||||
/* opened. */
|
||||
/* */
|
||||
/* stream :: A pointer to the stream object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_New_Stream( const char* filepathname,
|
||||
FT_Stream astream );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Done_Stream */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Closes and destroys a stream object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The stream to be closed and destroyed. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Done_Stream( FT_Stream stream );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Memory */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new memory object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* A pointer to the new memory object. 0 in case of error. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Memory )
|
||||
FT_New_Memory( void );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Done_Memory */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Discards memory manager. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to the memory manager. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Done_Memory( FT_Memory memory );
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
||||
|
||||
|
||||
/* Define default raster's interface. The default raster is located in */
|
||||
/* `src/base/ftraster.c'. */
|
||||
/* */
|
||||
/* Client applications can register new rasters through the */
|
||||
/* FT_Set_Raster() API. */
|
||||
|
||||
#ifndef FT_NO_DEFAULT_RASTER
|
||||
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
|
||||
#endif
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTOBJS_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,436 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftstream.h */
|
||||
/* */
|
||||
/* Stream handling(specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __FTSTREAM_H__
|
||||
#define __FTSTREAM_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* format of an 8-bit frame_op value = [ xxxxx | e | s ] */
|
||||
/* s is set to 1 if the value is signed, */
|
||||
/* e is set to 1 if the value is little-endian */
|
||||
/* xxxxx is a command */
|
||||
|
||||
#define FT_FRAME_OP_SHIFT 2
|
||||
#define FT_FRAME_OP_SIGNED 1
|
||||
#define FT_FRAME_OP_LITTLE 2
|
||||
#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
|
||||
|
||||
#define FT_MAKE_FRAME_OP( command, little, sign ) \
|
||||
( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
|
||||
|
||||
#define FT_FRAME_OP_END 0
|
||||
#define FT_FRAME_OP_START 1 /* start a new frame */
|
||||
#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
|
||||
#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
|
||||
#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
|
||||
#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
|
||||
#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
|
||||
|
||||
|
||||
typedef enum FT_Frame_Op_
|
||||
{
|
||||
ft_frame_end = 0,
|
||||
ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
|
||||
|
||||
ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
|
||||
ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
|
||||
|
||||
ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
|
||||
ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
|
||||
ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
|
||||
ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
|
||||
|
||||
ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
|
||||
ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
|
||||
ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
|
||||
ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
|
||||
|
||||
ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
|
||||
ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
|
||||
ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
|
||||
ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
|
||||
|
||||
ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
|
||||
ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
|
||||
|
||||
} FT_Frame_Op;
|
||||
|
||||
|
||||
typedef struct FT_Frame_Field_
|
||||
{
|
||||
FT_Byte value;
|
||||
FT_Byte size;
|
||||
FT_UShort offset;
|
||||
|
||||
} FT_Frame_Field;
|
||||
|
||||
|
||||
/* Construct an FT_Frame_Field out of a structure type and a field name. */
|
||||
/* The structure type must be set in the FT_STRUCTURE macro before */
|
||||
/* calling the FT_FRAME_START() macro. */
|
||||
#define FT_FIELD_SIZE( f ) \
|
||||
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
|
||||
|
||||
#define FT_FIELD_SIZE_DELTA( f ) \
|
||||
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
|
||||
|
||||
#define FT_FIELD_OFFSET( f ) \
|
||||
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
|
||||
|
||||
#define FT_FRAME_FIELD( frame_op, field ) \
|
||||
{ \
|
||||
frame_op, \
|
||||
FT_FIELD_SIZE( field ), \
|
||||
FT_FIELD_OFFSET( field ) \
|
||||
}
|
||||
|
||||
#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
|
||||
|
||||
#define FT_FRAME_START( size ) { ft_frame_start, 0, size }
|
||||
#define FT_FRAME_END { ft_frame_end, 0, 0 }
|
||||
|
||||
#define FT_FRAME_LONG( f ) FT_FRAME_FIELD( ft_frame_long_be, f )
|
||||
#define FT_FRAME_ULONG( f ) FT_FRAME_FIELD( ft_frame_ulong_be, f )
|
||||
#define FT_FRAME_SHORT( f ) FT_FRAME_FIELD( ft_frame_short_be, f )
|
||||
#define FT_FRAME_USHORT( f ) FT_FRAME_FIELD( ft_frame_ushort_be, f )
|
||||
#define FT_FRAME_BYTE( f ) FT_FRAME_FIELD( ft_frame_byte, f )
|
||||
#define FT_FRAME_CHAR( f ) FT_FRAME_FIELD( ft_frame_schar, f )
|
||||
|
||||
#define FT_FRAME_LONG_LE( f ) FT_FRAME_FIELD( ft_frame_long_le, f )
|
||||
#define FT_FRAME_ULONG_LE( f ) FT_FRAME_FIELD( ft_frame_ulong_le, f )
|
||||
#define FT_FRAME_SHORT_LE( f ) FT_FRAME_FIELD( ft_frame_short_le, f )
|
||||
#define FT_FRAME_USHORT_LE( f ) FT_FRAME_FIELD( ft_frame_ushort_le, f )
|
||||
|
||||
#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
|
||||
#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
|
||||
#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
|
||||
|
||||
#define FT_FRAME_BYTES( field, count ) \
|
||||
{ \
|
||||
ft_frame_bytes, \
|
||||
count, \
|
||||
FT_FIELD_OFFSET( field ) \
|
||||
}
|
||||
|
||||
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* integer extraction macros -- the `buffer' parameter must ALWAYS be of */
|
||||
/* type `char*' or equivalent (1-byte elements). */
|
||||
/* */
|
||||
|
||||
#define FT_GET_SHORT_BE( p ) \
|
||||
((FT_Int16)( ( (FT_Int16)(FT_Char)(p)[0] << 8 ) | \
|
||||
(FT_Int16)(FT_Byte)(p)[1] ) )
|
||||
|
||||
#define FT_GET_USHORT_BE( p ) \
|
||||
((FT_Int16)( ( (FT_UInt16)(FT_Byte)(p)[0] << 8 ) | \
|
||||
(FT_UInt16)(FT_Byte)(p)[1] ) )
|
||||
|
||||
#define FT_GET_OFF3_BE( p ) \
|
||||
( (FT_Int32) ( ( (FT_Int32)(FT_Char)(p)[0] << 16 ) | \
|
||||
( (FT_Int32)(FT_Byte)(p)[1] << 8 ) | \
|
||||
(FT_Int32)(FT_Byte)(p)[2] ) )
|
||||
|
||||
#define FT_GET_UOFF3_BE( p ) \
|
||||
( (FT_Int32) ( ( (FT_UInt32)(FT_Byte)(p)[0] << 16 ) | \
|
||||
( (FT_UInt32)(FT_Byte)(p)[1] << 8 ) | \
|
||||
(FT_UInt32)(FT_Byte)(p)[2] ) )
|
||||
|
||||
#define FT_GET_LONG_BE( p ) \
|
||||
( (FT_Int32) ( ( (FT_Int32)(FT_Char)(p)[0] << 24 ) | \
|
||||
( (FT_Int32)(FT_Byte)(p)[1] << 16 ) | \
|
||||
( (FT_Int32)(FT_Byte)(p)[2] << 8 ) | \
|
||||
(FT_Int32)(FT_Byte)(p)[3] ) )
|
||||
|
||||
#define FT_GET_ULONG_BE( p ) \
|
||||
( (FT_Int32) ( ( (FT_UInt32)(FT_Byte)(p)[0] << 24 ) | \
|
||||
( (FT_UInt32)(FT_Byte)(p)[1] << 16 ) | \
|
||||
( (FT_UInt32)(FT_Byte)(p)[2] << 8 ) | \
|
||||
(FT_UInt32)(FT_Byte)(p)[3] ) )
|
||||
|
||||
#define FT_GET_SHORT_LE( p ) \
|
||||
((FT_Int16)( ( (FT_Int16)(FT_Char)(p)[1] << 8 ) | \
|
||||
(FT_Int16)(FT_Byte)(p)[0] ) )
|
||||
|
||||
#define FT_GET_USHORT_LE( p ) \
|
||||
((FT_Int16)( ( (FT_UInt16)(FT_Byte)(p)[1] << 8 ) | \
|
||||
(FT_UInt16)(FT_Byte)(p)[0] ) )
|
||||
|
||||
#define FT_GET_OFF3_LE( p ) \
|
||||
( (FT_Int32) ( ( (FT_Int32)(FT_Char)(p)[2] << 16 ) | \
|
||||
( (FT_Int32)(FT_Byte)(p)[1] << 8 ) | \
|
||||
(FT_Int32)(FT_Byte)(p)[0] ) )
|
||||
|
||||
#define FT_GET_UOFF3_LE( p ) \
|
||||
( (FT_Int32) ( ( (FT_UInt32)(FT_Byte)(p)[2] << 16 ) | \
|
||||
( (FT_UInt32)(FT_Byte)(p)[1] << 8 ) | \
|
||||
(FT_UInt32)(FT_Byte)(p)[0] ) )
|
||||
|
||||
#define FT_GET_LONG_LE( p ) \
|
||||
( (FT_Int32) ( ( (FT_Int32)(FT_Char)(p)[3] << 24 ) | \
|
||||
( (FT_Int32)(FT_Byte)(p)[2] << 16 ) | \
|
||||
( (FT_Int32)(FT_Byte)(p)[1] << 8 ) | \
|
||||
(FT_Int32)(FT_Byte)(p)[0] ) )
|
||||
|
||||
#define FT_GET_ULONG_LE( p ) \
|
||||
( (FT_Int32) ( ( (FT_UInt32)(FT_Byte)(p)[3] << 24 ) | \
|
||||
( (FT_UInt32)(FT_Byte)(p)[2] << 16 ) | \
|
||||
( (FT_UInt32)(FT_Byte)(p)[1] << 8 ) | \
|
||||
(FT_UInt32)(FT_Byte)(p)[0] ) )
|
||||
|
||||
|
||||
#define NEXT_Char( buffer ) \
|
||||
( (signed char)*buffer++ )
|
||||
|
||||
#define NEXT_Byte( buffer ) \
|
||||
( (unsigned char)*buffer++ )
|
||||
|
||||
#define NEXT_Short( buffer ) \
|
||||
( (short)( buffer += 2, FT_GET_SHORT_BE( buffer - 2 ) ) )
|
||||
|
||||
#define NEXT_UShort( buffer ) \
|
||||
( (unsigned short)( buffer += 2, FT_GET_USHORT_BE( buffer - 2 ) ) )
|
||||
|
||||
#define NEXT_Offset( buffer ) \
|
||||
( (long)( buffer += 3, FT_GET_OFF3_BE( buffer - 3 ) ) )
|
||||
|
||||
#define NEXT_UOffset( buffer ) \
|
||||
( (unsigned long)( buffer += 3, FT_GET_UOFF3_BE( buffer - 3 ) ) )
|
||||
|
||||
#define NEXT_Long( buffer ) \
|
||||
( (long)( buffer += 4, FT_GET_LONG_BE( buffer - 4 ) ) )
|
||||
|
||||
#define NEXT_ULong( buffer ) \
|
||||
( (unsigned long)( buffer += 4, FT_GET_ULONG_BE( buffer - 4 ) ) )
|
||||
|
||||
|
||||
#define NEXT_ShortLE( buffer ) \
|
||||
( (short)( buffer += 2, FT_GET_SHORT_LE( buffer - 2 ) ) )
|
||||
|
||||
#define NEXT_UShortLE( buffer ) \
|
||||
( (unsigned short)( buffer += 2, FT_GET_USHORT_LE( buffer - 2 ) ) )
|
||||
|
||||
#define NEXT_OffsetLE( buffer ) \
|
||||
( (long)( buffer += 3, FT_GET_OFF3_LE( buffer - 3 ) ) )
|
||||
|
||||
#define NEXT_UOffsetLE( buffer ) \
|
||||
( (unsigned long)( buffer += 3, FT_GET_UOFF3_LE( buffer - 3 ) ) )
|
||||
|
||||
|
||||
#define NEXT_LongLE( buffer ) \
|
||||
( (long)( buffer += 4, FT_GET_LONG_LE( buffer - 4 ) ) )
|
||||
|
||||
#define NEXT_ULongLE( buffer ) \
|
||||
( (unsigned long)( buffer += 4, FT_GET_ULONG_LE( buffer - 4 ) ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each GET_xxxx() macro uses an implicit `stream' variable. */
|
||||
/* */
|
||||
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
|
||||
|
||||
#define GET_Char() FT_GET_MACRO( FT_Get_Char, FT_Char )
|
||||
#define GET_Byte() FT_GET_MACRO( FT_Get_Char, FT_Byte )
|
||||
#define GET_Short() FT_GET_MACRO( FT_Get_Short, FT_Short )
|
||||
#define GET_UShort() FT_GET_MACRO( FT_Get_Short, FT_UShort )
|
||||
#define GET_Offset() FT_GET_MACRO( FT_Get_Offset, FT_Long )
|
||||
#define GET_UOffset() FT_GET_MACRO( FT_Get_Offset, FT_ULong )
|
||||
#define GET_Long() FT_GET_MACRO( FT_Get_Long, FT_Long )
|
||||
#define GET_ULong() FT_GET_MACRO( FT_Get_Long, FT_ULong )
|
||||
#define GET_Tag4() FT_GET_MACRO( FT_Get_Long, FT_ULong )
|
||||
|
||||
#define GET_ShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_Short )
|
||||
#define GET_UShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_UShort )
|
||||
#define GET_LongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Long )
|
||||
#define GET_ULongLE() FT_GET_MACRO( FT_Get_LongLE, FT_ULong )
|
||||
|
||||
#define FT_READ_MACRO( func, type, var ) \
|
||||
( var = (type)func( stream, &error ), \
|
||||
error != FT_Err_Ok )
|
||||
|
||||
#define READ_Byte( var ) FT_READ_MACRO( FT_Read_Char, FT_Byte, var )
|
||||
#define READ_Char( var ) FT_READ_MACRO( FT_Read_Char, FT_Char, var )
|
||||
#define READ_Short( var ) FT_READ_MACRO( FT_Read_Short, FT_Short, var )
|
||||
#define READ_UShort( var ) FT_READ_MACRO( FT_Read_Short, FT_UShort, var )
|
||||
#define READ_Offset( var ) FT_READ_MACRO( FT_Read_Offset, FT_Long, var )
|
||||
#define READ_UOffset( var ) FT_READ_MACRO( FT_Read_Offset, FT_ULong, var )
|
||||
#define READ_Long( var ) FT_READ_MACRO( FT_Read_Long, FT_Long, var )
|
||||
#define READ_ULong( var ) FT_READ_MACRO( FT_Read_Long, FT_ULong, var )
|
||||
|
||||
#define READ_ShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_Short, var )
|
||||
#define READ_UShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_UShort, var )
|
||||
#define READ_LongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_Long, var )
|
||||
#define READ_ULongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_ULong, var )
|
||||
|
||||
|
||||
FT_BASE( void )
|
||||
FT_New_Memory_Stream( FT_Library library,
|
||||
FT_Byte* base,
|
||||
FT_ULong size,
|
||||
FT_Stream stream );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Seek_Stream( FT_Stream stream,
|
||||
FT_ULong pos );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Skip_Stream( FT_Stream stream,
|
||||
FT_Long distance );
|
||||
|
||||
FT_BASE( FT_Long )
|
||||
FT_Stream_Pos( FT_Stream stream );
|
||||
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Read_Stream( FT_Stream stream,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Read_Stream_At( FT_Stream stream,
|
||||
FT_ULong pos,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Access_Frame( FT_Stream stream,
|
||||
FT_ULong count );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Forget_Frame( FT_Stream stream );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Extract_Frame( FT_Stream stream,
|
||||
FT_ULong count,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Release_Frame( FT_Stream stream,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
FT_BASE( FT_Char )
|
||||
FT_Get_Char( FT_Stream stream );
|
||||
|
||||
FT_BASE( FT_Short )
|
||||
FT_Get_Short( FT_Stream stream );
|
||||
|
||||
FT_BASE( FT_Long )
|
||||
FT_Get_Offset( FT_Stream stream );
|
||||
|
||||
FT_BASE( FT_Long )
|
||||
FT_Get_Long( FT_Stream stream );
|
||||
|
||||
FT_BASE( FT_Short )
|
||||
FT_Get_ShortLE( FT_Stream stream );
|
||||
|
||||
FT_BASE( FT_Long )
|
||||
FT_Get_LongLE( FT_Stream stream );
|
||||
|
||||
|
||||
FT_BASE( FT_Char )
|
||||
FT_Read_Char( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
FT_BASE( FT_Short )
|
||||
FT_Read_Short( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
FT_BASE( FT_Long )
|
||||
FT_Read_Offset( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
FT_BASE( FT_Long )
|
||||
FT_Read_Long( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
FT_BASE( FT_Short )
|
||||
FT_Read_ShortLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
FT_BASE( FT_Long )
|
||||
FT_Read_LongLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Read_Fields( FT_Stream stream,
|
||||
const FT_Frame_Field* fields,
|
||||
void* structure );
|
||||
|
||||
|
||||
#define USE_Stream( resource, stream ) \
|
||||
FT_SET_ERROR( FT_Open_Stream( resource, stream ) )
|
||||
|
||||
#define DONE_Stream( stream ) \
|
||||
FT_Done_Stream( stream )
|
||||
|
||||
|
||||
#define ACCESS_Frame( size ) \
|
||||
FT_SET_ERROR( FT_Access_Frame( stream, size ) )
|
||||
|
||||
#define FORGET_Frame() \
|
||||
FT_Forget_Frame( stream )
|
||||
|
||||
#define EXTRACT_Frame( size, bytes ) \
|
||||
FT_SET_ERROR( FT_Extract_Frame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
|
||||
#define RELEASE_Frame( bytes ) \
|
||||
FT_Release_Frame( stream, (FT_Byte**)&(bytes) )
|
||||
|
||||
#define FILE_Seek( position ) \
|
||||
FT_SET_ERROR( FT_Seek_Stream( stream, position ) )
|
||||
|
||||
#define FILE_Skip( distance ) \
|
||||
FT_SET_ERROR( FT_Skip_Stream( stream, distance ) )
|
||||
|
||||
#define FILE_Pos() \
|
||||
FT_Stream_Pos( stream )
|
||||
|
||||
#define FILE_Read( buffer, count ) \
|
||||
FT_SET_ERROR( FT_Read_Stream( stream, \
|
||||
(FT_Byte*)buffer, \
|
||||
count ) )
|
||||
|
||||
#define FILE_Read_At( position, buffer, count ) \
|
||||
FT_SET_ERROR( FT_Read_Stream_At( stream, \
|
||||
position, \
|
||||
(FT_Byte*)buffer, \
|
||||
count ) )
|
||||
|
||||
#define READ_Fields( fields, object ) \
|
||||
( ( error = FT_Read_Fields( stream, fields, object ) ) != FT_Err_Ok )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSTREAM_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,51 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* internal.h */
|
||||
/* */
|
||||
/* Internal header files (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 automatically included by `ft2build.h'. */
|
||||
/* Do not include it manually! */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
|
||||
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
|
||||
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
|
||||
#define FT_INTERNAL_EXTENSION_H <freetype/internal/ftextend.h>
|
||||
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
|
||||
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
|
||||
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
|
||||
#define FT_INTERNAL_EXTEND_H <freetype/internal/ftextend.h>
|
||||
|
||||
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
|
||||
|
||||
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
|
||||
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
|
||||
#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h>
|
||||
#define FT_INTERNAL_FNT_TYPES_H <freetype/internal/fnttypes.h>
|
||||
|
||||
#define FT_INTERNAL_POSTSCRIPT_NAMES_H <freetype/internal/psnames.h>
|
||||
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
|
||||
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
|
||||
#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
|
||||
|
||||
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,671 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* psaux.h */
|
||||
/* */
|
||||
/* Auxiliary functions and data structures related to PostScript fonts */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __PSAUX_H__
|
||||
#define __PSAUX_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_TYPE1_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** T1_TABLE *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
typedef struct PS_Table_ PS_Table;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* PS_Table_Funcs */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A set of function pointers to manage PS_Table objects. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* table_init :: Used to initialize a table. */
|
||||
/* */
|
||||
/* table_done :: Finalizes resp. destroy a given table. */
|
||||
/* */
|
||||
/* table_add :: Adds a new object to a table. */
|
||||
/* */
|
||||
/* table_release :: Releases table data, then finalizes it. */
|
||||
/* */
|
||||
typedef struct PS_Table_Funcs_
|
||||
{
|
||||
FT_Error
|
||||
(*init)( PS_Table* table,
|
||||
FT_Int count,
|
||||
FT_Memory memory );
|
||||
|
||||
void
|
||||
(*done)( PS_Table* table );
|
||||
|
||||
FT_Error
|
||||
(*add)( PS_Table* table,
|
||||
FT_Int index,
|
||||
void* object,
|
||||
FT_Int length );
|
||||
|
||||
void
|
||||
(*release)( PS_Table* table );
|
||||
|
||||
} PS_Table_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* PS_Table */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A PS_Table is a simple object used to store an array of objects in */
|
||||
/* a single memory block. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* block :: The address in memory of the growheap's block. This */
|
||||
/* can change between two object adds, due to */
|
||||
/* reallocation. */
|
||||
/* */
|
||||
/* cursor :: The current top of the grow heap within its block. */
|
||||
/* */
|
||||
/* capacity :: The current size of the heap block. Increments by */
|
||||
/* 1kByte chunks. */
|
||||
/* */
|
||||
/* max_elems :: The maximum number of elements in table. */
|
||||
/* */
|
||||
/* num_elems :: The current number of elements in table. */
|
||||
/* */
|
||||
/* elements :: A table of element addresses within the block. */
|
||||
/* */
|
||||
/* lengths :: A table of element sizes within the block. */
|
||||
/* */
|
||||
/* memory :: The object used for memory operations */
|
||||
/* (alloc/realloc). */
|
||||
/* */
|
||||
/* funcs :: A table of method pointers for this object. */
|
||||
/* */
|
||||
struct PS_Table_
|
||||
{
|
||||
FT_Byte* block; /* current memory block */
|
||||
FT_Offset cursor; /* current cursor in memory block */
|
||||
FT_Offset capacity; /* current size of memory block */
|
||||
FT_Long init;
|
||||
|
||||
FT_Int max_elems;
|
||||
FT_Int num_elems;
|
||||
FT_Byte** elements; /* addresses of table elements */
|
||||
FT_Int* lengths; /* lengths of table elements */
|
||||
|
||||
FT_Memory memory;
|
||||
PS_Table_Funcs funcs;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** T1 FIELDS & TOKENS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct T1_Parser_ T1_Parser;
|
||||
|
||||
/* simple enumeration type used to identify token types */
|
||||
typedef enum T1_Token_Type_
|
||||
{
|
||||
t1_token_none = 0,
|
||||
t1_token_any,
|
||||
t1_token_string,
|
||||
t1_token_array,
|
||||
|
||||
/* do not remove */
|
||||
t1_token_max
|
||||
|
||||
} T1_Token_Type;
|
||||
|
||||
|
||||
/* a simple structure used to identify tokens */
|
||||
typedef struct T1_Token_
|
||||
{
|
||||
FT_Byte* start; /* first character of token in input stream */
|
||||
FT_Byte* limit; /* first character after the token */
|
||||
T1_Token_Type type; /* type of token */
|
||||
|
||||
} T1_Token;
|
||||
|
||||
|
||||
/* enumeration type used to identify object fields */
|
||||
typedef enum T1_Field_Type_
|
||||
{
|
||||
t1_field_none = 0,
|
||||
t1_field_bool,
|
||||
t1_field_integer,
|
||||
t1_field_fixed,
|
||||
t1_field_string,
|
||||
t1_field_integer_array,
|
||||
t1_field_fixed_array,
|
||||
t1_field_callback,
|
||||
|
||||
/* do not remove */
|
||||
t1_field_max
|
||||
|
||||
} T1_Field_Type;
|
||||
|
||||
typedef enum T1_Field_Location_
|
||||
{
|
||||
t1_field_cid_info,
|
||||
t1_field_font_dict,
|
||||
t1_field_font_info,
|
||||
t1_field_private,
|
||||
|
||||
/* do not remove */
|
||||
t1_field_location_max
|
||||
|
||||
} T1_Field_Location;
|
||||
|
||||
|
||||
typedef void
|
||||
(*T1_Field_Parser)( FT_Face face,
|
||||
FT_Pointer parser );
|
||||
|
||||
|
||||
/* structure type used to model object fields */
|
||||
typedef struct T1_Field_
|
||||
{
|
||||
const char* ident; /* field identifier */
|
||||
T1_Field_Location location;
|
||||
T1_Field_Type type; /* type of field */
|
||||
T1_Field_Parser reader;
|
||||
FT_UInt offset; /* offset of field in object */
|
||||
FT_Byte size; /* size of field in bytes */
|
||||
FT_UInt array_max; /* maximal number of elements for */
|
||||
/* array */
|
||||
FT_UInt count_offset; /* offset of element count for */
|
||||
/* arrays */
|
||||
} T1_Field;
|
||||
|
||||
|
||||
#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname ) \
|
||||
{ \
|
||||
_ident, T1CODE, _type, \
|
||||
0, \
|
||||
FT_FIELD_OFFSET( _fname ), \
|
||||
FT_FIELD_SIZE( _fname ), \
|
||||
0, 0 \
|
||||
},
|
||||
|
||||
#define T1_NEW_CALLBACK_FIELD( _ident, _reader ) \
|
||||
{ \
|
||||
_ident, T1CODE, t1_field_callback, \
|
||||
(T1_Field_Parser)_reader, \
|
||||
0, 0, \
|
||||
0, 0 \
|
||||
},
|
||||
|
||||
#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max ) \
|
||||
{ \
|
||||
_ident, T1CODE, _type, \
|
||||
0, \
|
||||
FT_FIELD_OFFSET( _fname ), \
|
||||
FT_FIELD_SIZE_DELTA( _fname ), \
|
||||
_max, \
|
||||
FT_FIELD_OFFSET( num_ ## _fname ) \
|
||||
},
|
||||
|
||||
#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max ) \
|
||||
{ \
|
||||
_ident, T1CODE, _type, \
|
||||
0, \
|
||||
FT_FIELD_OFFSET( _fname ), \
|
||||
FT_FIELD_SIZE_DELTA( _fname ), \
|
||||
_max, 0 \
|
||||
},
|
||||
|
||||
|
||||
#define T1_FIELD_BOOL( _ident, _fname ) \
|
||||
T1_NEW_SIMPLE_FIELD( _ident, t1_field_bool, _fname )
|
||||
|
||||
#define T1_FIELD_NUM( _ident, _fname ) \
|
||||
T1_NEW_SIMPLE_FIELD( _ident, t1_field_integer, _fname )
|
||||
|
||||
#define T1_FIELD_FIXED( _ident, _fname ) \
|
||||
T1_NEW_SIMPLE_FIELD( _ident, t1_field_fixed, _fname )
|
||||
|
||||
#define T1_FIELD_STRING( _ident, _fname ) \
|
||||
T1_NEW_SIMPLE_FIELD( _ident, t1_field_string, _fname )
|
||||
|
||||
#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax ) \
|
||||
T1_NEW_TABLE_FIELD( _ident, t1_field_integer_array, \
|
||||
_fname, _fmax )
|
||||
|
||||
#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax ) \
|
||||
T1_NEW_TABLE_FIELD( _ident, t1_field_fixed_array, \
|
||||
_fname, _fmax )
|
||||
|
||||
#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax ) \
|
||||
T1_NEW_TABLE_FIELD2( _ident, t1_field_integer_array, \
|
||||
_fname, _fmax )
|
||||
|
||||
#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax ) \
|
||||
T1_NEW_TABLE_FIELD2( _ident, t1_field_fixed_array, \
|
||||
_fname, _fmax )
|
||||
|
||||
#define T1_FIELD_CALLBACK( _ident, _name ) \
|
||||
T1_NEW_CALLBACK_FIELD( _ident, _name )
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** T1 PARSER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct T1_Parser_Funcs_
|
||||
{
|
||||
void
|
||||
(*init)( T1_Parser* parser,
|
||||
FT_Byte* base,
|
||||
FT_Byte* limit,
|
||||
FT_Memory memory );
|
||||
|
||||
void
|
||||
(*done)( T1_Parser* parser );
|
||||
|
||||
void
|
||||
(*skip_spaces)( T1_Parser* parser );
|
||||
void
|
||||
(*skip_alpha)( T1_Parser* parser );
|
||||
|
||||
FT_Long
|
||||
(*to_int)( T1_Parser* parser );
|
||||
FT_Fixed
|
||||
(*to_fixed)( T1_Parser* parser,
|
||||
FT_Int power_ten );
|
||||
FT_Int
|
||||
(*to_coord_array)( T1_Parser* parser,
|
||||
FT_Int max_coords,
|
||||
FT_Short* coords );
|
||||
FT_Int
|
||||
(*to_fixed_array)( T1_Parser* parser,
|
||||
FT_Int max_values,
|
||||
FT_Fixed* values,
|
||||
FT_Int power_ten );
|
||||
|
||||
void
|
||||
(*to_token)( T1_Parser* parser,
|
||||
T1_Token* token );
|
||||
void
|
||||
(*to_token_array)( T1_Parser* parser,
|
||||
T1_Token* tokens,
|
||||
FT_UInt max_tokens,
|
||||
FT_Int* pnum_tokens );
|
||||
|
||||
FT_Error
|
||||
(*load_field)( T1_Parser* parser,
|
||||
const T1_Field* field,
|
||||
void** objects,
|
||||
FT_UInt max_objects,
|
||||
FT_ULong* pflags );
|
||||
|
||||
FT_Error
|
||||
(*load_field_table)( T1_Parser* parser,
|
||||
const T1_Field* field,
|
||||
void** objects,
|
||||
FT_UInt max_objects,
|
||||
FT_ULong* pflags );
|
||||
|
||||
} T1_Parser_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* T1_Parser */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A T1_Parser is an object used to parse a Type 1 font very quickly. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* cursor :: The current position in the text. */
|
||||
/* */
|
||||
/* base :: Start of the processed text. */
|
||||
/* */
|
||||
/* limit :: End of the processed text. */
|
||||
/* */
|
||||
/* error :: The last error returned. */
|
||||
/* */
|
||||
/* memory :: The object used for memory operations (alloc/realloc). */
|
||||
/* */
|
||||
/* funcs :: A table of functions for the parser. */
|
||||
/* */
|
||||
struct T1_Parser_
|
||||
{
|
||||
FT_Byte* cursor;
|
||||
FT_Byte* base;
|
||||
FT_Byte* limit;
|
||||
FT_Error error;
|
||||
FT_Memory memory;
|
||||
|
||||
T1_Parser_Funcs funcs;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** T1 BUILDER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
typedef struct T1_Builder_ T1_Builder;
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*T1_Builder_Check_Points_Func)( T1_Builder* builder,
|
||||
FT_Int count );
|
||||
|
||||
typedef void
|
||||
(*T1_Builder_Add_Point_Func)( T1_Builder* builder,
|
||||
FT_Pos x,
|
||||
FT_Pos y,
|
||||
FT_Byte flag );
|
||||
|
||||
typedef FT_Error
|
||||
(*T1_Builder_Add_Point1_Func)( T1_Builder* builder,
|
||||
FT_Pos x,
|
||||
FT_Pos y );
|
||||
|
||||
typedef FT_Error
|
||||
(*T1_Builder_Add_Contour_Func)( T1_Builder* builder );
|
||||
|
||||
typedef FT_Error
|
||||
(*T1_Builder_Start_Point_Func)( T1_Builder* builder,
|
||||
FT_Pos x,
|
||||
FT_Pos y );
|
||||
|
||||
typedef void
|
||||
(*T1_Builder_Close_Contour_Func)( T1_Builder* builder );
|
||||
|
||||
|
||||
typedef struct T1_Builder_Funcs_
|
||||
{
|
||||
void
|
||||
(*init)( T1_Builder* builder,
|
||||
FT_Face face,
|
||||
FT_Size size,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Bool hinting );
|
||||
|
||||
void
|
||||
(*done)( T1_Builder* builder );
|
||||
|
||||
T1_Builder_Check_Points_Func check_points;
|
||||
T1_Builder_Add_Point_Func add_point;
|
||||
T1_Builder_Add_Point1_Func add_point1;
|
||||
T1_Builder_Add_Contour_Func add_contour;
|
||||
T1_Builder_Start_Point_Func start_point;
|
||||
T1_Builder_Close_Contour_Func close_contour;
|
||||
|
||||
} T1_Builder_Funcs;
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Structure> */
|
||||
/* T1_Builder */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used during glyph loading to store its outline. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* memory :: The current memory object. */
|
||||
/* */
|
||||
/* face :: The current face object. */
|
||||
/* */
|
||||
/* glyph :: The current glyph slot. */
|
||||
/* */
|
||||
/* loader :: XXX */
|
||||
/* */
|
||||
/* base :: The base glyph outline. */
|
||||
/* */
|
||||
/* current :: The current glyph outline. */
|
||||
/* */
|
||||
/* max_points :: maximum points in builder outline */
|
||||
/* */
|
||||
/* max_contours :: Maximal number of contours in builder outline. */
|
||||
/* */
|
||||
/* last :: The last point position. */
|
||||
/* */
|
||||
/* scale_x :: The horizontal scale (FUnits to sub-pixels). */
|
||||
/* */
|
||||
/* scale_y :: The vertical scale (FUnits to sub-pixels). */
|
||||
/* */
|
||||
/* pos_x :: The horizontal translation (if composite glyph). */
|
||||
/* */
|
||||
/* pos_y :: The vertical translation (if composite glyph). */
|
||||
/* */
|
||||
/* left_bearing :: The left side bearing point. */
|
||||
/* */
|
||||
/* advance :: The horizontal advance vector. */
|
||||
/* */
|
||||
/* bbox :: Unused. */
|
||||
/* */
|
||||
/* path_begun :: A flag which indicates that a new path has begun. */
|
||||
/* */
|
||||
/* load_points :: If this flag is not set, no points are loaded. */
|
||||
/* */
|
||||
/* no_recurse :: Set but not used. */
|
||||
/* */
|
||||
/* error :: An error code that is only used to report memory */
|
||||
/* allocation problems. */
|
||||
/* */
|
||||
/* metrics_only :: A boolean indicating that we only want to compute */
|
||||
/* the metrics of a given glyph, not load all of its */
|
||||
/* points. */
|
||||
/* */
|
||||
/* funcs :: An array of function pointers for the builder. */
|
||||
/* */
|
||||
struct T1_Builder_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_Face face;
|
||||
FT_GlyphSlot glyph;
|
||||
FT_GlyphLoader* loader;
|
||||
FT_Outline* base;
|
||||
FT_Outline* current;
|
||||
|
||||
FT_Vector last;
|
||||
|
||||
FT_Fixed scale_x;
|
||||
FT_Fixed scale_y;
|
||||
|
||||
FT_Pos pos_x;
|
||||
FT_Pos pos_y;
|
||||
|
||||
FT_Vector left_bearing;
|
||||
FT_Vector advance;
|
||||
|
||||
FT_BBox bbox; /* bounding box */
|
||||
FT_Bool path_begun;
|
||||
FT_Bool load_points;
|
||||
FT_Bool no_recurse;
|
||||
FT_Bool shift;
|
||||
|
||||
FT_Error error; /* only used for memory errors */
|
||||
FT_Bool metrics_only;
|
||||
|
||||
void* hints_funcs; /* hinter-specific */
|
||||
void* hints_globals; /* hinter-specific */
|
||||
|
||||
T1_Builder_Funcs funcs;
|
||||
};
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** T1 DECODER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#if 0
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
|
||||
/* calls during glyph loading. */
|
||||
/* */
|
||||
#define T1_MAX_SUBRS_CALLS 8
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
|
||||
/* minimum of 16 is required. */
|
||||
/* */
|
||||
#define T1_MAX_CHARSTRINGS_OPERANDS 32
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
typedef struct T1_Decoder_Zone_
|
||||
{
|
||||
FT_Byte* cursor;
|
||||
FT_Byte* base;
|
||||
FT_Byte* limit;
|
||||
|
||||
} T1_Decoder_Zone;
|
||||
|
||||
|
||||
typedef struct T1_Decoder_ T1_Decoder;
|
||||
typedef struct T1_Decoder_Funcs_ T1_Decoder_Funcs;
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*T1_Decoder_Callback)( T1_Decoder* decoder,
|
||||
FT_UInt glyph_index );
|
||||
|
||||
|
||||
struct T1_Decoder_Funcs_
|
||||
{
|
||||
FT_Error
|
||||
(*init) ( T1_Decoder* decoder,
|
||||
FT_Face face,
|
||||
FT_Size size,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Byte** glyph_names,
|
||||
T1_Blend* blend,
|
||||
FT_Bool hinting,
|
||||
T1_Decoder_Callback callback );
|
||||
|
||||
void
|
||||
(*done) ( T1_Decoder* decoder );
|
||||
|
||||
FT_Error
|
||||
(*parse_charstrings)( T1_Decoder* decoder,
|
||||
FT_Byte* base,
|
||||
FT_UInt len );
|
||||
};
|
||||
|
||||
|
||||
struct T1_Decoder_
|
||||
{
|
||||
T1_Builder builder;
|
||||
|
||||
FT_Long stack[T1_MAX_CHARSTRINGS_OPERANDS];
|
||||
FT_Long* top;
|
||||
|
||||
T1_Decoder_Zone zones[T1_MAX_SUBRS_CALLS + 1];
|
||||
T1_Decoder_Zone* zone;
|
||||
|
||||
PSNames_Interface* psnames; /* for seac */
|
||||
FT_UInt num_glyphs;
|
||||
FT_Byte** glyph_names;
|
||||
|
||||
FT_Int lenIV; /* internal for sub routine calls */
|
||||
FT_UInt num_subrs;
|
||||
FT_Byte** subrs;
|
||||
FT_Int* subrs_len; /* array of subrs length (optional) */
|
||||
|
||||
FT_Matrix font_matrix;
|
||||
FT_Vector font_offset;
|
||||
|
||||
FT_Int flex_state;
|
||||
FT_Int num_flex_vectors;
|
||||
FT_Vector flex_vectors[7];
|
||||
|
||||
T1_Blend* blend; /* for multiple master support */
|
||||
|
||||
T1_Decoder_Callback parse_callback;
|
||||
T1_Decoder_Funcs funcs;
|
||||
};
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PSAux Module Interface *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct PSAux_Interface_
|
||||
{
|
||||
const PS_Table_Funcs* ps_table_funcs;
|
||||
const T1_Parser_Funcs* t1_parser_funcs;
|
||||
const T1_Builder_Funcs* t1_builder_funcs;
|
||||
const T1_Decoder_Funcs* t1_decoder_funcs;
|
||||
|
||||
void
|
||||
(*t1_decrypt)( FT_Byte* buffer,
|
||||
FT_Offset length,
|
||||
FT_UShort seed );
|
||||
|
||||
} PSAux_Interface;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PSAUX_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,618 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* pshints.h */
|
||||
/* */
|
||||
/* Interface to Postscript-specific (Type 1 and Type 2) hints */
|
||||
/* recorders (specification only). These are used to support native */
|
||||
/* T1/T2 hints in the "type1", "cid" and "cff" font drivers. */
|
||||
/* */
|
||||
/* Copyright 2001 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 __PSHINTS_H__
|
||||
#define __PSHINTS_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_TYPE1_TABLES_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_GLOBALS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** INTERNAL REPRESENTATION OF GLOBALS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct PSH_GlobalsRec_* PSH_Globals;
|
||||
|
||||
typedef FT_Error
|
||||
(*PSH_Globals_NewFunc)( FT_Memory memory,
|
||||
T1_Private* private_dict,
|
||||
PSH_Globals* aglobals );
|
||||
|
||||
typedef FT_Error
|
||||
(*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
|
||||
FT_Fixed x_scale,
|
||||
FT_Fixed y_scale,
|
||||
FT_Fixed x_delta,
|
||||
FT_Fixed y_delta );
|
||||
|
||||
typedef void
|
||||
(*PSH_Globals_DestroyFunc)( PSH_Globals globals );
|
||||
|
||||
|
||||
typedef struct PSH_Globals_FuncsRec_
|
||||
{
|
||||
PSH_Globals_NewFunc create;
|
||||
PSH_Globals_SetScaleFunc set_scale;
|
||||
PSH_Globals_DestroyFunc destroy;
|
||||
|
||||
} PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PUBLIC TYPE 1 HINTS RECORDER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T1_Hints */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This is a handle to an opaque structure used to record glyph hints */
|
||||
/* from a Type 1 character glyph character string. */
|
||||
/* */
|
||||
/* The methods used to operate on this object are defined by the */
|
||||
/* @T1_Hints_FuncsRec structure. Recording glyph hints is normally */
|
||||
/* achieved through the following scheme: */
|
||||
/* */
|
||||
/* - Open a new hint recording session by calling the "open" method. */
|
||||
/* This will rewind the recorder and prepare it for new input. */
|
||||
/* */
|
||||
/* - For each hint found in the glyph charstring, call the */
|
||||
/* corresponding method ("stem", "stem3", or "reset"). Note that */
|
||||
/* these functions do not return an error code. */
|
||||
/* */
|
||||
/* - Close the recording session by calling the "close" method. It */
|
||||
/* will return an error code if the hints were invalid or something */
|
||||
/* strange happened (e.g. memory shortage). */
|
||||
/* */
|
||||
/* The hints accumulated in the object can later be used by the */
|
||||
/* Postscript hinter. */
|
||||
/* */
|
||||
typedef struct T1_HintsRec_* T1_Hints;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T1_Hints_Funcs */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A pointer to the @T1_Hints_FuncsRec structure that defines the */
|
||||
/* API of a given @T1_Hints object. */
|
||||
/* */
|
||||
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_OpenFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to prepare it for a new */
|
||||
/* Type 1 hints recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* You should always call the @T1_Hints_CloseFunc method in order to */
|
||||
/* close an opened recording session. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_OpenFunc)( T1_Hints hints );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_SetStemFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to record a new horizontal or */
|
||||
/* vertical stem. This corresponds to the Type 1 "hstem" and "vstem" */
|
||||
/* operators. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */
|
||||
/* (vstem). */
|
||||
/* */
|
||||
/* coords :: Array of 2 integers, used as (position,length) stem */
|
||||
/* descriptor. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* "coords[0]" is the absolute stem position (lowest coordinate); */
|
||||
/* "coords[1]" is the length. */
|
||||
/* */
|
||||
/* The length can be negative, in which case it must be either -20 or */
|
||||
/* -21. It will be interpreted as a "ghost" stem, according to */
|
||||
/* Type 1 specification. */
|
||||
/* */
|
||||
/* If the length is -21 (corresponding to a bottom ghost stem), then */
|
||||
/* the real stem position is "coords[0]+coords[1]". */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_SetStemFunc)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Long* coords );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_SetStem3Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to record three */
|
||||
/* counter-controlled horizontal or vertical stems at once. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems, 1 for vertical ones. */
|
||||
/* */
|
||||
/* coords :: An array of 6 integers, holding 3 (position,length) */
|
||||
/* pairs for the counter-controlled stems. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* The lengths cannot be negative (ghost stems are never */
|
||||
/* counter-controlled). */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_SetStem3Func)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Long* coords );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_ResetFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to reset the stems hints in a */
|
||||
/* recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* end_point :: The index of the last point in the input glyph in */
|
||||
/* which the previously defined hints apply. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T1_Hints_ResetFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to close a hint recording */
|
||||
/* session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The index of the last point in the input glyph. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* The error code will be set to indicate that an error occured */
|
||||
/* during the recording session. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T1_Hints_CloseFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_ApplyFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to apply hints to the */
|
||||
/* corresponding glyph outline. Must be called once all hints have */
|
||||
/* been recorded. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* globals :: The hinter globals for this font. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* On input, all points within the outline are in font coordinates. */
|
||||
/* On output, they are in 1/64th of pixels. */
|
||||
/* */
|
||||
/* The scaling transformation is taken from the "globals" object */
|
||||
/* which must correspond to the same font as the glyph. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T1_Hints_ApplyFunc)( T1_Hints hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* T1_Hints_FuncsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The structure used to provide the API to @T1_Hints objects. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* hints :: A handle to the T1 Hints recorder. */
|
||||
/* */
|
||||
/* open :: The function to open a recording session. */
|
||||
/* */
|
||||
/* close :: The function to close a recording session. */
|
||||
/* */
|
||||
/* stem :: The function to set a simple stem. */
|
||||
/* */
|
||||
/* stem3 :: The function to set counter-controlled stems. */
|
||||
/* */
|
||||
/* reset :: The function to reset stem hints. */
|
||||
/* */
|
||||
/* apply :: The function to apply the hints to the corresponding */
|
||||
/* glyph outline. */
|
||||
/* */
|
||||
typedef struct T1_Hints_FuncsRec_
|
||||
{
|
||||
T1_Hints hints;
|
||||
T1_Hints_OpenFunc open;
|
||||
T1_Hints_CloseFunc close;
|
||||
T1_Hints_SetStemFunc stem;
|
||||
T1_Hints_SetStem3Func stem3;
|
||||
T1_Hints_ResetFunc reset;
|
||||
T1_Hints_ApplyFunc apply;
|
||||
|
||||
} T1_Hints_FuncsRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PUBLIC TYPE 2 HINTS RECORDER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T2_Hints */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This is a handle to an opaque structure used to record glyph hints */
|
||||
/* from a Type 2 character glyph character string. */
|
||||
/* */
|
||||
/* The methods used to operate on this object are defined by the */
|
||||
/* @T2_Hints_FuncsRec structure. Recording glyph hints is normally */
|
||||
/* achieved through the following scheme: */
|
||||
/* */
|
||||
/* - Open a new hint recording session by calling the "open" method. */
|
||||
/* This will rewind the recorder and prepare it for new input. */
|
||||
/* */
|
||||
/* - For each hint found in the glyph charstring, call the */
|
||||
/* corresponding method ("stems", "hintmask", "counters"). Note */
|
||||
/* that these functions do not return an error code. */
|
||||
/* */
|
||||
/* - Close the recording session by calling the "close" method. It */
|
||||
/* will return an error code if the hints were invalid or something */
|
||||
/* strange happened (e.g. memory shortage). */
|
||||
/* */
|
||||
/* The hints accumulated in the object can later be used by the */
|
||||
/* Postscript hinter. */
|
||||
/* */
|
||||
typedef struct T2_HintsRec_* T2_Hints;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T2_Hints_Funcs */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A pointer to the @T2_Hints_FuncsRec structure that defines the API */
|
||||
/* of a given @T2_Hints object. */
|
||||
/* */
|
||||
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_OpenFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to prepare it for a new */
|
||||
/* Type 2 hints recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* You should always call the @T2_Hints_CloseFunc method in order to */
|
||||
/* close an opened recording session. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_OpenFunc)( T2_Hints hints );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_StemsFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set the table of stems in */
|
||||
/* either the vertical or horizontal dimension. Equivalent to the */
|
||||
/* "hstem", "vstem", "hstemhm", and "vstemhm" Type 2 operators. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */
|
||||
/* (vstem). */
|
||||
/* */
|
||||
/* count :: The number of stems. */
|
||||
/* */
|
||||
/* coords :: An array of "count" (position,length) pairs. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* There are "2*count" elements in the "coords" aray. Each even */
|
||||
/* element is an absolute position in font units, each odd element is */
|
||||
/* a length in font units. */
|
||||
/* */
|
||||
/* A length can be negative, in which case it must be either -20 or */
|
||||
/* -21. It will be interpreted as a "ghost" stem, according to the */
|
||||
/* Type 1 specification. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_StemsFunc)( T2_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_UInt count,
|
||||
FT_Fixed* coordinates );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_MaskFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set a given hintmask */
|
||||
/* (this corresponds to the "hintmask" Type 2 operator). */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The glyph index of the last point to which the */
|
||||
/* previously defined/activated hints apply. */
|
||||
/* */
|
||||
/* bit_count :: The number of bits in the hint mask. */
|
||||
/* */
|
||||
/* bytes :: An array of bytes modelling the hint mask. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If the hintmask starts the charstring (before any glyph point */
|
||||
/* definition), the value of "end_point" should be 0. */
|
||||
/* */
|
||||
/* "bit_count" is the number of meaningful bits in the "bytes" array; */
|
||||
/* it must be equal to the total number of hints defined so far */
|
||||
/* (i.e. horizontal+verticals). */
|
||||
/* */
|
||||
/* The "bytes" array can come directly from the Type 2 charstring and */
|
||||
/* respects the same format. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_MaskFunc)( T2_Hints hints,
|
||||
FT_UInt end_point,
|
||||
FT_UInt bit_count,
|
||||
const FT_Byte* bytes );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_CounterFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set a given counter mask */
|
||||
/* (this corresponds to the "hintmask" Type 2 operator). */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: A glyph index of the last point to which the */
|
||||
/* previously defined/active hints apply. */
|
||||
/* */
|
||||
/* bit_count :: The number of bits in the hint mask. */
|
||||
/* */
|
||||
/* bytes :: An array of bytes modelling the hint mask. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If the hintmask starts the charstring (before any glyph point */
|
||||
/* definition), the value of "end_point" should be 0. */
|
||||
/* */
|
||||
/* "bit_count" is the number of meaningful bits in the "bytes" array; */
|
||||
/* it must be equal to the total number of hints defined so far */
|
||||
/* (i.e. horizontal+verticals). */
|
||||
/* */
|
||||
/* The "bytes" array can come directly from the Type 2 charstring and */
|
||||
/* respects the same format. */
|
||||
/* */
|
||||
typedef void
|
||||
(*T2_Hints_CounterFunc)( T2_Hints hints,
|
||||
FT_UInt bit_count,
|
||||
const FT_Byte* bytes );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to close a hint recording */
|
||||
/* session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The index of the last point in the input glyph. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* The error code will be set to indicate that an error occured */
|
||||
/* during the recording session. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T2_Hints_CloseFunc)( T2_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_ApplyFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to apply hints to the */
|
||||
/* corresponding glyph outline. Must be called after the "close" */
|
||||
/* method. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* globals :: The hinter globals for this font. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* On input, all points within the outline are in font coordinates. */
|
||||
/* On output, they are in 1/64th of pixels. */
|
||||
/* */
|
||||
/* The scaling transformation is taken from the "globals" object */
|
||||
/* which must correspond to the same font than the glyph. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*T2_Hints_ApplyFunc)( T2_Hints hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* T2_Hints_FuncsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The structure used to provide the API to @T2_Hints objects. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* hints :: A handle to the T2 hints recorder object. */
|
||||
/* */
|
||||
/* open :: The function to open a recording session. */
|
||||
/* */
|
||||
/* close :: The function to close a recording session. */
|
||||
/* */
|
||||
/* stems :: The function to set the dimension's stems table. */
|
||||
/* */
|
||||
/* hintmask :: The function to set hint masks. */
|
||||
/* */
|
||||
/* counter :: The function to set counter masks. */
|
||||
/* */
|
||||
/* apply :: The function to apply the hints on the corresponding */
|
||||
/* glyph outline. */
|
||||
/* */
|
||||
typedef struct T2_Hints_FuncsRec_
|
||||
{
|
||||
T2_Hints hints;
|
||||
T2_Hints_OpenFunc open;
|
||||
T2_Hints_CloseFunc close;
|
||||
T2_Hints_StemsFunc stems;
|
||||
T2_Hints_MaskFunc hintmask;
|
||||
T2_Hints_CounterFunc counter;
|
||||
T2_Hints_ApplyFunc apply;
|
||||
|
||||
} T2_Hints_FuncsRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
typedef struct PSHinter_Interface_
|
||||
{
|
||||
PSH_Globals_Funcs (*get_globals_funcs)( FT_Module module );
|
||||
T1_Hints_Funcs (*get_t1_funcs) ( FT_Module module );
|
||||
T2_Hints_Funcs (*get_t2_funcs) ( FT_Module module );
|
||||
|
||||
} PSHinter_Interface, *PSHinter_InterfacePtr;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PSHINTS_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,237 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* psnames.h */
|
||||
/* */
|
||||
/* High-level interface for the `PSNames' module (in charge of */
|
||||
/* various functions related to Postscript glyph names conversion). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __PSNAMES_H__
|
||||
#define __PSNAMES_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* PS_Unicode_Value_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to return the Unicode index corresponding to a */
|
||||
/* given glyph name. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* glyph_name :: The glyph name. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The Unicode character index resp. the non-Unicode value 0xFFFF if */
|
||||
/* the glyph name has no known Unicode meaning. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is able to map several different glyph names to the */
|
||||
/* same Unicode value, according to the rules defined in the Adobe */
|
||||
/* Glyph List table. */
|
||||
/* */
|
||||
/* This function will not be compiled if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
|
||||
/* */
|
||||
typedef FT_ULong
|
||||
(*PS_Unicode_Value_Func)( const char* glyph_name );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* PS_Unicode_Index_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to return the glyph index corresponding to a given */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* num_glyphs :: The number of glyphs in the face. */
|
||||
/* */
|
||||
/* glyph_names :: An array of glyph name pointers. */
|
||||
/* */
|
||||
/* unicode :: The Unicode value. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The glyph index resp. 0xFFFF if no glyph corresponds to this */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is able to recognize several glyph names per Unicode */
|
||||
/* value, according to the Adobe Glyph List. */
|
||||
/* */
|
||||
/* This function will not be compiled if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
|
||||
/* */
|
||||
typedef FT_UInt
|
||||
(*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
FT_ULong unicode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* PS_Macintosh_Name_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to return the glyph name corresponding to an Apple */
|
||||
/* glyph name index. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* name_index :: The index of the Mac name. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The glyph name, or 0 if the index is invalid. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function will not be compiled if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
|
||||
/* */
|
||||
typedef const char*
|
||||
(*PS_Macintosh_Name_Func)( FT_UInt name_index );
|
||||
|
||||
|
||||
typedef const char*
|
||||
(*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
|
||||
|
||||
|
||||
typedef struct PS_UniMap_
|
||||
{
|
||||
FT_UInt unicode;
|
||||
FT_UInt glyph_index;
|
||||
|
||||
} PS_UniMap;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* PS_Unicodes */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple table used to map Unicode values to glyph indices. It is */
|
||||
/* built by the PS_Build_Unicodes table according to the glyphs */
|
||||
/* present in a font file. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* num_codes :: The number of glyphs in the font that match a given */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* unicodes :: An array of unicode values, sorted in increasing */
|
||||
/* order. */
|
||||
/* */
|
||||
/* gindex :: An array of glyph indices, corresponding to each */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Use the function PS_Lookup_Unicode() to retrieve the glyph index */
|
||||
/* corresponding to a given Unicode character code. */
|
||||
/* */
|
||||
typedef struct PS_Unicodes_
|
||||
{
|
||||
FT_UInt num_maps;
|
||||
PS_UniMap* maps;
|
||||
|
||||
} PS_Unicodes;
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*PS_Build_Unicodes_Func)( FT_Memory memory,
|
||||
FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
PS_Unicodes* unicodes );
|
||||
|
||||
typedef FT_UInt
|
||||
(*PS_Lookup_Unicode_Func)( PS_Unicodes* unicodes,
|
||||
FT_UInt unicode );
|
||||
|
||||
typedef FT_ULong
|
||||
(*PS_Next_Unicode_Func)( PS_Unicodes* unicodes,
|
||||
FT_ULong unicode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* PSNames_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This structure defines the PSNames interface. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* unicode_value :: A function used to convert a glyph name */
|
||||
/* into a Unicode character code. */
|
||||
/* */
|
||||
/* build_unicodes :: A function which builds up the Unicode */
|
||||
/* mapping table. */
|
||||
/* */
|
||||
/* lookup_unicode :: A function used to return the glyph index */
|
||||
/* corresponding to a given Unicode */
|
||||
/* character. */
|
||||
/* */
|
||||
/* macintosh_name :: A function used to return the standard */
|
||||
/* Apple glyph Postscript name corresponding */
|
||||
/* to a given string index (used by the */
|
||||
/* TrueType `post' table). */
|
||||
/* */
|
||||
/* adobe_std_strings :: A function that returns a pointer to a */
|
||||
/* Adobe Standard String for a given SID. */
|
||||
/* */
|
||||
/* adobe_std_encoding :: A table of 256 unsigned shorts that maps */
|
||||
/* character codes in the Adobe Standard */
|
||||
/* Encoding to SIDs. */
|
||||
/* */
|
||||
/* adobe_expert_encoding :: A table of 256 unsigned shorts that maps */
|
||||
/* character codes in the Adobe Expert */
|
||||
/* Encoding to SIDs. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* `unicode_value' and `unicode_index' will be set to 0 if the */
|
||||
/* configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is */
|
||||
/* undefined. */
|
||||
/* */
|
||||
/* `macintosh_name' will be set to 0 if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
|
||||
/* */
|
||||
typedef struct PSNames_Interface_
|
||||
{
|
||||
PS_Unicode_Value_Func unicode_value;
|
||||
PS_Build_Unicodes_Func build_unicodes;
|
||||
PS_Lookup_Unicode_Func lookup_unicode;
|
||||
PS_Macintosh_Name_Func macintosh_name;
|
||||
|
||||
PS_Adobe_Std_Strings_Func adobe_std_strings;
|
||||
const unsigned short* adobe_std_encoding;
|
||||
const unsigned short* adobe_expert_encoding;
|
||||
|
||||
PS_Next_Unicode_Func next_unicode;
|
||||
} PSNames_Interface;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __PSNAMES_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,530 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* sfnt.h */
|
||||
/* */
|
||||
/* High-level `sfnt' driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __SFNT_H__
|
||||
#define __SFNT_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_DRIVER_H
|
||||
#include FT_INTERNAL_TRUETYPE_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Init_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* First part of the SFNT face object initialization. This will find */
|
||||
/* the face in a SFNT file or collection, and load its format tag in */
|
||||
/* face->format_tag. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* */
|
||||
/* num_params :: The number of additional parameters. */
|
||||
/* */
|
||||
/* params :: Optional additional parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be at the font file's origin. */
|
||||
/* */
|
||||
/* This function recognizes fonts embedded in a `TrueType */
|
||||
/* collection'. */
|
||||
/* */
|
||||
/* Once the format tag has been validated by the font driver, it */
|
||||
/* should then call the TT_Load_Face_Func() callback to read the rest */
|
||||
/* of the SFNT tables in the object. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Init_Face_Func)( FT_Stream stream,
|
||||
TT_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Second part of the SFNT face object initialization. This will */
|
||||
/* load the common SFNT tables (head, OS/2, maxp, metrics, etc.) in */
|
||||
/* the face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* */
|
||||
/* num_params :: The number of additional parameters. */
|
||||
/* */
|
||||
/* params :: Optional additional parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function must be called after TT_Init_Face_Func(). */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Face_Func)( FT_Stream stream,
|
||||
TT_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Done_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A callback used to delete the common SFNT data from a face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function does NOT destroy the face object. */
|
||||
/* */
|
||||
typedef void
|
||||
(*TT_Done_Face_Func)( TT_Face face );
|
||||
|
||||
|
||||
typedef FT_Module_Interface
|
||||
(*SFNT_Get_Interface_Func)( FT_Module module,
|
||||
const char* interface );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_SFNT_Header_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the header of a SFNT font file. Supports collections. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be at the font file's origin. */
|
||||
/* */
|
||||
/* This function recognizes fonts embedded in a `TrueType */
|
||||
/* collection'. */
|
||||
/* */
|
||||
/* This function checks that the header is valid by looking at the */
|
||||
/* values of `search_range', `entry_selector', and `range_shift'. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_SFNT_Header_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Long face_index,
|
||||
SFNT_Header* sfnt );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Directory_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the table directory into a face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be on the first byte after the 4-byte font */
|
||||
/* format tag. This is the case just after a call to */
|
||||
/* TT_Load_Format_Tag(). */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Directory_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
SFNT_Header* sfnt );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Any_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads any font table into client memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The face object to look for. */
|
||||
/* */
|
||||
/* tag :: The tag of table to load. Use the value 0 if you want */
|
||||
/* to access the whole font file, else set this parameter */
|
||||
/* to a valid TrueType table tag that you can forge with */
|
||||
/* the MAKE_TT_TAG macro. */
|
||||
/* */
|
||||
/* offset :: The starting offset in the table (or the file if */
|
||||
/* tag == 0). */
|
||||
/* */
|
||||
/* length :: The address of the decision variable: */
|
||||
/* */
|
||||
/* If length == NULL: */
|
||||
/* Loads the whole table. Returns an error if */
|
||||
/* `offset' == 0! */
|
||||
/* */
|
||||
/* If *length == 0: */
|
||||
/* Exits immediately; returning the length of the given */
|
||||
/* table or of the font file, depending on the value of */
|
||||
/* `tag'. */
|
||||
/* */
|
||||
/* If *length != 0: */
|
||||
/* Loads the next `length' bytes of table or font, */
|
||||
/* starting at offset `offset' (in table or font too). */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* buffer :: The address of target buffer. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* TrueType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Any_Func)( TT_Face face,
|
||||
FT_ULong tag,
|
||||
FT_Long offset,
|
||||
FT_Byte *buffer,
|
||||
FT_ULong* length );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_SBit_Image_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given glyph sbit image from the font resource. This also */
|
||||
/* returns its metrics. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* x_ppem :: The horizontal resolution in points per EM. */
|
||||
/* */
|
||||
/* y_ppem :: The vertical resolution in points per EM. */
|
||||
/* */
|
||||
/* glyph_index :: The current glyph index. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* amap :: The target pixmap. */
|
||||
/* */
|
||||
/* ametrics :: A big sbit metrics structure for the glyph image. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. Returns an error if no */
|
||||
/* glyph sbit exists for the index. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The `map.buffer' field is always freed before the glyph is loaded. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_SBit_Image_Func)( TT_Face face,
|
||||
FT_ULong strike_index,
|
||||
FT_UInt glyph_index,
|
||||
FT_UInt load_flags,
|
||||
FT_Stream stream,
|
||||
FT_Bitmap *amap,
|
||||
TT_SBit_Metrics *ametrics );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Set_SBit_Strike_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Selects an sbit strike for given horizontal and vertical ppem */
|
||||
/* values. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* x_ppem :: The horizontal resolution in points per EM. */
|
||||
/* */
|
||||
/* y_ppem :: The vertical resolution in points per EM. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* astrike_index :: The index of the sbit strike. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. Returns an error if no */
|
||||
/* sbit strike exists for the selected ppem values. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Set_SBit_Strike_Func)( TT_Face face,
|
||||
FT_Int x_ppem,
|
||||
FT_Int y_ppem,
|
||||
FT_ULong *astrike_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Get_PS_Name_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Gets the PostScript glyph name of a glyph. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* index :: The glyph index. */
|
||||
/* */
|
||||
/* PSname :: The address of a string pointer. Will be NULL in case */
|
||||
/* of error, otherwise it is a pointer to the glyph name. */
|
||||
/* */
|
||||
/* You must not modify the returned string! */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Get_PS_Name_Func)( TT_Face face,
|
||||
FT_UInt index,
|
||||
FT_String** PSname );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the horizontal or vertical header in a face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Metrics_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Bool vertical );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_CharMap_Load_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given TrueType character map into memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the current stream object. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* cmap :: A pointer to a cmap object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The function assumes that the stream is already in use (i.e., */
|
||||
/* opened). In case of error, all partially allocated tables are */
|
||||
/* released. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_CharMap_Load_Func)( TT_Face face,
|
||||
TT_CMapTable* cmap,
|
||||
FT_Stream input );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_CharMap_Free_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys a character mapping table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* cmap :: A handle to a cmap object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_CharMap_Free_Func)( TT_Face face,
|
||||
TT_CMapTable* cmap );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The function will use `face->goto_table' to seek the stream to */
|
||||
/* the start of the table. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Table_Func)( TT_Face face,
|
||||
FT_Stream stream );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Free_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Frees a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
typedef void
|
||||
(*TT_Free_Table_Func)( TT_Face face );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* SFNT_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This structure holds pointers to the functions used to load and */
|
||||
/* free the basic tables that are required in a `sfnt' font file. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* Check the various xxx_Func() descriptions for details. */
|
||||
/* */
|
||||
typedef struct SFNT_Interface_
|
||||
{
|
||||
TT_Goto_Table_Func goto_table;
|
||||
|
||||
TT_Init_Face_Func init_face;
|
||||
TT_Load_Face_Func load_face;
|
||||
TT_Done_Face_Func done_face;
|
||||
SFNT_Get_Interface_Func get_interface;
|
||||
|
||||
TT_Load_Any_Func load_any;
|
||||
TT_Load_SFNT_Header_Func load_sfnt_header;
|
||||
TT_Load_Directory_Func load_directory;
|
||||
|
||||
/* these functions are called by `load_face' but they can also */
|
||||
/* be called from external modules, if there is a need to do so */
|
||||
TT_Load_Table_Func load_header;
|
||||
TT_Load_Metrics_Func load_metrics;
|
||||
TT_Load_Table_Func load_charmaps;
|
||||
TT_Load_Table_Func load_max_profile;
|
||||
TT_Load_Table_Func load_os2;
|
||||
TT_Load_Table_Func load_psnames;
|
||||
|
||||
TT_Load_Table_Func load_names;
|
||||
TT_Free_Table_Func free_names;
|
||||
|
||||
/* optional tables */
|
||||
TT_Load_Table_Func load_hdmx;
|
||||
TT_Free_Table_Func free_hdmx;
|
||||
|
||||
TT_Load_Table_Func load_kerning;
|
||||
TT_Load_Table_Func load_gasp;
|
||||
TT_Load_Table_Func load_pclt;
|
||||
|
||||
/* see `ttload.h' */
|
||||
TT_Load_Table_Func load_bitmap_header;
|
||||
|
||||
/* see `ttsbit.h' */
|
||||
TT_Set_SBit_Strike_Func set_sbit_strike;
|
||||
TT_Load_Table_Func load_sbits;
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
TT_Free_Table_Func free_sbits;
|
||||
|
||||
/* see `ttpost.h' */
|
||||
TT_Get_PS_Name_Func get_psname;
|
||||
TT_Free_Table_Func free_psnames;
|
||||
|
||||
/* see `ttcmap.h' */
|
||||
TT_CharMap_Load_Func load_charmap;
|
||||
TT_CharMap_Free_Func free_charmap;
|
||||
|
||||
} SFNT_Interface;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __SFNT_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,203 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* t1types.h */
|
||||
/* */
|
||||
/* Basic Type1/Type2 type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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 __T1TYPES_H__
|
||||
#define __T1TYPES_H__
|
||||
|
||||
|
||||
#include<ft2build.h>
|
||||
#include FT_TYPE1_TABLES_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_NAMES_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* T1_Encoding */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure modeling a custom encoding. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* num_chars :: The number of character codes in the encoding. */
|
||||
/* Usually 256. */
|
||||
/* */
|
||||
/* code_first :: The lowest valid character code in the encoding. */
|
||||
/* */
|
||||
/* code_last :: The highest valid character code in the encoding. */
|
||||
/* */
|
||||
/* char_index :: An array of corresponding glyph indices. */
|
||||
/* */
|
||||
/* char_name :: An array of corresponding glyph names. */
|
||||
/* */
|
||||
typedef struct T1_Encoding_
|
||||
{
|
||||
FT_Int num_chars;
|
||||
FT_Int code_first;
|
||||
FT_Int code_last;
|
||||
|
||||
FT_UShort* char_index;
|
||||
FT_String** char_name;
|
||||
|
||||
} T1_Encoding;
|
||||
|
||||
|
||||
typedef enum T1_EncodingType_
|
||||
{
|
||||
t1_encoding_none = 0,
|
||||
t1_encoding_array,
|
||||
t1_encoding_standard,
|
||||
t1_encoding_expert
|
||||
|
||||
} T1_EncodingType;
|
||||
|
||||
|
||||
typedef struct T1_Font_
|
||||
{
|
||||
/* font info dictionary */
|
||||
T1_FontInfo font_info;
|
||||
|
||||
/* private dictionary */
|
||||
T1_Private private_dict;
|
||||
|
||||
/* top-level dictionary */
|
||||
FT_String* font_name;
|
||||
|
||||
T1_EncodingType encoding_type;
|
||||
T1_Encoding encoding;
|
||||
|
||||
FT_Byte* subrs_block;
|
||||
FT_Byte* charstrings_block;
|
||||
FT_Byte* glyph_names_block;
|
||||
|
||||
FT_Int num_subrs;
|
||||
FT_Byte** subrs;
|
||||
FT_Int* subrs_len;
|
||||
|
||||
FT_Int num_glyphs;
|
||||
FT_String** glyph_names; /* array of glyph names */
|
||||
FT_Byte** charstrings; /* array of glyph charstrings */
|
||||
FT_Int* charstrings_len;
|
||||
|
||||
FT_Byte paint_type;
|
||||
FT_Byte font_type;
|
||||
FT_Matrix font_matrix;
|
||||
FT_Vector font_offset;
|
||||
FT_BBox font_bbox;
|
||||
FT_Long font_id;
|
||||
|
||||
FT_Int stroke_width;
|
||||
|
||||
} T1_Font;
|
||||
|
||||
|
||||
typedef struct CID_Subrs_
|
||||
{
|
||||
FT_UInt num_subrs;
|
||||
FT_Byte** code;
|
||||
|
||||
} CID_Subrs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** ORIGINAL T1_FACE CLASS DEFINITION ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This structure/class is defined here because it is common to the */
|
||||
/* following formats: TTF, OpenType-TT, and OpenType-CFF. */
|
||||
/* */
|
||||
/* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
|
||||
/* are not shared between font drivers, and are thus defined normally in */
|
||||
/* `ttobjs.h'. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct T1_FaceRec_* T1_Face;
|
||||
typedef struct CID_FaceRec_* CID_Face;
|
||||
|
||||
|
||||
typedef struct T1_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
T1_Font type1;
|
||||
void* psnames;
|
||||
void* psaux;
|
||||
void* afm_data;
|
||||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
PS_Unicodes unicode_map;
|
||||
|
||||
/* support for Multiple Masters fonts */
|
||||
T1_Blend* blend;
|
||||
|
||||
/* since FT 2.1 - interface to PostScript hinter */
|
||||
void* pshinter;
|
||||
|
||||
} T1_FaceRec;
|
||||
|
||||
|
||||
typedef struct CID_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
void* psnames;
|
||||
void* psaux;
|
||||
CID_Info cid;
|
||||
void* afm_data;
|
||||
CID_Subrs* subrs;
|
||||
|
||||
/* since FT 2.1 - interface to PostScript hinter */
|
||||
void* pshinter;
|
||||
|
||||
} CID_FaceRec;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __T1TYPES_H__ */
|
||||
|
||||
|
||||
/* END */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,263 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* t1tables.h */
|
||||
/* */
|
||||
/* Basic Type 1/Type 2 tables definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 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
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* type1_tables */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Type 1 Tables */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* Type 1 (PostScript) specific font tables. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains the definition of Type 1-specific tables, */
|
||||
/* including structures related to other PostScript font formats. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* Note that we separate font data in T1_FontInfo and T1_Private */
|
||||
/* structures in order to support Multiple Master fonts. */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* T1_FontInfo */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
|
||||
/* that for Multiple Master fonts, each instance has its own */
|
||||
/* FontInfo. */
|
||||
/* */
|
||||
typedef struct T1_FontInfo
|
||||
{
|
||||
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;
|
||||
|
||||
} T1_FontInfo;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* T1_Private */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
|
||||
/* that for Multiple Master fonts, each instance has its own Private */
|
||||
/* dict. */
|
||||
/* */
|
||||
typedef struct T1_Private
|
||||
{
|
||||
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_Long language_group;
|
||||
FT_Long password;
|
||||
|
||||
FT_Short min_feature[2];
|
||||
|
||||
} T1_Private;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* T1_Blend_Flags */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A set of flags used to indicate which fields are present in a */
|
||||
/* given blen dictionary (font info or private). Used to support */
|
||||
/* Multiple Masters fonts. */
|
||||
/* */
|
||||
typedef enum
|
||||
{
|
||||
/*# 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,
|
||||
|
||||
/*# never remove */
|
||||
t1_blend_max
|
||||
|
||||
} T1_Blend_Flags;
|
||||
|
||||
|
||||
/* 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 T1_DesignMap_
|
||||
{
|
||||
FT_Byte num_points;
|
||||
FT_Fixed* design_points;
|
||||
FT_Fixed* blend_points;
|
||||
|
||||
} T1_DesignMap;
|
||||
|
||||
|
||||
typedef struct T1_Blend_
|
||||
{
|
||||
FT_UInt num_designs;
|
||||
FT_UInt num_axis;
|
||||
|
||||
FT_String* axis_names[T1_MAX_MM_AXIS];
|
||||
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
|
||||
T1_DesignMap design_map[T1_MAX_MM_AXIS];
|
||||
|
||||
FT_Fixed* weight_vector;
|
||||
FT_Fixed* default_weight_vector;
|
||||
|
||||
T1_FontInfo* font_infos[T1_MAX_MM_DESIGNS + 1];
|
||||
T1_Private* privates [T1_MAX_MM_DESIGNS + 1];
|
||||
|
||||
FT_ULong blend_bitflags;
|
||||
|
||||
} T1_Blend;
|
||||
|
||||
|
||||
typedef struct CID_FontDict_
|
||||
{
|
||||
T1_Private private_dict;
|
||||
|
||||
FT_UInt len_buildchar;
|
||||
FT_Fixed forcebold_threshold;
|
||||
FT_Pos stroke_width;
|
||||
FT_Fixed 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_FontDict;
|
||||
|
||||
|
||||
typedef struct CID_Info_
|
||||
{
|
||||
FT_String* cid_font_name;
|
||||
FT_Fixed cid_version;
|
||||
FT_Int cid_font_type;
|
||||
|
||||
FT_String* registry;
|
||||
FT_String* ordering;
|
||||
FT_Int supplement;
|
||||
|
||||
T1_FontInfo 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_FontDict* font_dicts;
|
||||
|
||||
FT_ULong data_offset;
|
||||
|
||||
} CID_Info;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __T1TABLES_H__ */
|
||||
|
||||
|
||||
/* END */
|
Загрузка…
Ссылка в новой задаче