updated freetype to 2.2.1, tested ok, please forgive me for possible left issues :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17933 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
-319
@@ -1,319 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftccache.h */
|
||||
/* */
|
||||
/* FreeType internal cache interface (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003, 2004, 2005 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 __FTCCACHE_H__
|
||||
#define __FTCCACHE_H__
|
||||
|
||||
|
||||
#include FT_CACHE_INTERNAL_MRU_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/* handle to cache object */
|
||||
typedef struct FTC_CacheRec_* FTC_Cache;
|
||||
|
||||
/* handle to cache class */
|
||||
typedef const struct FTC_CacheClassRec_* FTC_CacheClass;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** CACHE NODE DEFINITIONS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each cache controls one or more cache nodes. Each node is part of */
|
||||
/* the global_lru list of the manager. Its `data' field however is used */
|
||||
/* as a reference count for now. */
|
||||
/* */
|
||||
/* A node can be anything, depending on the type of information held by */
|
||||
/* the cache. It can be an individual glyph image, a set of bitmaps */
|
||||
/* glyphs for a given size, some metrics, etc. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/* structure size should be 20 bytes on 32-bits machines */
|
||||
typedef struct FTC_NodeRec_
|
||||
{
|
||||
FTC_MruNodeRec mru; /* circular mru list pointer */
|
||||
FTC_Node link; /* used for hashing */
|
||||
FT_UInt32 hash; /* used for hashing too */
|
||||
FT_UShort cache_index; /* index of cache the node belongs to */
|
||||
FT_Short ref_count; /* reference count for this node */
|
||||
|
||||
} FTC_NodeRec;
|
||||
|
||||
|
||||
#define FTC_NODE( x ) ( (FTC_Node)(x) )
|
||||
#define FTC_NODE_P( x ) ( (FTC_Node*)(x) )
|
||||
|
||||
#define FTC_NODE__NEXT(x) FTC_NODE( (x)->mru.next )
|
||||
#define FTC_NODE__PREV(x) FTC_NODE( (x)->mru.prev )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
|
||||
/* reserved for manager's use */
|
||||
FT_EXPORT( void )
|
||||
ftc_node_destroy( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** CACHE DEFINITIONS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* initialize a new cache node */
|
||||
typedef FT_Error
|
||||
(*FTC_Node_NewFunc)( FTC_Node *pnode,
|
||||
FT_Pointer query,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef FT_ULong
|
||||
(*FTC_Node_WeightFunc)( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* compare a node to a given key pair */
|
||||
typedef FT_Bool
|
||||
(*FTC_Node_CompareFunc)( FTC_Node node,
|
||||
FT_Pointer key,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
typedef void
|
||||
(*FTC_Node_FreeFunc)( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_Cache_InitFunc)( FTC_Cache cache );
|
||||
|
||||
typedef void
|
||||
(*FTC_Cache_DoneFunc)( FTC_Cache cache );
|
||||
|
||||
|
||||
typedef struct FTC_CacheClassRec_
|
||||
{
|
||||
FTC_Node_NewFunc node_new;
|
||||
FTC_Node_WeightFunc node_weight;
|
||||
FTC_Node_CompareFunc node_compare;
|
||||
FTC_Node_CompareFunc node_remove_faceid;
|
||||
FTC_Node_FreeFunc node_free;
|
||||
|
||||
FT_UInt cache_size;
|
||||
FTC_Cache_InitFunc cache_init;
|
||||
FTC_Cache_DoneFunc cache_done;
|
||||
|
||||
} FTC_CacheClassRec;
|
||||
|
||||
|
||||
/* each cache really implements a dynamic hash table to manage its nodes */
|
||||
typedef struct FTC_CacheRec_
|
||||
{
|
||||
FT_UFast p;
|
||||
FT_UFast mask;
|
||||
FT_Long slack;
|
||||
FTC_Node* buckets;
|
||||
|
||||
FTC_CacheClassRec clazz; /* local copy, for speed */
|
||||
|
||||
FTC_Manager manager;
|
||||
FT_Memory memory;
|
||||
FT_UInt index; /* in manager's table */
|
||||
|
||||
FTC_CacheClass org_class; /* original class pointer */
|
||||
|
||||
} FTC_CacheRec;
|
||||
|
||||
|
||||
#define FTC_CACHE( x ) ( (FTC_Cache)(x) )
|
||||
#define FTC_CACHE_P( x ) ( (FTC_Cache*)(x) )
|
||||
|
||||
|
||||
/* default cache initialize */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Cache_Init( FTC_Cache cache );
|
||||
|
||||
/* default cache finalizer */
|
||||
FT_EXPORT( void )
|
||||
FTC_Cache_Done( FTC_Cache cache );
|
||||
|
||||
/* Call this function to lookup the cache. If no corresponding
|
||||
* node is found, a new one is automatically created. This function
|
||||
* is capable of flushing the cache adequately to make room for the
|
||||
* new cache object.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Cache_Lookup( FTC_Cache cache,
|
||||
FT_UInt32 hash,
|
||||
FT_Pointer query,
|
||||
FTC_Node *anode );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Cache_NewNode( FTC_Cache cache,
|
||||
FT_UInt32 hash,
|
||||
FT_Pointer query,
|
||||
FTC_Node *anode );
|
||||
|
||||
/* Remove all nodes that relate to a given face_id. This is useful
|
||||
* when un-installing fonts. Note that if a cache node relates to
|
||||
* the face_id, but is locked (i.e., has 'ref_count > 0'), the node
|
||||
* will _not_ be destroyed, but its internal face_id reference will
|
||||
* be modified.
|
||||
*
|
||||
* The final result will be that the node will never come back
|
||||
* in further lookup requests, and will be flushed on demand from
|
||||
* the cache normally when its reference count reaches 0.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FTC_Cache_RemoveFaceID( FTC_Cache cache,
|
||||
FTC_FaceID face_id );
|
||||
|
||||
|
||||
#ifdef FTC_INLINE
|
||||
|
||||
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_Node *_bucket, *_pnode, _node; \
|
||||
FTC_Cache _cache = FTC_CACHE(cache); \
|
||||
FT_UInt32 _hash = (FT_UInt32)(hash); \
|
||||
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
|
||||
FT_UInt _idx; \
|
||||
\
|
||||
\
|
||||
error = 0; \
|
||||
node = NULL; \
|
||||
_idx = _hash & _cache->mask; \
|
||||
if ( _idx < _cache->p ) \
|
||||
_idx = _hash & ( _cache->mask*2 + 1 ); \
|
||||
\
|
||||
_bucket = _pnode = _cache->buckets + _idx; \
|
||||
for (;;) \
|
||||
{ \
|
||||
_node = *_pnode; \
|
||||
if ( _node == NULL ) \
|
||||
goto _NewNode; \
|
||||
\
|
||||
if ( _node->hash == _hash && _nodcomp( _node, query, _cache ) ) \
|
||||
break; \
|
||||
\
|
||||
_pnode = &_node->link; \
|
||||
} \
|
||||
\
|
||||
if ( _node != *_bucket ) \
|
||||
{ \
|
||||
*_pnode = _node->link; \
|
||||
_node->link = *_bucket; \
|
||||
*_bucket = _node; \
|
||||
} \
|
||||
\
|
||||
{ \
|
||||
FTC_Manager _manager = _cache->manager; \
|
||||
\
|
||||
\
|
||||
if ( _node != _manager->nodes_list ) \
|
||||
FTC_MruNode_Up( (FTC_MruNode*)&_manager->nodes_list, \
|
||||
(FTC_MruNode)_node ); \
|
||||
} \
|
||||
goto _Ok; \
|
||||
\
|
||||
_NewNode: \
|
||||
error = FTC_Cache_NewNode( _cache, _hash, query, &_node ); \
|
||||
\
|
||||
_Ok: \
|
||||
_pnode = (FTC_Node*)(void*)&(node); \
|
||||
*_pnode = _node; \
|
||||
FT_END_STMNT
|
||||
|
||||
#else /* !FTC_INLINE */
|
||||
|
||||
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, \
|
||||
(FTC_Node*)&(node) ); \
|
||||
FT_END_STMNT
|
||||
|
||||
#endif /* !FTC_INLINE */
|
||||
|
||||
|
||||
/*
|
||||
* This macro, together with FTC_CACHE_TRYLOOP_END, defines a retry
|
||||
* loop to flush the cache repeatedly in case of memory overflows.
|
||||
*
|
||||
* It is used when creating a new cache node, or within a lookup
|
||||
* that needs to allocate data (e.g., the sbit cache lookup).
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* {
|
||||
* FTC_CACHE_TRYLOOP( cache )
|
||||
* error = load_data( ... );
|
||||
* FTC_CACHE_TRYLOOP_END()
|
||||
* }
|
||||
*
|
||||
*/
|
||||
#define FTC_CACHE_TRYLOOP( cache ) \
|
||||
{ \
|
||||
FTC_Manager _try_manager = FTC_CACHE( cache )->manager; \
|
||||
FT_UInt _try_count = 4; \
|
||||
\
|
||||
\
|
||||
for (;;) \
|
||||
{ \
|
||||
FT_UInt _try_done;
|
||||
|
||||
|
||||
#define FTC_CACHE_TRYLOOP_END() \
|
||||
if ( !error || error != FT_Err_Out_Of_Memory ) \
|
||||
break; \
|
||||
\
|
||||
_try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
|
||||
if ( _try_done == 0 ) \
|
||||
break; \
|
||||
\
|
||||
if ( _try_done == _try_count ) \
|
||||
{ \
|
||||
_try_count *= 2; \
|
||||
if ( _try_count < _try_done || \
|
||||
_try_count > _try_manager->num_nodes ) \
|
||||
_try_count = _try_manager->num_nodes; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCCACHE_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
-216
@@ -1,216 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftccmap.h */
|
||||
/* */
|
||||
/* FreeType charmap cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCCMAP_H__
|
||||
#define __FTCCMAP_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FTC_CMapCache */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* An opaque handle used to manager a charmap cache. This cache is */
|
||||
/* to hold character codes -> glyph indices mappings. */
|
||||
/* */
|
||||
typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FTC_CMapDesc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to an @FTC_CMapDescRec structure used to describe a given */
|
||||
/* charmap in a charmap cache. */
|
||||
/* */
|
||||
/* Each @FTC_CMapDesc describes which charmap (of which @FTC_FaceID) */
|
||||
/* we want to use in @FTC_CMapCache_Lookup. */
|
||||
/* */
|
||||
typedef struct FTC_CMapDescRec_* FTC_CMapDesc;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @enum: */
|
||||
/* FTC_CMapType */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The list of valid @FTC_CMapDesc types. They indicate how we want */
|
||||
/* to address a charmap within an @FTC_FaceID. */
|
||||
/* */
|
||||
/* @values: */
|
||||
/* FTC_CMAP_BY_INDEX :: */
|
||||
/* Address a charmap by its index in the corresponding @FT_Face. */
|
||||
/* */
|
||||
/* FTC_CMAP_BY_ENCODING :: */
|
||||
/* Use a @FT_Face charmap that corresponds to a given encoding. */
|
||||
/* */
|
||||
/* FTC_CMAP_BY_ID :: */
|
||||
/* Use an @FT_Face charmap that corresponds to a given */
|
||||
/* (platform,encoding) ID. See @FTC_CMapIdRec. */
|
||||
/* */
|
||||
typedef enum FTC_CMapType_
|
||||
{
|
||||
FTC_CMAP_BY_INDEX = 0,
|
||||
FTC_CMAP_BY_ENCODING = 1,
|
||||
FTC_CMAP_BY_ID = 2
|
||||
|
||||
} FTC_CMapType;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FTC_CMapIdRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A short structure to identify a charmap by a (platform,encoding) */
|
||||
/* pair of values. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* platform :: The platform ID. */
|
||||
/* */
|
||||
/* encoding :: The encoding ID. */
|
||||
/* */
|
||||
typedef struct FTC_CMapIdRec_
|
||||
{
|
||||
FT_UInt platform;
|
||||
FT_UInt encoding;
|
||||
|
||||
} FTC_CMapIdRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FTC_CMapDescRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure to describe a given charmap to @FTC_CMapCache. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* face_id :: @FTC_FaceID of the face this charmap belongs to. */
|
||||
/* */
|
||||
/* type :: The type of charmap, see @FTC_CMapType. */
|
||||
/* */
|
||||
/* u.index :: For @FTC_CMAP_BY_INDEX types, this is the charmap */
|
||||
/* index (within a @FT_Face) we want to use. */
|
||||
/* */
|
||||
/* u.encoding :: For @FTC_CMAP_BY_ENCODING types, this is the charmap */
|
||||
/* encoding we want to use. see @FT_Encoding. */
|
||||
/* */
|
||||
/* u.id :: For @FTC_CMAP_BY_ID types, this is the */
|
||||
/* (platform,encoding) pair we want to use. see */
|
||||
/* @FTC_CMapIdRec and @FT_CharMapRec. */
|
||||
/* */
|
||||
typedef struct FTC_CMapDescRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FTC_CMapType type;
|
||||
|
||||
union
|
||||
{
|
||||
FT_UInt index;
|
||||
FT_Encoding encoding;
|
||||
FTC_CMapIdRec id;
|
||||
|
||||
} u;
|
||||
|
||||
} FTC_CMapDescRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_New */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Creates a new charmap cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* acache :: A new cache handle. NULL in case of error. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Like all other caches, this one will be destroyed with the cache */
|
||||
/* manager. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_CMapCache_New( FTC_Manager manager,
|
||||
FTC_CMapCache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Translates a character code into a glyph index, using the charmap */
|
||||
/* cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* cache :: A charmap cache handle. */
|
||||
/* */
|
||||
/* cmap_desc :: A charmap descriptor handle. */
|
||||
/* */
|
||||
/* char_code :: The character code (in the corresponding charmap). */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Glyph index. 0 means "no glyph". */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* This function doesn't return @FTC_Node handles, since there is no */
|
||||
/* real use for them with typical uses of charmaps. */
|
||||
/* */
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_CMapCache_Lookup( FTC_CMapCache cache,
|
||||
FTC_CMapDesc cmap_desc,
|
||||
FT_UInt32 char_code );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCCMAP_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
-313
@@ -1,313 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcglyph.h */
|
||||
/* */
|
||||
/* FreeType abstract glyph cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003, 2004 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* FTC_GCache is an _abstract_ cache object optimized to store glyph
|
||||
* data. It works as follows:
|
||||
*
|
||||
* - It manages FTC_GNode objects. Each one of them can hold one or more
|
||||
* glyph `items'. Item types are not specified in the FTC_GCache but
|
||||
* in classes that extend it.
|
||||
*
|
||||
* - Glyph attributes, like face ID, character size, render mode, etc.,
|
||||
* can be grouped into abstract `glyph families'. This avoids storing
|
||||
* the attributes within the FTC_GCache, since it is likely that many
|
||||
* FTC_GNodes will belong to the same family in typical uses.
|
||||
*
|
||||
* - Each FTC_GNode is thus an FTC_Node with two additional fields:
|
||||
*
|
||||
* * gindex: A glyph index, or the first index in a glyph range.
|
||||
* * family: A pointer to a glyph `family'.
|
||||
*
|
||||
* - Family types are not fully specific in the FTC_Family type, but
|
||||
* by classes that extend it.
|
||||
*
|
||||
* Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
|
||||
* They share an FTC_Family sub-class called FTC_BasicFamily which is
|
||||
* used to store the following data: face ID, pixel/point sizes, load
|
||||
* flags. For more details see the file `src/cache/ftcbasic.c'.
|
||||
*
|
||||
* Client applications can extend FTC_GNode with their own FTC_GNode
|
||||
* and FTC_Family sub-classes to implement more complex caches (e.g.,
|
||||
* handling automatic synthesis, like obliquing & emboldening, colored
|
||||
* glyphs, etc.).
|
||||
*
|
||||
* See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
|
||||
* `ftcsbits.h', which both extend FTC_GCache with additional
|
||||
* optimizations.
|
||||
*
|
||||
* A typical FTC_GCache implementation must provide at least the
|
||||
* following:
|
||||
*
|
||||
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
|
||||
* my_node_new (must call FTC_GNode_Init)
|
||||
* my_node_free (must call FTC_GNode_Done)
|
||||
* my_node_compare (must call FTC_GNode_Compare)
|
||||
* my_node_remove_faceid (must call ftc_gnode_unselect in case
|
||||
* of match)
|
||||
*
|
||||
* - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
|
||||
* my_family_compare
|
||||
* my_family_init
|
||||
* my_family_reset (optional)
|
||||
* my_family_done
|
||||
*
|
||||
* - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
|
||||
* data.
|
||||
*
|
||||
* - Constant structures for a FTC_GNodeClass.
|
||||
*
|
||||
* - MyCacheNew() can be implemented easily as a call to the convenience
|
||||
* function FTC_GCache_New.
|
||||
*
|
||||
* - MyCacheLookup with a call to FTC_GCache_Lookup. This function will
|
||||
* automatically:
|
||||
*
|
||||
* - Search for the corresponding family in the cache, or create
|
||||
* a new one if necessary. Put it in FTC_GQUERY(myquery).family
|
||||
*
|
||||
* - Call FTC_Cache_Lookup.
|
||||
*
|
||||
* If it returns NULL, you should create a new node, then call
|
||||
* ftc_cache_add as usual.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/********* *********/
|
||||
/********* WARNING, THIS IS BETA CODE. *********/
|
||||
/********* *********/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCGLYPH_H__
|
||||
#define __FTCGLYPH_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_INTERNAL_MANAGER_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* We can group glyphs into `families'. Each family correspond to a
|
||||
* given face ID, character size, transform, etc.
|
||||
*
|
||||
* Families are implemented as MRU list nodes. They are
|
||||
* reference-counted.
|
||||
*/
|
||||
|
||||
typedef struct FTC_FamilyRec_
|
||||
{
|
||||
FTC_MruNodeRec mrunode;
|
||||
FT_UInt num_nodes; /* current number of nodes in this family */
|
||||
FTC_Cache cache;
|
||||
FTC_MruListClass clazz;
|
||||
|
||||
} FTC_FamilyRec, *FTC_Family;
|
||||
|
||||
#define FTC_FAMILY(x) ( (FTC_Family)(x) )
|
||||
#define FTC_FAMILY_P(x) ( (FTC_Family*)(x) )
|
||||
|
||||
|
||||
typedef struct FTC_GNodeRec_
|
||||
{
|
||||
FTC_NodeRec node;
|
||||
FTC_Family family;
|
||||
FT_UInt gindex;
|
||||
|
||||
} FTC_GNodeRec, *FTC_GNode;
|
||||
|
||||
#define FTC_GNODE( x ) ( (FTC_GNode)(x) )
|
||||
#define FTC_GNODE_P( x ) ( (FTC_GNode*)(x) )
|
||||
|
||||
|
||||
typedef struct FTC_GQueryRec_
|
||||
{
|
||||
FT_UInt gindex;
|
||||
FTC_Family family;
|
||||
|
||||
} FTC_GQueryRec, *FTC_GQuery;
|
||||
|
||||
#define FTC_GQUERY( x ) ( (FTC_GQuery)(x) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* 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_GNode_Init( FTC_GNode node,
|
||||
FT_UInt gindex, /* glyph index for node */
|
||||
FTC_Family family );
|
||||
|
||||
/* 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_GNode_Compare( FTC_GNode gnode,
|
||||
FTC_GQuery gquery );
|
||||
|
||||
/* call this function to clear a node's family -- this is necessary */
|
||||
/* to implement the `node_remove_faceid' cache method correctly */
|
||||
FT_EXPORT( void )
|
||||
FTC_GNode_UnselectFamily( FTC_GNode gnode,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* must be called by derived FTC_Node_DoneFunc routines */
|
||||
FT_EXPORT( void )
|
||||
FTC_GNode_Done( FTC_GNode node,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_Family_Init( FTC_Family family,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef struct FTC_GCacheRec_
|
||||
{
|
||||
FTC_CacheRec cache;
|
||||
FTC_MruListRec families;
|
||||
|
||||
} FTC_GCacheRec, *FTC_GCache;
|
||||
|
||||
#define FTC_GCACHE( x ) ((FTC_GCache)(x))
|
||||
|
||||
|
||||
/* can be used as @FTC_Cache_InitFunc */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_GCache_Init( FTC_GCache cache );
|
||||
|
||||
|
||||
/* can be used as @FTC_Cache_DoneFunc */
|
||||
FT_EXPORT( void )
|
||||
FTC_GCache_Done( FTC_GCache cache );
|
||||
|
||||
|
||||
/* the glyph cache class adds fields for the family implementation */
|
||||
typedef struct FTC_GCacheClassRec_
|
||||
{
|
||||
FTC_CacheClassRec clazz;
|
||||
FTC_MruListClass family_class;
|
||||
|
||||
} FTC_GCacheClassRec;
|
||||
|
||||
typedef const FTC_GCacheClassRec* FTC_GCacheClass;
|
||||
|
||||
#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x))
|
||||
|
||||
#define FTC_CACHE__GCACHE_CLASS( x ) \
|
||||
FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
|
||||
#define FTC_CACHE__FAMILY_CLASS( x ) \
|
||||
( (FTC_MruListClass)FTC_CACHE__GCACHE_CLASS( x )->family_class )
|
||||
|
||||
|
||||
/* convenience function; use it instead of FTC_Manager_Register_Cache */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_GCache_New( FTC_Manager manager,
|
||||
FTC_GCacheClass clazz,
|
||||
FTC_GCache *acache );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_GCache_Lookup( FTC_GCache cache,
|
||||
FT_UInt32 hash,
|
||||
FT_UInt gindex,
|
||||
FTC_GQuery query,
|
||||
FTC_Node *anode );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_FAMILY_FREE( family, cache ) \
|
||||
FTC_MruList_Remove( &FTC_GCACHE((cache))->families, \
|
||||
(FTC_MruNode)(family) )
|
||||
|
||||
|
||||
#ifdef FTC_INLINE
|
||||
|
||||
#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, \
|
||||
gindex, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_GCache _gcache = FTC_GCACHE( cache ); \
|
||||
FTC_GQuery _gquery = (FTC_GQuery)( query ); \
|
||||
FTC_MruNode_CompareFunc _fcompare = (FTC_MruNode_CompareFunc)(famcmp); \
|
||||
\
|
||||
\
|
||||
_gquery->gindex = (gindex); \
|
||||
\
|
||||
FTC_MRULIST_LOOKUP_CMP( &_gcache->families, _gquery, _fcompare, \
|
||||
_gquery->family, error ); \
|
||||
if ( !error ) \
|
||||
{ \
|
||||
FTC_Family _gqfamily = _gquery->family; \
|
||||
\
|
||||
\
|
||||
_gqfamily->num_nodes++; \
|
||||
\
|
||||
FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ); \
|
||||
\
|
||||
if ( --_gqfamily->num_nodes == 0 ) \
|
||||
FTC_FAMILY_FREE( _gqfamily, _gcache ); \
|
||||
} \
|
||||
FT_END_STMNT
|
||||
/* */
|
||||
|
||||
#else /* !FTC_INLINE */
|
||||
|
||||
#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, \
|
||||
gindex, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
error = FTC_GCache_Lookup( FTC_GCACHE( cache ), hash, gindex, \
|
||||
FTC_GQUERY( query ), (FTC_Node*)&(node) ); \
|
||||
FT_END_STMNT
|
||||
|
||||
#endif /* !FTC_INLINE */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCGLYPH_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcimage.h */
|
||||
/* */
|
||||
/* FreeType Generic Image cache (specification) */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
|
||||
* image per cache node.
|
||||
*
|
||||
* FTC_ICache extends FTC_GCache. For an implementation example,
|
||||
* see FTC_ImageCache in `src/cache/ftbasic.c'.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each image cache really manages FT_Glyph objects. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCIMAGE_H__
|
||||
#define __FTCIMAGE_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_INTERNAL_GLYPH_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* the FT_Glyph image node type - we store only 1 glyph per node */
|
||||
typedef struct FTC_INodeRec_
|
||||
{
|
||||
FTC_GNodeRec gnode;
|
||||
FT_Glyph glyph;
|
||||
|
||||
} FTC_INodeRec, *FTC_INode;
|
||||
|
||||
#define FTC_INODE( x ) ( (FTC_INode)( x ) )
|
||||
#define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex
|
||||
#define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
FT_UInt gindex,
|
||||
FTC_Cache cache,
|
||||
FT_Glyph *aglyph );
|
||||
|
||||
typedef struct FTC_IFamilyClassRec_
|
||||
{
|
||||
FTC_MruListClassRec clazz;
|
||||
FTC_IFamily_LoadGlyphFunc family_load_glyph;
|
||||
|
||||
} FTC_IFamilyClassRec;
|
||||
|
||||
typedef const FTC_IFamilyClassRec* FTC_IFamilyClass;
|
||||
|
||||
#define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x))
|
||||
|
||||
#define FTC_CACHE__IFAMILY_CLASS( x ) \
|
||||
FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class )
|
||||
|
||||
|
||||
/* can be used as a @FTC_Node_FreeFunc */
|
||||
FT_EXPORT( void )
|
||||
FTC_INode_Free( FTC_INode inode,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* Can be used as @FTC_Node_NewFunc. `gquery.index' and `gquery.family'
|
||||
* must be set correctly. This function will call the `family_load_glyph'
|
||||
* method to load the FT_Glyph into the cache node.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_INode_New( FTC_INode *pinode,
|
||||
FTC_GQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* can be used as @FTC_Node_WeightFunc */
|
||||
FT_EXPORT( FT_ULong )
|
||||
FTC_INode_Weight( FTC_INode inode );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCIMAGE_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
-175
@@ -1,175 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcmanag.h */
|
||||
/* */
|
||||
/* FreeType Cache Manager (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003, 2004 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_MRU_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_ManagerRec_
|
||||
{
|
||||
FT_Library library;
|
||||
FT_Memory memory;
|
||||
|
||||
FTC_Node nodes_list;
|
||||
FT_ULong max_weight;
|
||||
FT_ULong cur_weight;
|
||||
FT_UInt num_nodes;
|
||||
|
||||
FTC_Cache caches[FTC_MAX_CACHES];
|
||||
FT_UInt num_caches;
|
||||
|
||||
FTC_MruListRec faces;
|
||||
FTC_MruListRec sizes;
|
||||
|
||||
FT_Pointer request_data;
|
||||
FTC_Face_Requester request_face;
|
||||
|
||||
} 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 );
|
||||
|
||||
|
||||
/* try to flush `count' old nodes from the cache; return the number
|
||||
* of really flushed nodes
|
||||
*/
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_Manager_FlushN( FTC_Manager manager,
|
||||
FT_UInt count );
|
||||
|
||||
|
||||
/* this must be used internally for the moment */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_RegisterCache( FTC_Manager manager,
|
||||
FTC_CacheClass clazz,
|
||||
FTC_Cache *acache );
|
||||
|
||||
/* */
|
||||
|
||||
#define FTC_SCALER_COMPARE( a, b ) \
|
||||
( (a)->face_id == (b)->face_id && \
|
||||
(a)->width == (b)->width && \
|
||||
(a)->height == (b)->height && \
|
||||
((a)->pixel != 0) == ((b)->pixel != 0) && \
|
||||
( (a)->pixel || \
|
||||
( (a)->x_res == (b)->x_res && \
|
||||
(a)->y_res == (b)->y_res ) ) )
|
||||
|
||||
#define FTC_SCALER_HASH( q ) \
|
||||
( FTC_FACE_ID_HASH( (q)->face_id ) + \
|
||||
(q)->width + (q)->height*7 + \
|
||||
( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) )
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCMANAG_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
-247
@@ -1,247 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcmru.h */
|
||||
/* */
|
||||
/* Simple MRU list-cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003, 2004, 2005 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* An MRU is a list that cannot hold more than a certain number of */
|
||||
/* elements (`max_elements'). All elements in the list are sorted in */
|
||||
/* least-recently-used order, i.e., the `oldest' element is at the tail */
|
||||
/* of the list. */
|
||||
/* */
|
||||
/* When doing a lookup (either through `Lookup()' or `Lookup_Node()'), */
|
||||
/* the list is searched for an element with the corresponding key. If */
|
||||
/* it is found, the element is moved to the head of the list and is */
|
||||
/* returned. */
|
||||
/* */
|
||||
/* If no corresponding element is found, the lookup routine will try to */
|
||||
/* obtain a new element with the relevant key. If the list is already */
|
||||
/* full, the oldest element from the list is discarded and replaced by a */
|
||||
/* new one; a new element is added to the list otherwise. */
|
||||
/* */
|
||||
/* Note that it is possible to pre-allocate the element list nodes. */
|
||||
/* This is handy if `max_elements' is sufficiently small, as it saves */
|
||||
/* allocations/releases during the lookup process. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCMRU_H__
|
||||
#define __FTCMRU_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
#define xxFT_DEBUG_ERROR
|
||||
#define FTC_INLINE
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
typedef struct FTC_MruNodeRec_* FTC_MruNode;
|
||||
|
||||
typedef struct FTC_MruNodeRec_
|
||||
{
|
||||
FTC_MruNode next;
|
||||
FTC_MruNode prev;
|
||||
|
||||
} FTC_MruNodeRec;
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruNode_Prepend( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruNode_Up( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruNode_Remove( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
||||
|
||||
typedef struct FTC_MruListRec_* FTC_MruList;
|
||||
|
||||
typedef struct FTC_MruListClassRec_ const * FTC_MruListClass;
|
||||
|
||||
|
||||
typedef FT_Bool
|
||||
(*FTC_MruNode_CompareFunc)( FTC_MruNode node,
|
||||
FT_Pointer key );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_MruNode_InitFunc)( FTC_MruNode node,
|
||||
FT_Pointer key,
|
||||
FT_Pointer data );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_MruNode_ResetFunc)( FTC_MruNode node,
|
||||
FT_Pointer key,
|
||||
FT_Pointer data );
|
||||
|
||||
typedef void
|
||||
(*FTC_MruNode_DoneFunc)( FTC_MruNode node,
|
||||
FT_Pointer data );
|
||||
|
||||
|
||||
typedef struct FTC_MruListClassRec_
|
||||
{
|
||||
FT_UInt node_size;
|
||||
FTC_MruNode_CompareFunc node_compare;
|
||||
FTC_MruNode_InitFunc node_init;
|
||||
FTC_MruNode_ResetFunc node_reset;
|
||||
FTC_MruNode_DoneFunc node_done;
|
||||
|
||||
} FTC_MruListClassRec;
|
||||
|
||||
typedef struct FTC_MruListRec_
|
||||
{
|
||||
FT_UInt num_nodes;
|
||||
FT_UInt max_nodes;
|
||||
FTC_MruNode nodes;
|
||||
FT_Pointer data;
|
||||
FTC_MruListClassRec clazz;
|
||||
FT_Memory memory;
|
||||
|
||||
} FTC_MruListRec;
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Init( FTC_MruList list,
|
||||
FTC_MruListClass clazz,
|
||||
FT_UInt max_nodes,
|
||||
FT_Pointer data,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Reset( FTC_MruList list );
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Done( FTC_MruList list );
|
||||
|
||||
FT_EXPORT( FTC_MruNode )
|
||||
FTC_MruList_Find( FTC_MruList list,
|
||||
FT_Pointer key );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_MruList_New( FTC_MruList list,
|
||||
FT_Pointer key,
|
||||
FTC_MruNode *anode );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_MruList_Lookup( FTC_MruList list,
|
||||
FT_Pointer key,
|
||||
FTC_MruNode *pnode );
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Remove( FTC_MruList list,
|
||||
FTC_MruNode node );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_RemoveSelection( FTC_MruList list,
|
||||
FTC_MruNode_CompareFunc selection,
|
||||
FT_Pointer key );
|
||||
|
||||
|
||||
#ifdef FTC_INLINE
|
||||
|
||||
#define FTC_MRULIST_LOOKUP_CMP( list, key, compare, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_MruNode* _pfirst = &(list)->nodes; \
|
||||
FTC_MruNode_CompareFunc _compare = (FTC_MruNode_CompareFunc)(compare); \
|
||||
FTC_MruNode _first, _node, *_pnode; \
|
||||
\
|
||||
\
|
||||
error = 0; \
|
||||
_first = *(_pfirst); \
|
||||
_node = NULL; \
|
||||
\
|
||||
if ( _first ) \
|
||||
{ \
|
||||
_node = _first; \
|
||||
do \
|
||||
{ \
|
||||
if ( _compare( _node, (key) ) ) \
|
||||
{ \
|
||||
if ( _node != _first ) \
|
||||
FTC_MruNode_Up( _pfirst, _node ); \
|
||||
\
|
||||
_pnode = (FTC_MruNode*)(void*)&(node); \
|
||||
*_pnode = _node; \
|
||||
goto _MruOk; \
|
||||
} \
|
||||
_node = _node->next; \
|
||||
\
|
||||
} while ( _node != _first) ; \
|
||||
} \
|
||||
\
|
||||
error = FTC_MruList_New( (list), (key), (FTC_MruNode*)(void*)&(node) ); \
|
||||
_MruOk: \
|
||||
; \
|
||||
FT_END_STMNT
|
||||
|
||||
#define FTC_MRULIST_LOOKUP( list, key, node, error ) \
|
||||
FTC_MRULIST_LOOKUP_CMP( list, key, (list)->clazz.node_compare, node, error )
|
||||
|
||||
#else /* !FTC_INLINE */
|
||||
|
||||
#define FTC_MRULIST_LOOKUP( list, key, node, error ) \
|
||||
error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) )
|
||||
|
||||
#endif /* !FTC_INLINE */
|
||||
|
||||
|
||||
#define FTC_MRULIST_LOOP( list, node ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_MruNode _first = (list)->nodes; \
|
||||
\
|
||||
\
|
||||
if ( _first ) \
|
||||
{ \
|
||||
FTC_MruNode _node = _first; \
|
||||
\
|
||||
\
|
||||
do \
|
||||
{ \
|
||||
*(FTC_MruNode*)&(node) = _node;
|
||||
|
||||
|
||||
#define FTC_MRULIST_LOOP_END() \
|
||||
_node = _node->next; \
|
||||
\
|
||||
} while ( _node != _first ); \
|
||||
} \
|
||||
FT_END_STMNT
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCMRU_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -1,96 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcsbits.h */
|
||||
/* */
|
||||
/* A small-bitmap cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCSBITS_H__
|
||||
#define __FTCSBITS_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_INTERNAL_GLYPH_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#define FTC_SBIT_ITEMS_PER_NODE 16
|
||||
|
||||
typedef struct FTC_SNodeRec_
|
||||
{
|
||||
FTC_GNodeRec gnode;
|
||||
FT_UInt count;
|
||||
FTC_SBitRec sbits[FTC_SBIT_ITEMS_PER_NODE];
|
||||
|
||||
} FTC_SNodeRec, *FTC_SNode;
|
||||
|
||||
|
||||
#define FTC_SNODE( x ) ( (FTC_SNode)( x ) )
|
||||
#define FTC_SNODE_GINDEX( x ) FTC_GNODE( x )->gindex
|
||||
#define FTC_SNODE_FAMILY( x ) FTC_GNODE( x )->family
|
||||
|
||||
typedef FT_UInt
|
||||
(*FTC_SFamily_GetCountFunc)( FTC_Family family,
|
||||
FTC_Manager manager );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_SFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
FT_UInt gindex,
|
||||
FTC_Manager manager,
|
||||
FT_Face *aface );
|
||||
|
||||
typedef struct FTC_SFamilyClassRec_
|
||||
{
|
||||
FTC_MruListClassRec clazz;
|
||||
FTC_SFamily_GetCountFunc family_get_count;
|
||||
FTC_SFamily_LoadGlyphFunc family_load_glyph;
|
||||
|
||||
} FTC_SFamilyClassRec;
|
||||
|
||||
typedef const FTC_SFamilyClassRec* FTC_SFamilyClass;
|
||||
|
||||
#define FTC_SFAMILY_CLASS( x ) ((FTC_SFamilyClass)(x))
|
||||
|
||||
#define FTC_CACHE__SFAMILY_CLASS( x ) \
|
||||
FTC_SFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS( x )->family_class )
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_SNode_Free( FTC_SNode snode,
|
||||
FTC_Cache cache );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SNode_New( FTC_SNode *psnode,
|
||||
FTC_GQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
FT_EXPORT( FT_ULong )
|
||||
FTC_SNode_Weight( FTC_SNode inode );
|
||||
|
||||
|
||||
FT_EXPORT( FT_Bool )
|
||||
FTC_SNode_Compare( FTC_SNode snode,
|
||||
FTC_GQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCSBITS_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -201,7 +201,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the "long long" type */
|
||||
/* GCC provides the `long long' type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
@@ -265,9 +265,9 @@ FT_BEGIN_HEADER
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_DEF( x ) extern "C" x
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#else
|
||||
#define FT_BASE_DEF( x ) extern x
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -96,58 +96,62 @@
|
||||
|
||||
/* configuration files */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_CONFIG_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* FreeType 2 configuration data. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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_STANDARD_LIBRARY_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* FreeType 2 configuration data. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_STANDARD_LIBRARY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* FreeType 2 interface to the standard C library functions.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_STANDARD_LIBRARY_H
|
||||
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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
|
||||
@@ -155,436 +159,543 @@
|
||||
|
||||
/* public headers */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_FREETYPE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the base FreeType 2 API. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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.) */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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/ftmodapi.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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_TAGS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of TrueType four-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_BDF_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to access BDF-specific strings from a */
|
||||
/* face. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BDF_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to access BDF-specific strings from a face.
|
||||
*
|
||||
*/
|
||||
#define FT_BDF_H <freetype/ftbdf.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_GZIP_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to support for gzip-compressed files. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GZIP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to support for gzip-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_GZIP_H <freetype/ftgzip.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_LZW_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to support for LZW-compressed files. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LZW_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to support for LZW-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_LZW_H <freetype/ftlzw.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_WINFONTS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to support Windows .FNT files */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_WINFONTS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to support Windows FNT files.
|
||||
*
|
||||
*/
|
||||
#define FT_WINFONTS_H <freetype/ftwinfnt.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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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_BITMAP_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional bitmap conversion component. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BITMAP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional bitmap conversion component.
|
||||
*
|
||||
*/
|
||||
#define FT_BITMAP_H <freetype/ftbitmap.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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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_CACHE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* glyph image-related cache declarations. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* glyph image-related cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_IMAGE_H FT_CACHE_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. */
|
||||
/* */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* small bitmaps-related cache declarations. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* small bitmaps-related cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_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. */
|
||||
/* */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* charmap-based cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_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.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* charmap-based cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_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). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_OPENTYPE_VALIDATE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the optional FreeType 2 API used to validate OpenType tables */
|
||||
/* (BASE, GDEF, GPOS, GSUB, JSTF). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OPENTYPE_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType 2 API used to validate OpenType tables (BASE, GDEF,
|
||||
* GPOS, GSUB, JSTF).
|
||||
*
|
||||
*/
|
||||
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GX_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType 2 API used to validate TrueTypeGX/AAT tables (feat,
|
||||
* mort, morx, bsln, just, kern, opbd, trak, prop).
|
||||
*
|
||||
*/
|
||||
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_PFR_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to access PFR-specific data.
|
||||
*
|
||||
*/
|
||||
#define FT_PFR_H <freetype/ftpfr.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_STROKER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to stroke outline path.
|
||||
*/
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SYNTHESIS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to perform artificial obliquing and emboldening.
|
||||
*/
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_XFREE86_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to provide functions specific to the XFree86 and
|
||||
* X.Org X11 servers.
|
||||
*/
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRIGONOMETRY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to perform trigonometric computations (e.g.,
|
||||
* cosines and arc tangents).
|
||||
*/
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
|
||||
/* */
|
||||
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
|
||||
|
||||
#define FT_CACHE_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
|
||||
#define FT_CACHE_INTERNAL_MRU_H <freetype/cache/ftcmru.h>
|
||||
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/cache/ftccache.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/cache/ftcglyph.h>
|
||||
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/cache/ftcimage.h>
|
||||
#define FT_CACHE_INTERNAL_SBITS_H <freetype/cache/ftcsbits.h>
|
||||
/* The internals of the cache sub-system are no longer exposed. We */
|
||||
/* default to FT_CACHE_H at the moment just in case, but we know of */
|
||||
/* no rogue client that uses them. */
|
||||
/* */
|
||||
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
|
||||
|
||||
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
|
||||
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
|
||||
|
||||
/* now include internal headers definitions from <freetype/internal/...> */
|
||||
|
||||
/*
|
||||
* Include internal headers definitions from <freetype/internal/...>
|
||||
* only when building the library.
|
||||
*/
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
|
||||
#include FT_INTERNAL_INTERNAL_H
|
||||
#endif /* FT2_BUILD_LIBRARY */
|
||||
|
||||
|
||||
#endif /* __FT2_BUILD_H__ */
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
/*
|
||||
* This file registers the FreeType modules compiled into the library.
|
||||
*
|
||||
* If you use GNU make, this file IS NOT USED! Instead, it is created in
|
||||
* the objects directory (normally `<topdir>/objs/') based on information
|
||||
* from `<topdir>/modules.cfg'.
|
||||
*
|
||||
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
|
||||
* FreeType without GNU make.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_USE_MODULE(autofit_module_class)
|
||||
FT_USE_MODULE(tt_driver_class)
|
||||
FT_USE_MODULE(t1_driver_class)
|
||||
@@ -15,5 +27,6 @@ FT_USE_MODULE(sfnt_module_class)
|
||||
FT_USE_MODULE(ft_smooth_renderer_class)
|
||||
FT_USE_MODULE(ft_smooth_lcd_renderer_class)
|
||||
FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
|
||||
FT_USE_MODULE(otv_module_class)
|
||||
FT_USE_MODULE(bdf_driver_class)
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -38,22 +38,22 @@ FT_BEGIN_HEADER
|
||||
/* 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" */
|
||||
/* 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 */
|
||||
/* 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 */
|
||||
/* - 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 */
|
||||
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
|
||||
/* definitions. */
|
||||
/* */
|
||||
/* Note also that you can similarly pre-define the macro */
|
||||
@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
|
||||
/* building the library. */
|
||||
/* */
|
||||
/* ObNote: The compiler-specific 64-bit integers are detected in the */
|
||||
/* file "ftconfig.h" either statically or through the */
|
||||
/* file `ftconfig.h' either statically or through the */
|
||||
/* `configure' script on supported platforms. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_FORCE_INT64
|
||||
@@ -100,7 +100,7 @@ FT_BEGIN_HEADER
|
||||
/* LZW-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'compress' program. This is mostly used to parse many of the PCF */
|
||||
/* `compress' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with various X11 distributions. The implementation */
|
||||
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
|
||||
/* (see src/lzw/ftgzip.c). */
|
||||
@@ -115,7 +115,7 @@ FT_BEGIN_HEADER
|
||||
/* Gzip-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* `gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* that come with XFree86. The implementation uses `zlib' to */
|
||||
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
|
||||
/* */
|
||||
@@ -328,7 +328,7 @@ FT_BEGIN_HEADER
|
||||
/* should define FT_DEBUG_MEMORY here. */
|
||||
/* */
|
||||
/* Note that the memory debugger is only activated at runtime when */
|
||||
/* when the _environment_ variable "FT2_DEBUG_MEMORY" is defined also! */
|
||||
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
|
||||
/* */
|
||||
/* Do not #undef this macro here since the build system might define */
|
||||
/* it for certain configurations only. */
|
||||
@@ -471,7 +471,7 @@ FT_BEGIN_HEADER
|
||||
/* component offsets in composite glyphs. */
|
||||
/* */
|
||||
/* Apple and MS disagree on the default behavior of component offsets */
|
||||
/* in composites. Apple says that they should be scaled by the scale */
|
||||
/* in composites. Apple says that they should be scaled by the scaling */
|
||||
/* factors in the transformation matrix (roughly, it's more complex) */
|
||||
/* while MS says they should not. OpenType defines two bits in the */
|
||||
/* composite flags array which can be used to disambiguate, but old */
|
||||
@@ -493,6 +493,14 @@ FT_BEGIN_HEADER
|
||||
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
|
||||
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_BDF
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
@@ -547,14 +555,44 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with CJK script support. */
|
||||
/* */
|
||||
#define AF_CONFIG_OPTION_CJK
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/*
|
||||
* This temporary macro is used to control various optimizations for
|
||||
* reducing the heap footprint of memory-mapped TrueType files.
|
||||
*
|
||||
*/
|
||||
/* #define FT_OPTIMIZE_MEMORY */
|
||||
/*
|
||||
* This temporary macro is used to control various optimizations for
|
||||
* reducing the heap footprint of memory-mapped TrueType files.
|
||||
*/
|
||||
#define FT_OPTIMIZE_MEMORY
|
||||
|
||||
|
||||
/*
|
||||
* Define this variable if you want to keep the layout of internal
|
||||
* structures that was used prior to FreeType 2.2. This also compiles in
|
||||
* a few obsolete functions to avoid linking problems on typical Unix
|
||||
* distributions.
|
||||
*
|
||||
* For embedded systems or building a new distribution from scratch, it
|
||||
* is recommended to disable the macro since it reduces the library's code
|
||||
* size and activates a few memory-saving optimizations as well.
|
||||
*/
|
||||
#define FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* ANSI-specific library and header configuration file (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -51,22 +51,23 @@
|
||||
/* old Crays where `int' is 36 bits), we do not make any guarantee */
|
||||
/* about the correct behaviour of FT2 with all fonts. */
|
||||
/* */
|
||||
/* In these case, "ftconfig.h" will refuse to compile anyway with a */
|
||||
/* message like "couldn't find 32-bit type" or something similar. */
|
||||
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
|
||||
/* message like `couldn't find 32-bit type' or something similar. */
|
||||
/* */
|
||||
/* IMPORTANT NOTE: We do not define aliases for heap management and */
|
||||
/* i/o routines (i.e. malloc/free/fopen/fread/...) */
|
||||
/* since these functions should all be encapsulated */
|
||||
/* by platform-specific implementations of */
|
||||
/* "ftsystem.c". */
|
||||
/* `ftsystem.c'. */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#define FT_INT_MAX INT_MAX
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_ULONG_MAX ULONG_MAX
|
||||
|
||||
|
||||
@@ -80,14 +81,15 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#define ft_isalnum isalnum
|
||||
#define ft_isupper isupper
|
||||
#define ft_islower islower
|
||||
#define ft_isdigit isdigit
|
||||
#define ft_islower islower
|
||||
#define ft_isupper isupper
|
||||
#define ft_isxdigit isxdigit
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define ft_memchr memchr
|
||||
#define ft_memcmp memcmp
|
||||
#define ft_memcpy memcpy
|
||||
#define ft_memmove memmove
|
||||
@@ -101,8 +103,21 @@
|
||||
#define ft_strrchr strrchr
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* file handling */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define FT_FILE FILE
|
||||
#define ft_fclose fclose
|
||||
#define ft_fopen fopen
|
||||
#define ft_fread fread
|
||||
#define ft_fseek fseek
|
||||
#define ft_ftell ftell
|
||||
#define ft_sprintf sprintf
|
||||
|
||||
|
||||
@@ -116,9 +131,32 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ft_qsort qsort
|
||||
|
||||
#define ft_exit exit /* only used to exit from unhandled exceptions */
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* memory allocation */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#define ft_scalloc calloc
|
||||
#define ft_sfree free
|
||||
#define ft_smalloc malloc
|
||||
#define ft_srealloc realloc
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* miscellaneous */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#define ft_atol atol
|
||||
#define ft_labs labs
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
@@ -134,13 +172,13 @@
|
||||
/* jmp_buf is defined as a macro */
|
||||
/* on certain platforms */
|
||||
|
||||
#define ft_longjmp longjmp /* likewise */
|
||||
#define ft_setjmp setjmp /* same thing here */
|
||||
#define ft_longjmp longjmp /* " */
|
||||
|
||||
|
||||
/* the following is only used for debugging purposes, i.e. when */
|
||||
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
|
||||
/* */
|
||||
/* the following is only used for debugging purposes, i.e., if */
|
||||
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,7 @@ FT_BEGIN_HEADER
|
||||
/* Computes the exact bounding box of an outline. This is slower */
|
||||
/* than computing the control box. However, it uses an advanced */
|
||||
/* algorithm which returns _very_ quickly when the two boxes */
|
||||
/* coincide. Otherwise, the outline Bezier arcs are walked over to */
|
||||
/* coincide. Otherwise, the outline Bézier arcs are walked over to */
|
||||
/* extract their extrema. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@@ -87,3 +87,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing BDF-specific strings (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -182,7 +182,7 @@ FT_BEGIN_HEADER
|
||||
* otherwise. It also returns an error if the property is not in the
|
||||
* font.
|
||||
*
|
||||
* In case of error, "aproperty->type" is always set to
|
||||
* In case of error, `aproperty->type' is always set to
|
||||
* @BDF_PROPERTY_TYPE_NONE.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
|
||||
/* bitmaps into 8bpp format (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005 by */
|
||||
/* Copyright 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -57,7 +57,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Bitmap_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initialize a pointer to an FT_Bitmap structure. */
|
||||
/* Initialize a pointer to an @FT_Bitmap structure. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* abitmap :: A pointer to the bitmap structure. */
|
||||
@@ -85,7 +85,7 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Copy( FT_Library library,
|
||||
const FT_Bitmap *source,
|
||||
FT_Bitmap *target);
|
||||
@@ -120,10 +120,10 @@ FT_BEGIN_HEADER
|
||||
/* The current implementation restricts `xStrength' to be less than */
|
||||
/* or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
|
||||
/* */
|
||||
/* Don't embolden the bitmap owned by a @FT_GlyphSlot directly! Call */
|
||||
/* @FT_Bitmap_Copy to get a copy and work on the copy instead. */
|
||||
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
|
||||
/* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Embolden( FT_Library library,
|
||||
FT_Bitmap* bitmap,
|
||||
FT_Pos xStrength,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType Cache subsystem (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -16,21 +16,6 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/********* *********/
|
||||
/********* WARNING, THIS IS BETA CODE. *********/
|
||||
/********* *********/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCACHE_H__
|
||||
#define __FTCACHE_H__
|
||||
|
||||
@@ -42,51 +27,105 @@
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Cache Sub-System */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* How to cache face, size, and glyph data with FreeType 2. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section describes the FreeType 2 cache sub-system which is */
|
||||
/* still in beta. */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* FTC_Manager */
|
||||
/* FTC_FaceID */
|
||||
/* FTC_Face_Requester */
|
||||
/* */
|
||||
/* FTC_Manager_New */
|
||||
/* FTC_Manager_Reset */
|
||||
/* FTC_Manager_Done */
|
||||
/* FTC_Manager_LookupFace */
|
||||
/* FTC_Manager_LookupSize */
|
||||
/* FTC_Manager_RemoveFaceID */
|
||||
/* */
|
||||
/* FTC_Node */
|
||||
/* FTC_Node_Unref */
|
||||
/* */
|
||||
/* FTC_Font */
|
||||
/* FTC_ImageCache */
|
||||
/* FTC_ImageCache_New */
|
||||
/* FTC_ImageCache_Lookup */
|
||||
/* */
|
||||
/* FTC_SBit */
|
||||
/* FTC_SBitCache */
|
||||
/* FTC_SBitCache_New */
|
||||
/* FTC_SBitCache_Lookup */
|
||||
/* */
|
||||
/* FTC_CMapCache */
|
||||
/* FTC_CMapCache_New */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
/*************************************************************************
|
||||
*
|
||||
* <Section>
|
||||
* cache_subsystem
|
||||
*
|
||||
* <Title>
|
||||
* Cache Sub-System
|
||||
*
|
||||
* <Abstract>
|
||||
* How to cache face, size, and glyph data with FreeType 2.
|
||||
*
|
||||
* <Description>
|
||||
* This section describes the FreeType 2 cache sub-system, which is used
|
||||
* to limit the number of concurrently opened @FT_Face and @FT_Size
|
||||
* objects, as well as caching information like character maps and glyph
|
||||
* images while limiting their maximum memory usage.
|
||||
*
|
||||
* Note that all types and functions begin with the `FTC_' prefix.
|
||||
*
|
||||
* The cache is highly portable and thus doesn't know anything about the
|
||||
* fonts installed on your system, or how to access them. This implies
|
||||
* the following scheme:
|
||||
*
|
||||
* First, available or installed font faces are uniquely identified by
|
||||
* @FTC_FaceID values, provided to the cache by the client. Note that
|
||||
* the cache only stores and compares these values, and doesn't try to
|
||||
* interpret them in any way.
|
||||
*
|
||||
* Second, the cache calls, only when needed, a client-provided function
|
||||
* to convert a @FTC_FaceID into a new @FT_Face object. The latter is
|
||||
* then completely managed by the cache, including its termination
|
||||
* through @FT_Done_Face.
|
||||
*
|
||||
* Clients are free to map face IDs to anything else. The most simple
|
||||
* usage is to associate them to a (pathname,face_index) pair that is
|
||||
* used to call @FT_New_Face. However, more complex schemes are also
|
||||
* possible.
|
||||
*
|
||||
* Note that for the cache to work correctly, the face ID values must be
|
||||
* *persistent*, which means that the contents they point to should not
|
||||
* change at runtime, or that their value should not become invalid.
|
||||
*
|
||||
* If this is unavoidable (e.g., when a font is uninstalled at runtime),
|
||||
* you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
|
||||
* the cache get rid of any references to the old @FTC_FaceID it may
|
||||
* keep internally. Failure to do so will lead to incorrect behaviour
|
||||
* or even crashes.
|
||||
*
|
||||
* To use the cache, start with calling @FTC_Manager_New to create a new
|
||||
* @FTC_Manager object, which models a single cache instance. You can
|
||||
* then look up @FT_Face and @FT_Size objects with
|
||||
* @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
|
||||
*
|
||||
* If you want to use the charmap caching, call @FTC_CMapCache_New, then
|
||||
* later use @FTC_CMapCache_Lookup to perform the equivalent of
|
||||
* @FT_Get_Char_Index, only much faster.
|
||||
*
|
||||
* If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
|
||||
* later use @FTC_ImageCache_Lookup to retrieve the corresponding
|
||||
* @FT_Glyph objects from the cache.
|
||||
*
|
||||
* If you need lots of small bitmaps, it is much more memory efficient
|
||||
* to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
|
||||
* returns @FTC_SBitRec structures, which are used to store small
|
||||
* bitmaps directly. (A small bitmap is one whose metrics and
|
||||
* dimensions all fit into 8-bit integers).
|
||||
*
|
||||
* We hope to also provide a kerning cache in the near future.
|
||||
*
|
||||
*
|
||||
* <Order>
|
||||
* FTC_Manager
|
||||
* FTC_FaceID
|
||||
* FTC_Face_Requester
|
||||
*
|
||||
* FTC_Manager_New
|
||||
* FTC_Manager_Reset
|
||||
* FTC_Manager_Done
|
||||
* FTC_Manager_LookupFace
|
||||
* FTC_Manager_LookupSize
|
||||
* FTC_Manager_RemoveFaceID
|
||||
*
|
||||
* FTC_Node
|
||||
* FTC_Node_Unref
|
||||
*
|
||||
* FTC_ImageCache
|
||||
* FTC_ImageCache_New
|
||||
* FTC_ImageCache_Lookup
|
||||
*
|
||||
* FTC_SBit
|
||||
* FTC_SBitCache
|
||||
* FTC_SBitCache_New
|
||||
* FTC_SBitCache_Lookup
|
||||
*
|
||||
* FTC_CMapCache
|
||||
* FTC_CMapCache_New
|
||||
* FTC_CMapCache_Lookup
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -100,108 +139,84 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_FaceID */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An opaque pointer type that is used to identity face objects. The */
|
||||
/* contents of such objects is application-dependent. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type: FTC_FaceID
|
||||
*
|
||||
* @description:
|
||||
* An opaque pointer type that is used to identity face objects. The
|
||||
* contents of such objects is application-dependent.
|
||||
*
|
||||
* These pointers are typically used to point to a user-defined
|
||||
* structure containing a font file path, and face index.
|
||||
*
|
||||
* @note:
|
||||
* Never use NULL as a valid @FTC_FaceID.
|
||||
*
|
||||
* Face IDs are passed by the client to the cache manager, which calls,
|
||||
* when needed, the @FTC_Face_Requester to translate them into new
|
||||
* @FT_Face objects.
|
||||
*
|
||||
* If the content of a given face ID changes at runtime, or if the value
|
||||
* becomes invalid (e.g., when uninstalling a font), you should
|
||||
* immediately call @FTC_Manager_RemoveFaceID before any other cache
|
||||
* function.
|
||||
*
|
||||
* Failure to do so will result in incorrect behaviour or even
|
||||
* memory leaks and crashes.
|
||||
*/
|
||||
typedef struct FTC_FaceIDRec_* FTC_FaceID;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FTC_Face_Requester */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A callback function provided by client applications. It is used */
|
||||
/* to translate a given @FTC_FaceID into a new valid @FT_Face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face_id :: The face ID to resolve. */
|
||||
/* */
|
||||
/* library :: A handle to a FreeType library object. */
|
||||
/* */
|
||||
/* data :: Application-provided request data. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aface :: A new @FT_Face handle. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The face requester should not perform funny things on the returned */
|
||||
/* face object, like creating a new @FT_Size for it, or setting a */
|
||||
/* transformation through @FT_Set_Transform! */
|
||||
/* */
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FTC_Face_Requester
|
||||
*
|
||||
* @description:
|
||||
* A callback function provided by client applications. It is used by
|
||||
* the cache manager to translate a given @FTC_FaceID into a new valid
|
||||
* @FT_Face object, on demand.
|
||||
*
|
||||
* <Input>
|
||||
* face_id ::
|
||||
* The face ID to resolve.
|
||||
*
|
||||
* library ::
|
||||
* A handle to a FreeType library object.
|
||||
*
|
||||
* req_data ::
|
||||
* Application-provided request data (see note below).
|
||||
*
|
||||
* <Output>
|
||||
* aface ::
|
||||
* A new @FT_Face handle.
|
||||
*
|
||||
* <Return>
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* <Note>
|
||||
* The third parameter `req_data' is the same as the one passed by the
|
||||
* client when @FTC_Manager_New is called.
|
||||
*
|
||||
* The face requester should not perform funny things on the returned
|
||||
* face object, like creating a new @FT_Size for it, or setting a
|
||||
* transformation through @FT_Set_Transform!
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FTC_Face_Requester)( FTC_FaceID face_id,
|
||||
FT_Library library,
|
||||
FT_Pointer request_data,
|
||||
FT_Face* aface );
|
||||
|
||||
/* */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_FontRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to describe a given `font' to the cache */
|
||||
/* manager. Note that a `font' is the combination of a given face */
|
||||
/* with a given character size. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* face_id :: The ID of the face to use. */
|
||||
/* */
|
||||
/* pix_width :: The character width in integer pixels. */
|
||||
/* */
|
||||
/* pix_height :: The character height in integer pixels. */
|
||||
/* */
|
||||
typedef struct FTC_FontRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_UShort pix_width;
|
||||
FT_UShort pix_height;
|
||||
#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
|
||||
|
||||
} FTC_FontRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_FONT_COMPARE( f1, f2 ) \
|
||||
( (f1)->face_id == (f2)->face_id && \
|
||||
(f1)->pix_width == (f2)->pix_width && \
|
||||
(f1)->pix_height == (f2)->pix_height )
|
||||
|
||||
#define FT_POINTER_TO_ULONG( p ) ((FT_ULong)(FT_Pointer)(p))
|
||||
|
||||
#define FTC_FACE_ID_HASH( i ) \
|
||||
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
|
||||
#define FTC_FACE_ID_HASH( i ) \
|
||||
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
|
||||
( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
|
||||
|
||||
#define FTC_FONT_HASH( f ) \
|
||||
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
|
||||
((f)->pix_width << 8) ^ \
|
||||
((f)->pix_height) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_Font */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple handle to an @FTC_FontRec structure. */
|
||||
/* */
|
||||
typedef FTC_FontRec* FTC_Font;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
@@ -220,8 +235,20 @@ FT_BEGIN_HEADER
|
||||
/* FTC_Manager */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This object is used to cache one or more @FT_Face objects, along */
|
||||
/* with corresponding @FT_Size objects. */
|
||||
/* This object corresponds to one instance of the cache-subsystem. */
|
||||
/* It is used to cache one or more @FT_Face objects, along with */
|
||||
/* corresponding @FT_Size objects. */
|
||||
/* */
|
||||
/* The manager intentionally limits the total number of opened */
|
||||
/* @FT_Face and @FT_Size objects to control memory usage. See the */
|
||||
/* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
|
||||
/* */
|
||||
/* The manager is also used to cache `nodes' of various types while */
|
||||
/* limiting their total memory usage. */
|
||||
/* */
|
||||
/* All limitations are enforced by keeping lists of managed objects */
|
||||
/* in most-recently-used order, and flushing old nodes to make room */
|
||||
/* for new ones. */
|
||||
/* */
|
||||
typedef struct FTC_ManagerRec_* FTC_Manager;
|
||||
|
||||
@@ -236,9 +263,9 @@ FT_BEGIN_HEADER
|
||||
/* reference-counted. A node with a count of 0 might be flushed */
|
||||
/* out of a full cache whenever a lookup request is performed. */
|
||||
/* */
|
||||
/* If you lookup nodes, you have the ability to "acquire" them, i.e., */
|
||||
/* If you lookup nodes, you have the ability to `acquire' them, i.e., */
|
||||
/* to increment their reference count. This will prevent the node */
|
||||
/* from being flushed out of the cache until you explicitly "release" */
|
||||
/* from being flushed out of the cache until you explicitly `release' */
|
||||
/* it (see @FTC_Node_Unref). */
|
||||
/* */
|
||||
/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
|
||||
@@ -255,16 +282,23 @@ FT_BEGIN_HEADER
|
||||
/* Creates a new cache manager. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: The parent FreeType library handle to use. */
|
||||
/* library :: The parent FreeType library handle to use. */
|
||||
/* */
|
||||
/* max_bytes :: Maximum number of bytes to use for cached data. */
|
||||
/* Use 0 for defaults. */
|
||||
/* max_faces :: Maximum number of opened @FT_Face objects managed by */
|
||||
/* this cache instance. Use 0 for defaults. */
|
||||
/* */
|
||||
/* requester :: An application-provided callback used to translate */
|
||||
/* face IDs into real @FT_Face objects. */
|
||||
/* max_sizes :: Maximum number of opened @FT_Size objects managed by */
|
||||
/* this cache instance. Use 0 for defaults. */
|
||||
/* */
|
||||
/* req_data :: A generic pointer that is passed to the requester */
|
||||
/* each time it is called (see @FTC_Face_Requester). */
|
||||
/* max_bytes :: Maximum number of bytes to use for cached data nodes. */
|
||||
/* Use 0 for defaults. Note that this value does not */
|
||||
/* account for managed @FT_Face and @FT_Size objects. */
|
||||
/* */
|
||||
/* requester :: An application-provided callback used to translate */
|
||||
/* face IDs into real @FT_Face objects. */
|
||||
/* */
|
||||
/* req_data :: A generic pointer that is passed to the requester */
|
||||
/* each time it is called (see @FTC_Face_Requester). */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* amanager :: A handle to a new manager object. 0 in case of */
|
||||
@@ -346,6 +380,14 @@ FT_BEGIN_HEADER
|
||||
/* the @FT_Set_Transform function) on a returned face! If you need */
|
||||
/* to transform glyphs, do it yourself after glyph loading. */
|
||||
/* */
|
||||
/* When you perform a lookup, out-of-memory errors are detected */
|
||||
/* _within_ the lookup and force incremental flushes of the cache */
|
||||
/* until enough memory is released for the lookup to succeed. */
|
||||
/* */
|
||||
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
|
||||
/* already been completely flushed, and still no memory was available */
|
||||
/* for the operation. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_LookupFace( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
@@ -402,7 +444,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieve the @FT_Size object that corresponds to a given */
|
||||
/* @FTC_Scaler through a cache manager. */
|
||||
/* @FTC_ScalerRec pointer through a cache manager. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
@@ -423,6 +465,15 @@ FT_BEGIN_HEADER
|
||||
/* if you need it. Note that this object is also owned by the */
|
||||
/* manager. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* When you perform a lookup, out-of-memory errors are detected */
|
||||
/* _within_ the lookup and force incremental flushes of the cache */
|
||||
/* until enough memory is released for the lookup to succeed. */
|
||||
/* */
|
||||
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
|
||||
/* already been completely flushed, and still no memory is available */
|
||||
/* for the operation. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_LookupSize( FTC_Manager manager,
|
||||
FTC_Scaler scaler,
|
||||
@@ -449,7 +500,33 @@ FT_BEGIN_HEADER
|
||||
FTC_Manager manager );
|
||||
|
||||
|
||||
/* remove all nodes belonging to a given face_id */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FTC_Manager_RemoveFaceID
|
||||
*
|
||||
* @description:
|
||||
* A special function used to indicate to the cache manager that
|
||||
* a given @FTC_FaceID is no longer valid, either because its
|
||||
* content changed, or because it was deallocated or uninstalled.
|
||||
*
|
||||
* @input:
|
||||
* manager ::
|
||||
* The cache manager handle.
|
||||
*
|
||||
* face_id ::
|
||||
* The @FTC_FaceID to be removed.
|
||||
*
|
||||
* @note:
|
||||
* This function flushes all nodes from the cache corresponding to this
|
||||
* `face_id', with the exception of nodes with a non-null reference
|
||||
* count.
|
||||
*
|
||||
* Such nodes are however modified internally so as to never appear
|
||||
* in later lookups with the same `face_id' value, and to be immediately
|
||||
* destroyed when released by all their users.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FTC_Manager_RemoveFaceID( FTC_Manager manager,
|
||||
FTC_FaceID face_id );
|
||||
@@ -462,65 +539,74 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FTC_CMapCache
|
||||
* FTC_CMapCache
|
||||
*
|
||||
* @description:
|
||||
* An opaque handle used to manager a charmap cache. This cache is
|
||||
* to hold character codes -> glyph indices mappings.
|
||||
* An opaque handle used to model a charmap cache. This cache is to
|
||||
* hold character codes -> glyph indices mappings.
|
||||
*
|
||||
*/
|
||||
typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_New */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Create a new charmap cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* acache :: A new cache handle. NULL in case of error. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Like all other caches, this one will be destroyed with the cache */
|
||||
/* manager. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FTC_CMapCache_New
|
||||
*
|
||||
* @description:
|
||||
* Create a new charmap cache.
|
||||
*
|
||||
* @input:
|
||||
* manager ::
|
||||
* A handle to the cache manager.
|
||||
*
|
||||
* @output:
|
||||
* acache ::
|
||||
* A new cache handle. NULL in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* Like all other caches, this one will be destroyed with the cache
|
||||
* manager.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_CMapCache_New( FTC_Manager manager,
|
||||
FTC_CMapCache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Translate a character code into a glyph index, using the charmap */
|
||||
/* cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* cache :: A charmap cache handle. */
|
||||
/* */
|
||||
/* face_id :: The source face ID. */
|
||||
/* */
|
||||
/* cmap_index :: The index of the charmap in the source face. */
|
||||
/* */
|
||||
/* char_code :: The character code (in the corresponding charmap). */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Glyph index. 0 means `no glyph'. */
|
||||
/* */
|
||||
/************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FTC_CMapCache_Lookup
|
||||
*
|
||||
* @description:
|
||||
* Translate a character code into a glyph index, using the charmap
|
||||
* cache.
|
||||
*
|
||||
* @input:
|
||||
* cache ::
|
||||
* A charmap cache handle.
|
||||
*
|
||||
* face_id ::
|
||||
* The source face ID.
|
||||
*
|
||||
* cmap_index ::
|
||||
* The index of the charmap in the source face.
|
||||
*
|
||||
* char_code ::
|
||||
* The character code (in the corresponding charmap).
|
||||
*
|
||||
* @return:
|
||||
* Glyph index. 0 means `no glyph'.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_CMapCache_Lookup( FTC_CMapCache cache,
|
||||
FTC_FaceID face_id,
|
||||
@@ -546,26 +632,63 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FTC_ImageTypeRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used to model the type of images in a glyph cache.
|
||||
*
|
||||
* @fields:
|
||||
* face_id ::
|
||||
* The face ID.
|
||||
*
|
||||
* width ::
|
||||
* The width in pixels.
|
||||
*
|
||||
* height ::
|
||||
* The height in pixels.
|
||||
*
|
||||
* flags ::
|
||||
* The load flags, as in @FT_Load_Glyph.
|
||||
*
|
||||
*/
|
||||
typedef struct FTC_ImageTypeRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_Int width;
|
||||
FT_Int height;
|
||||
FT_Int32 flags;
|
||||
FTC_FaceID face_id;
|
||||
FT_Int width;
|
||||
FT_Int height;
|
||||
FT_Int32 flags;
|
||||
|
||||
} FTC_ImageTypeRec;
|
||||
|
||||
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
|
||||
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FTC_ImageType
|
||||
*
|
||||
* @description:
|
||||
* A handle to an @FTC_ImageTypeRec structure.
|
||||
*
|
||||
*/
|
||||
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
|
||||
|
||||
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
|
||||
( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \
|
||||
(d1)->flags == (d2)->flags )
|
||||
|
||||
#define FTC_IMAGE_TYPE_HASH( d ) \
|
||||
(FT_UFast)( FTC_FONT_HASH( &(d)->font ) ^ \
|
||||
( (d)->flags << 4 ) )
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
|
||||
( (d1)->face_id == (d2)->face_id && \
|
||||
(d1)->width == (d2)->width && \
|
||||
(d1)->flags == (d2)->flags )
|
||||
|
||||
#define FTC_IMAGE_TYPE_HASH( d ) \
|
||||
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
|
||||
( (d)->width << 8 ) ^ (d)->height ^ \
|
||||
( (d)->flags << 4 ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -636,12 +759,12 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the glyph image, after increasing its reference */
|
||||
/* count. This ensures that the node (as well as the FT_Glyph) will */
|
||||
/* count. This ensures that the node (as well as the @FT_Glyph) will */
|
||||
/* always be kept in the cache until you call @FTC_Node_Unref to */
|
||||
/* `release' it. */
|
||||
/* */
|
||||
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
||||
/* that the FT_Glyph could be flushed out of the cache on the next */
|
||||
/* that the @FT_Glyph could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
/* */
|
||||
@@ -807,6 +930,66 @@ FT_BEGIN_HEADER
|
||||
FTC_Node *anode );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*@***********************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_FontRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to describe a given `font' to the cache */
|
||||
/* manager. Note that a `font' is the combination of a given face */
|
||||
/* with a given character size. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* face_id :: The ID of the face to use. */
|
||||
/* */
|
||||
/* pix_width :: The character width in integer pixels. */
|
||||
/* */
|
||||
/* pix_height :: The character height in integer pixels. */
|
||||
/* */
|
||||
typedef struct FTC_FontRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_UShort pix_width;
|
||||
FT_UShort pix_height;
|
||||
|
||||
} FTC_FontRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_FONT_COMPARE( f1, f2 ) \
|
||||
( (f1)->face_id == (f2)->face_id && \
|
||||
(f1)->pix_width == (f2)->pix_width && \
|
||||
(f1)->pix_height == (f2)->pix_height )
|
||||
|
||||
#define FTC_FONT_HASH( f ) \
|
||||
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
|
||||
((f)->pix_width << 8) ^ \
|
||||
((f)->pix_height) )
|
||||
|
||||
typedef FTC_FontRec* FTC_Font;
|
||||
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Face( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
FT_Face *aface );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Size( FTC_Manager manager,
|
||||
FTC_Font font,
|
||||
FT_Face *aface,
|
||||
FT_Size *asize );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
@@ -6,6 +6,20 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* general_remarks */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* General Remarks */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* user_allocation */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
@@ -15,6 +29,7 @@
|
||||
/* Core API */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* version */
|
||||
/* basic_types */
|
||||
/* base_interface */
|
||||
/* glyph_management */
|
||||
@@ -24,6 +39,7 @@
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
@@ -40,7 +56,6 @@
|
||||
/* bdf_fonts */
|
||||
/* pfr_fonts */
|
||||
/* winfnt_fonts */
|
||||
/* ot_validation */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType error codes (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2004 by */
|
||||
/* Copyright 2002, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -52,6 +52,8 @@
|
||||
"broken table" )
|
||||
FT_ERRORDEF_( Invalid_Offset, 0x09, \
|
||||
"broken offset within table" )
|
||||
FT_ERRORDEF_( Array_Too_Large, 0x0A, \
|
||||
"array allocation size too large" )
|
||||
|
||||
/* glyph/character errors */
|
||||
|
||||
@@ -226,6 +228,8 @@
|
||||
"`ENCODING' field missing" )
|
||||
FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \
|
||||
"`BBX' field missing" )
|
||||
FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \
|
||||
"`BBX' too big" )
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType convenience functions to handle glyphs (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -134,10 +134,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used for bitmap glyph images. This really is a */
|
||||
/* `sub-class' of `FT_GlyphRec'. */
|
||||
/* `sub-class' of @FT_GlyphRec. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The root FT_Glyph fields. */
|
||||
/* root :: The root @FT_Glyph fields. */
|
||||
/* */
|
||||
/* left :: The left-side bearing, i.e., the horizontal distance */
|
||||
/* from the current pen position to the left border of the */
|
||||
@@ -150,11 +150,11 @@ FT_BEGIN_HEADER
|
||||
/* bitmap :: A descriptor for the bitmap. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You can typecast FT_Glyph to FT_BitmapGlyph if you have */
|
||||
/* glyph->format == FT_GLYPH_FORMAT_BITMAP. This lets you access */
|
||||
/* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
|
||||
/* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
|
||||
/* the bitmap's contents easily. */
|
||||
/* */
|
||||
/* The corresponding pixel buffer is always owned by the BitmapGlyph */
|
||||
/* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
|
||||
/* and is thus created and destroyed with it. */
|
||||
/* */
|
||||
typedef struct FT_BitmapGlyphRec_
|
||||
@@ -186,21 +186,21 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used for outline (vectorial) glyph images. This */
|
||||
/* really is a `sub-class' of `FT_GlyphRec'. */
|
||||
/* really is a `sub-class' of @FT_GlyphRec. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The root FT_Glyph fields. */
|
||||
/* root :: The root @FT_Glyph fields. */
|
||||
/* */
|
||||
/* outline :: A descriptor for the outline. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You can typecast FT_Glyph to FT_OutlineGlyph if you have */
|
||||
/* glyph->format == FT_GLYPH_FORMAT_OUTLINE. This lets you access */
|
||||
/* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */
|
||||
/* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
|
||||
/* the outline's content easily. */
|
||||
/* */
|
||||
/* As the outline is extracted from a glyph slot, its coordinates are */
|
||||
/* expressed normally in 26.6 pixels, unless the flag */
|
||||
/* FT_LOAD_NO_SCALE was used in FT_Load_Glyph() or FT_Load_Char(). */
|
||||
/* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
|
||||
/* */
|
||||
/* The outline's tables are always owned by the object and are */
|
||||
/* destroyed with it. */
|
||||
@@ -277,8 +277,7 @@ FT_BEGIN_HEADER
|
||||
/* expressed in 1/64th of a pixel. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code (the glyph format is not scalable if it is */
|
||||
/* not zero). */
|
||||
/* FreeType error code (if not 0, the glyph format is not scalable). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The 2x2 transformation matrix is also applied to the glyph's */
|
||||
@@ -335,11 +334,11 @@ FT_BEGIN_HEADER
|
||||
/* @FT_Glyph_BBox_Mode values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_glyph_bbox_unscaled :: see @FT_GLYPH_BBOX_UNSCALED */
|
||||
/* ft_glyph_bbox_subpixels :: see @FT_GLYPH_BBOX_SUBPIXELS */
|
||||
/* ft_glyph_bbox_gridfit :: see @FT_GLYPH_BBOX_GRIDFIT */
|
||||
/* ft_glyph_bbox_truncate :: see @FT_GLYPH_BBOX_TRUNCATE */
|
||||
/* ft_glyph_bbox_pixels :: see @FT_GLYPH_BBOX_PIXELS */
|
||||
/* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
|
||||
/* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
|
||||
/* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
|
||||
/* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
|
||||
/* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
|
||||
/* */
|
||||
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
|
||||
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
|
||||
@@ -354,11 +353,11 @@ FT_BEGIN_HEADER
|
||||
/* FT_Glyph_Get_CBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns a glyph's `control box'. The control box encloses all the */
|
||||
/* outline's points, including Bezier control points. Though it */
|
||||
/* Return a glyph's `control box'. The control box encloses all the */
|
||||
/* outline's points, including Bézier control points. Though it */
|
||||
/* coincides with the exact bounding box for most glyphs, it can be */
|
||||
/* slightly larger in some situations (like when rotating an outline */
|
||||
/* which contains Bezier outside arcs). */
|
||||
/* which contains Bézier outside arcs). */
|
||||
/* */
|
||||
/* Computing the control box is very fast, while getting the bounding */
|
||||
/* box can take much more time as it needs to walk over all segments */
|
||||
@@ -379,32 +378,36 @@ FT_BEGIN_HEADER
|
||||
/* Coordinates are relative to the glyph origin, using the Y-upwards */
|
||||
/* convention. */
|
||||
/* */
|
||||
/* If the glyph has been loaded with FT_LOAD_NO_SCALE, `bbox_mode' */
|
||||
/* must be set to `FT_GLYPH_BBOX_UNSCALED' to get unscaled font */
|
||||
/* units in 26.6 pixel format. The value `FT_GLYPH_BBOX_SUBPIXELS' */
|
||||
/* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
|
||||
/* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
|
||||
/* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
|
||||
/* is another name for this constant. */
|
||||
/* */
|
||||
/* Note that the maximum coordinates are exclusive, which means that */
|
||||
/* one can compute the width and height of the glyph image (be it in */
|
||||
/* integer or 26.6 pixels) as: */
|
||||
/* */
|
||||
/* { */
|
||||
/* width = bbox.xMax - bbox.xMin; */
|
||||
/* height = bbox.yMax - bbox.yMin; */
|
||||
/* } */
|
||||
/* */
|
||||
/* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
|
||||
/* `FT_GLYPH_BBOX_GRIDFIT', the coordinates will also be grid-fitted, */
|
||||
/* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
|
||||
/* which corresponds to: */
|
||||
/* */
|
||||
/* { */
|
||||
/* bbox.xMin = FLOOR(bbox.xMin); */
|
||||
/* bbox.yMin = FLOOR(bbox.yMin); */
|
||||
/* bbox.xMax = CEILING(bbox.xMax); */
|
||||
/* bbox.yMax = CEILING(bbox.yMax); */
|
||||
/* } */
|
||||
/* */
|
||||
/* To get the bbox in pixel coordinates, set `bbox_mode' to */
|
||||
/* `FT_GLYPH_BBOX_TRUNCATE'. */
|
||||
/* @FT_GLYPH_BBOX_TRUNCATE. */
|
||||
/* */
|
||||
/* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
|
||||
/* to `FT_GLYPH_BBOX_PIXELS'. */
|
||||
/* to @FT_GLYPH_BBOX_PIXELS. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Glyph_Get_CBox( FT_Glyph glyph,
|
||||
@@ -443,7 +446,7 @@ FT_BEGIN_HEADER
|
||||
/* The glyph image is translated with the `origin' vector before */
|
||||
/* rendering. */
|
||||
/* */
|
||||
/* The first parameter is a pointer to a FT_Glyph handle, that will */
|
||||
/* The first parameter is a pointer to an @FT_Glyph handle, that will */
|
||||
/* be replaced by this function. Typically, you would use (omitting */
|
||||
/* error handling): */
|
||||
/* */
|
||||
@@ -502,6 +505,8 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( void )
|
||||
FT_Done_Glyph( FT_Glyph glyph );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* other helpful functions */
|
||||
|
||||
@@ -563,3 +568,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
||||
@@ -0,0 +1,358 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftgxval.h */
|
||||
/* */
|
||||
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005, 2006 by */
|
||||
/* Masatake YAMATO, Redhat K.K, */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* gxvalid is derived from both gxlayout module and otvalid module. */
|
||||
/* Development of gxlayout is supported by the Information-technology */
|
||||
/* Promotion Agency(IPA), Japan. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTGXVAL_H__
|
||||
#define __FTGXVAL_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* gx_validation */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* TrueTypeGX/AAT Validation */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* An API to validate TrueTypeGX/AAT tables. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains the declaration of functions to validate */
|
||||
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
|
||||
/* trak, prop, lcar). */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* */
|
||||
/* Warning: Use FT_VALIDATE_XXX to validate a table. */
|
||||
/* Following definitions are for gxvalid developers. */
|
||||
/* */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#define FT_VALIDATE_feat_INDEX 0
|
||||
#define FT_VALIDATE_mort_INDEX 1
|
||||
#define FT_VALIDATE_morx_INDEX 2
|
||||
#define FT_VALIDATE_bsln_INDEX 3
|
||||
#define FT_VALIDATE_just_INDEX 4
|
||||
#define FT_VALIDATE_kern_INDEX 5
|
||||
#define FT_VALIDATE_opbd_INDEX 6
|
||||
#define FT_VALIDATE_trak_INDEX 7
|
||||
#define FT_VALIDATE_prop_INDEX 8
|
||||
#define FT_VALIDATE_lcar_INDEX 9
|
||||
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_VALIDATE_GX_LENGTH
|
||||
*
|
||||
* @description:
|
||||
* The number of tables checked in this module. Use it as a parameter
|
||||
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
|
||||
*/
|
||||
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
|
||||
|
||||
/* */
|
||||
|
||||
/* Up to 0x1000 is used by otvalid.
|
||||
Ox2xxx is reserved for feature OT extension. */
|
||||
#define FT_VALIDATE_GX_START 0x4000
|
||||
#define FT_VALIDATE_GX_BITFIELD( tag ) \
|
||||
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_GXXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
|
||||
* indicate which TrueTypeGX/AAT Type tables should be validated.
|
||||
*
|
||||
* @values:
|
||||
* FT_VALIDATE_feat ::
|
||||
* Validate `feat' table.
|
||||
*
|
||||
* FT_VALIDATE_mort ::
|
||||
* Validate `mort' table.
|
||||
*
|
||||
* FT_VALIDATE_morx ::
|
||||
* Validate `morx' table.
|
||||
*
|
||||
* FT_VALIDATE_bsln ::
|
||||
* Validate `bsln' table.
|
||||
*
|
||||
* FT_VALIDATE_just ::
|
||||
* Validate `just' table.
|
||||
*
|
||||
* FT_VALIDATE_kern ::
|
||||
* Validate `kern' table.
|
||||
*
|
||||
* FT_VALIDATE_opbd ::
|
||||
* Validate `opbd' table.
|
||||
*
|
||||
* FT_VALIDATE_trak ::
|
||||
* Validate `trak' table.
|
||||
*
|
||||
* FT_VALIDATE_prop ::
|
||||
* Validate `prop' table.
|
||||
*
|
||||
* FT_VALIDATE_lcar ::
|
||||
* Validate `lcar' table.
|
||||
*
|
||||
* FT_VALIDATE_GX ::
|
||||
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
|
||||
* opbd, trak, prop and lcar).
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
|
||||
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
|
||||
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
|
||||
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
|
||||
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
|
||||
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
|
||||
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
|
||||
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
|
||||
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
|
||||
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
|
||||
|
||||
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
|
||||
FT_VALIDATE_mort | \
|
||||
FT_VALIDATE_morx | \
|
||||
FT_VALIDATE_bsln | \
|
||||
FT_VALIDATE_just | \
|
||||
FT_VALIDATE_kern | \
|
||||
FT_VALIDATE_opbd | \
|
||||
FT_VALIDATE_trak | \
|
||||
FT_VALIDATE_prop | \
|
||||
FT_VALIDATE_lcar )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_TrueTypeGX_Validate
|
||||
*
|
||||
* @description:
|
||||
* Validate various TrueTypeGX tables to assure that all offsets and
|
||||
* indices are valid. The idea is that a higher-level library which
|
||||
* actually does the text layout can access those tables without
|
||||
* error checking (which can be quite time consuming).
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the tables to be validated. See
|
||||
* @FT_VALIDATE_GXXXX for possible values.
|
||||
*
|
||||
* table_length ::
|
||||
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
|
||||
* should be passed.
|
||||
*
|
||||
* @output:
|
||||
* tables ::
|
||||
* The array where all validated sfnt tables are stored.
|
||||
* The array itself must be allocated by a client.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with TrueTypeGX fonts, returning an error
|
||||
* otherwise.
|
||||
*
|
||||
* After use, the application should deallocate the buffers pointed to by
|
||||
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
|
||||
* indicates that the table either doesn't exist in the font, the
|
||||
* application hasn't asked for validation, or the validator doesn't have
|
||||
* the ability to validate the sfnt table.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_TrueTypeGX_Validate( FT_Face face,
|
||||
FT_UInt validation_flags,
|
||||
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
|
||||
FT_UInt table_length );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_TrueTypeGX_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by TrueTypeGX validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer allocated by
|
||||
* @FT_TrueTypeGX_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_TrueTypeGX_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_TrueTypeGX_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_CKERNXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_ClassicKern_Validate
|
||||
* to indicate the classic kern dialect or dialects. If the selected
|
||||
* type doesn't fit, @FT_ClassicKern_Validate regards the table as
|
||||
* invalid.
|
||||
*
|
||||
* @values:
|
||||
* FT_VALIDATE_MS ::
|
||||
* Handle the `kern' table as a classic Microsoft kern table.
|
||||
*
|
||||
* FT_VALIDATE_APPLE ::
|
||||
* Handle the `kern' table as a classic Apple kern table.
|
||||
*
|
||||
* FT_VALIDATE_CKERN ::
|
||||
* Handle the `kern' as either classic Apple or Microsoft kern table.
|
||||
*/
|
||||
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
|
||||
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
|
||||
|
||||
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_ClassicKern_Validate
|
||||
*
|
||||
* @description:
|
||||
* Validate classic (16bit format) kern table to assure that the offsets
|
||||
* and indices are valid. The idea is that a higher-level library which
|
||||
* actually does the text layout can access those tables without error
|
||||
* checking (which can be quite time consuming).
|
||||
*
|
||||
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
|
||||
* the new 32bit format and the classic 16bit format, while
|
||||
* FT_ClassicKern_Validate only supports the classic 16bit format.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the dialect to be validated. See
|
||||
* @FT_VALIDATE_CKERNXXX for possible values.
|
||||
*
|
||||
* @output:
|
||||
* ckern_table ::
|
||||
* A pointer to the kern table.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* After use, the application should deallocate the buffers pointed to by
|
||||
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
|
||||
* indicates that the table doesn't exist in the font.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_ClassicKern_Validate( FT_Face face,
|
||||
FT_UInt validation_flags,
|
||||
FT_Bytes *ckern_table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_ClassicKern_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by classic Kern validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer that is allocated by
|
||||
* @FT_ClassicKern_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_ClassicKern_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_ClassicKern_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTGXVAL_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Gzip-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -55,13 +55,15 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse gzip-compressed font files. This is
|
||||
* mainly used to support the compressed *.pcf.gz fonts that come
|
||||
* mainly used to support the compressed `*.pcf.gz' fonts that come
|
||||
* with XFree86.
|
||||
*
|
||||
* @input:
|
||||
* stream :: The target embedding stream.
|
||||
* stream ::
|
||||
* The target embedding stream.
|
||||
*
|
||||
* source :: The source stream.
|
||||
* source ::
|
||||
* The source stream.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
@@ -69,8 +71,8 @@ FT_BEGIN_HEADER
|
||||
* @note:
|
||||
* The source stream must be opened _before_ calling this function.
|
||||
*
|
||||
* Calling the internal function FT_Stream_Close on the new stream will
|
||||
* *not* call FT_Stream_Close on the source stream. None of the stream
|
||||
* Calling the internal function `FT_Stream_Close' on the new stream will
|
||||
* *not* call `FT_Stream_Close' on the source stream. None of the stream
|
||||
* objects will be released to the heap.
|
||||
*
|
||||
* The stream implementation is very basic and resets the decompression
|
||||
@@ -82,8 +84,8 @@ FT_BEGIN_HEADER
|
||||
* compressed file, the library will try to open a gzipped stream from
|
||||
* it and re-open the face with it.
|
||||
*
|
||||
* This function may return "FT_Err_Unimplemented" if your build of
|
||||
* FreeType was not compiled with zlib support.
|
||||
* This function may return `FT_Err_Unimplemented_Feature' if your build
|
||||
* of FreeType was not compiled with zlib support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stream_OpenGzip( FT_Stream stream,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* FreeType glyph image formats and default raster interface */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -129,7 +129,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_PIXEL_MODE_GRAY :: */
|
||||
/* An 8-bit bitmap, generally used to represent anti-aliased glyph */
|
||||
/* images. Each pixel is stored in one byte. Note that the number */
|
||||
/* of value "gray" levels is stored in the `num_bytes' field of */
|
||||
/* of value `gray' levels is stored in the `num_bytes' field of */
|
||||
/* the @FT_Bitmap structure (it generally is 256). */
|
||||
/* */
|
||||
/* FT_PIXEL_MODE_GRAY2 :: */
|
||||
@@ -144,15 +144,15 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* FT_PIXEL_MODE_LCD :: */
|
||||
/* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
|
||||
/* images used for display on LCD displays; the bitmap's width is */
|
||||
/* three times wider than the original glyph image. See also */
|
||||
/* images used for display on LCD displays; the bitmap is three */
|
||||
/* times wider than the original glyph image. See also */
|
||||
/* @FT_RENDER_MODE_LCD. */
|
||||
/* */
|
||||
/* FT_PIXEL_MODE_LCD_V :: */
|
||||
/* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
|
||||
/* images used for display on rotated LCD displays; the bitmap's */
|
||||
/* height is three times taller than the original glyph image. */
|
||||
/* See also @FT_RENDER_MODE_LCD_V. */
|
||||
/* images used for display on rotated LCD displays; the bitmap */
|
||||
/* is three times taller than the original glyph image. See also */
|
||||
/* @FT_RENDER_MODE_LCD_V. */
|
||||
/* */
|
||||
typedef enum FT_Pixel_Mode_
|
||||
{
|
||||
@@ -179,11 +179,11 @@ FT_BEGIN_HEADER
|
||||
/* @FT_Pixel_Mode values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_pixel_mode_none :: see @FT_PIXEL_MODE_NONE */
|
||||
/* ft_pixel_mode_mono :: see @FT_PIXEL_MODE_MONO */
|
||||
/* ft_pixel_mode_grays :: see @FT_PIXEL_MODE_GRAY */
|
||||
/* ft_pixel_mode_pal2 :: see @FT_PIXEL_MODE_GRAY2 */
|
||||
/* ft_pixel_mode_pal4 :: see @FT_PIXEL_MODE_GRAY4 */
|
||||
/* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */
|
||||
/* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */
|
||||
/* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */
|
||||
/* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */
|
||||
/* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */
|
||||
/* */
|
||||
#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
|
||||
#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
|
||||
@@ -203,8 +203,8 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
|
||||
/* */
|
||||
/* An enumeration type used to describe the format of a bitmap */
|
||||
/* palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
|
||||
/* An enumeration type to describe the format of a bitmap palette, */
|
||||
/* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* ft_palette_mode_rgb :: The palette is an array of 3-bytes RGB */
|
||||
@@ -258,7 +258,7 @@ FT_BEGIN_HEADER
|
||||
/* most cases. */
|
||||
/* */
|
||||
/* num_grays :: This field is only used with */
|
||||
/* `FT_PIXEL_MODE_GRAY'; it gives the number of gray */
|
||||
/* @FT_PIXEL_MODE_GRAY; it gives the number of gray */
|
||||
/* levels used in the bitmap. */
|
||||
/* */
|
||||
/* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */
|
||||
@@ -313,16 +313,16 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* n_points :: The number of points in the outline. */
|
||||
/* */
|
||||
/* points :: A pointer to an array of `n_points' FT_Vector */
|
||||
/* points :: A pointer to an array of `n_points' @FT_Vector */
|
||||
/* elements, giving the outline's point coordinates. */
|
||||
/* */
|
||||
/* tags :: A pointer to an array of `n_points' chars, giving */
|
||||
/* each outline point's type. If bit 0 is unset, the */
|
||||
/* point is `off' the curve, i.e. a Bezier control */
|
||||
/* point is `off' the curve, i.e., a Bézier control */
|
||||
/* point, while it is `on' when set. */
|
||||
/* */
|
||||
/* Bit 1 is meaningful for `off' points only. If set, */
|
||||
/* it indicates a third-order Bezier arc control point; */
|
||||
/* it indicates a third-order Bézier arc control point; */
|
||||
/* and a second-order control point if unset. */
|
||||
/* */
|
||||
/* contours :: An array of `n_contours' shorts, giving the end */
|
||||
@@ -333,7 +333,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* flags :: A set of bit flags used to characterize the outline */
|
||||
/* and give hints to the scan-converter and hinter on */
|
||||
/* how to convert/grid-fit it. See FT_Outline_Flags. */
|
||||
/* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
|
||||
/* */
|
||||
typedef struct FT_Outline_
|
||||
{
|
||||
@@ -362,7 +362,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_OUTLINE_NONE :: Value 0 is reserved. */
|
||||
/* */
|
||||
/* FT_OUTLINE_OWNER :: If set, this flag indicates that the */
|
||||
/* outline's field arrays (i.e. */
|
||||
/* outline's field arrays (i.e., */
|
||||
/* `points', `flags' & `contours') are */
|
||||
/* `owned' by the outline object, and */
|
||||
/* should thus be freed when it is */
|
||||
@@ -486,8 +486,8 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_MoveToFunc)( FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_MoveToFunc)( const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
|
||||
|
||||
@@ -512,8 +512,8 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_LineToFunc)( FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_LineToFunc)( const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
|
||||
|
||||
@@ -526,7 +526,7 @@ FT_BEGIN_HEADER
|
||||
/* A function pointer type use to describe the signature of a `conic */
|
||||
/* to' function during outline walking/decomposition. */
|
||||
/* */
|
||||
/* A `conic to' is emitted to indicate a second-order Bezier arc in */
|
||||
/* A `conic to' is emitted to indicate a second-order Bézier arc in */
|
||||
/* the outline. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@@ -542,9 +542,9 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_ConicToFunc)( FT_Vector* control,
|
||||
FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_ConicToFunc)( const FT_Vector* control,
|
||||
const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
|
||||
|
||||
@@ -557,12 +557,12 @@ FT_BEGIN_HEADER
|
||||
/* A function pointer type used to describe the signature of a `cubic */
|
||||
/* to' function during outline walking/decomposition. */
|
||||
/* */
|
||||
/* A `cubic to' is emitted to indicate a third-order Bezier arc. */
|
||||
/* A `cubic to' is emitted to indicate a third-order Bézier arc. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* control1 :: A pointer to the first Bezier control point. */
|
||||
/* control1 :: A pointer to the first Bézier control point. */
|
||||
/* */
|
||||
/* control2 :: A pointer to the second Bezier control point. */
|
||||
/* control2 :: A pointer to the second Bézier control point. */
|
||||
/* */
|
||||
/* to :: A pointer to the target end point. */
|
||||
/* */
|
||||
@@ -573,10 +573,10 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_CubicToFunc)( FT_Vector* control1,
|
||||
FT_Vector* control2,
|
||||
FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_CubicToFunc)( const FT_Vector* control1,
|
||||
const FT_Vector* control2,
|
||||
const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
|
||||
|
||||
@@ -588,7 +588,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure to hold various function pointers used during outline */
|
||||
/* decomposition in order to emit segments, conic, and cubic Beziers, */
|
||||
/* decomposition in order to emit segments, conic, and cubic Béziers, */
|
||||
/* as well as `move to' and `close to' operations. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
@@ -596,9 +596,9 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* line_to :: The segment emitter. */
|
||||
/* */
|
||||
/* conic_to :: The second-order Bezier arc emitter. */
|
||||
/* conic_to :: The second-order Bézier arc emitter. */
|
||||
/* */
|
||||
/* cubic_to :: The third-order Bezier arc emitter. */
|
||||
/* cubic_to :: The third-order Bézier arc emitter. */
|
||||
/* */
|
||||
/* shift :: The shift that is applied to coordinates before they */
|
||||
/* are sent to the emitter. */
|
||||
@@ -611,8 +611,10 @@ FT_BEGIN_HEADER
|
||||
/* version of the original coordinates (this is important for high */
|
||||
/* accuracy during scan-conversion). The transformation is simple: */
|
||||
/* */
|
||||
/* { */
|
||||
/* x' = (x << shift) - delta */
|
||||
/* y' = (y << shift) - delta */
|
||||
/* y' = (x << shift) - delta */
|
||||
/* } */
|
||||
/* */
|
||||
/* Set the value of `shift' and `delta' to 0 to get the original */
|
||||
/* point coordinates. */
|
||||
@@ -644,14 +646,16 @@ FT_BEGIN_HEADER
|
||||
/* FT_IMAGE_TAG */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro converts four letter tags into an unsigned long. */
|
||||
/* This macro converts four-letter tags to an unsigned long type. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Since many 16bit compilers don't like 32bit enumerations, you */
|
||||
/* should redefine this macro in case of problems to something like */
|
||||
/* this: */
|
||||
/* */
|
||||
/* { */
|
||||
/* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
|
||||
/* } */
|
||||
/* */
|
||||
/* to get a simple enumeration without assigning special numbers. */
|
||||
/* */
|
||||
@@ -677,7 +681,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* FT_GLYPH_FORMAT_NONE :: */
|
||||
/* The value 0 is reserved and does describe a glyph format. */
|
||||
/* The value 0 is reserved. */
|
||||
/* */
|
||||
/* FT_GLYPH_FORMAT_COMPOSITE :: */
|
||||
/* The glyph image is a composite of several other images. This */
|
||||
@@ -690,13 +694,13 @@ FT_BEGIN_HEADER
|
||||
/* the @FT_GlyphSlotRec structure to read it. */
|
||||
/* */
|
||||
/* FT_GLYPH_FORMAT_OUTLINE :: */
|
||||
/* The glyph image is a vertorial outline made of line segments */
|
||||
/* and Bezier arcs; it can be described as an @FT_Outline; you */
|
||||
/* The glyph image is a vectorial outline made of line segments */
|
||||
/* and Bézier arcs; it can be described as an @FT_Outline; you */
|
||||
/* generally want to access the `outline' field of the */
|
||||
/* @FT_GlyphSlotRec structure to read it. */
|
||||
/* */
|
||||
/* FT_GLYPH_FORMAT_PLOTTER :: */
|
||||
/* The glyph image is a vectorial path with no inside/outside */
|
||||
/* The glyph image is a vectorial path with no inside and outside */
|
||||
/* contours. Some Type 1 fonts, like those in the Hershey family, */
|
||||
/* contain glyphs in this format. These are described as */
|
||||
/* @FT_Outline, but FreeType isn't currently capable of rendering */
|
||||
@@ -724,11 +728,11 @@ FT_BEGIN_HEADER
|
||||
/* @FT_Glyph_Format values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_glyph_format_none :: see @FT_GLYPH_FORMAT_NONE */
|
||||
/* ft_glyph_format_composite :: see @FT_GLYPH_FORMAT_COMPOSITE */
|
||||
/* ft_glyph_format_bitmap :: see @FT_GLYPH_FORMAT_BITMAP */
|
||||
/* ft_glyph_format_outline :: see @FT_GLYPH_FORMAT_OUTLINE */
|
||||
/* ft_glyph_format_plotter :: see @FT_GLYPH_FORMAT_PLOTTER */
|
||||
/* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */
|
||||
/* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */
|
||||
/* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */
|
||||
/* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */
|
||||
/* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */
|
||||
/* */
|
||||
#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
|
||||
#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
|
||||
@@ -809,11 +813,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This structure is used by the span drawing callback type named */
|
||||
/* FT_SpanFunc which takes the y-coordinate of the span as a */
|
||||
/* @FT_SpanFunc which takes the y-coordinate of the span as a */
|
||||
/* a parameter. */
|
||||
/* */
|
||||
/* The coverage value is always between 0 and 255, even if the number */
|
||||
/* of gray levels have been set through FT_Set_Gray_Levels(). */
|
||||
/* The coverage value is always between 0 and 255. */
|
||||
/* */
|
||||
typedef struct FT_Span_
|
||||
{
|
||||
@@ -851,20 +854,20 @@ FT_BEGIN_HEADER
|
||||
/* given background bitmap, and even perform translucency. */
|
||||
/* */
|
||||
/* Note that the `count' field cannot be greater than a fixed value */
|
||||
/* defined by the FT_MAX_GRAY_SPANS configuration macro in */
|
||||
/* ftoption.h. By default, this value is set to 32, which means that */
|
||||
/* if there are more than 32 spans on a given scanline, the callback */
|
||||
/* will be called several times with the same `y' parameter in order */
|
||||
/* to draw all callbacks. */
|
||||
/* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
|
||||
/* `ftoption.h'. By default, this value is set to 32, which means */
|
||||
/* that if there are more than 32 spans on a given scanline, the */
|
||||
/* callback is called several times with the same `y' parameter in */
|
||||
/* order to draw all callbacks. */
|
||||
/* */
|
||||
/* Otherwise, the callback is only called once per scan-line, and */
|
||||
/* only for those scanlines that do have `gray' pixels on them. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_SpanFunc)( int y,
|
||||
int count,
|
||||
FT_Span* spans,
|
||||
void* user );
|
||||
(*FT_SpanFunc)( int y,
|
||||
int count,
|
||||
const FT_Span* spans,
|
||||
void* user );
|
||||
|
||||
#define FT_Raster_Span_Func FT_SpanFunc
|
||||
|
||||
@@ -958,8 +961,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
|
||||
/* rendering mode. If set, the output will */
|
||||
/* be clipped to a box specified in the */
|
||||
/* "clip_box" field of the FT_Raster_Params */
|
||||
/* structure. */
|
||||
/* `clip_box' field of the */
|
||||
/* @FT_Raster_Params structure. */
|
||||
/* */
|
||||
/* Note that by default, the glyph bitmap */
|
||||
/* is clipped to the target pixmap, except */
|
||||
@@ -990,8 +993,8 @@ FT_BEGIN_HEADER
|
||||
/* <Fields> */
|
||||
/* target :: The target bitmap. */
|
||||
/* */
|
||||
/* source :: A pointer to the source glyph image (e.g. an */
|
||||
/* FT_Outline). */
|
||||
/* source :: A pointer to the source glyph image (e.g., an */
|
||||
/* @FT_Outline). */
|
||||
/* */
|
||||
/* flags :: The rendering flags. */
|
||||
/* */
|
||||
@@ -1012,11 +1015,11 @@ FT_BEGIN_HEADER
|
||||
/* 26.6 fixed-point units). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* An anti-aliased glyph bitmap is drawn if the FT_RASTER_FLAG_AA bit */
|
||||
/* flag is set in the `flags' field, otherwise a monochrome bitmap */
|
||||
/* will be generated. */
|
||||
/* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */
|
||||
/* bit flag is set in the `flags' field, otherwise a monochrome */
|
||||
/* bitmap is generated. */
|
||||
/* */
|
||||
/* If the FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
|
||||
/* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
|
||||
/* raster will call the `gray_spans' callback to draw gray pixel */
|
||||
/* spans, in the case of an aa glyph bitmap, it will call */
|
||||
/* `black_spans', and `bit_test' and `bit_set' in the case of a */
|
||||
@@ -1063,9 +1066,9 @@ FT_BEGIN_HEADER
|
||||
/* <Note> */
|
||||
/* The `memory' parameter is a typeless pointer in order to avoid */
|
||||
/* un-wanted dependencies on the rest of the FreeType code. In */
|
||||
/* practice, it is a FT_Memory, i.e., a handle to the standard */
|
||||
/* FreeType memory allocator. However, this field can be completely */
|
||||
/* ignored by a given raster implementation. */
|
||||
/* practice, it is an @FT_Memory object, i.e., a handle to the */
|
||||
/* standard FreeType memory allocator. However, this field can be */
|
||||
/* completely ignored by a given raster implementation. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Raster_NewFunc)( void* memory,
|
||||
@@ -1160,31 +1163,31 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* raster :: A handle to the raster object. */
|
||||
/* */
|
||||
/* params :: A pointer to a FT_Raster_Params structure used to store */
|
||||
/* the rendering parameters. */
|
||||
/* params :: A pointer to an @FT_Raster_Params structure used to */
|
||||
/* store the rendering parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The exact format of the source image depends on the raster's glyph */
|
||||
/* format defined in its FT_Raster_Funcs structure. It can be an */
|
||||
/* FT_Outline or anything else in order to support a large array of */
|
||||
/* format defined in its @FT_Raster_Funcs structure. It can be an */
|
||||
/* @FT_Outline or anything else in order to support a large array of */
|
||||
/* glyph formats. */
|
||||
/* */
|
||||
/* Note also that the render function can fail and return a */
|
||||
/* FT_Err_Unimplemented_Feature error code if the raster used does */
|
||||
/* `FT_Err_Unimplemented_Feature' error code if the raster used does */
|
||||
/* not support direct composition. */
|
||||
/* */
|
||||
/* XXX: For now, the standard raster doesn't support direct */
|
||||
/* composition but this should change for the final release (see */
|
||||
/* the files demos/src/ftgrays.c and demos/src/ftgrays2.c for */
|
||||
/* examples of distinct implementations which support direct */
|
||||
/* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
|
||||
/* for examples of distinct implementations which support direct */
|
||||
/* composition). */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Raster_RenderFunc)( FT_Raster raster,
|
||||
FT_Raster_Params* params );
|
||||
(*FT_Raster_RenderFunc)( FT_Raster raster,
|
||||
const FT_Raster_Params* params );
|
||||
|
||||
#define FT_Raster_Render_Func FT_Raster_RenderFunc
|
||||
|
||||
@@ -1228,3 +1231,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType incremental loading (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* Copyright 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -31,6 +31,33 @@
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* incremental
|
||||
*
|
||||
* @title:
|
||||
* Incremental Loading
|
||||
*
|
||||
* @abstract:
|
||||
* Custom Glyph Loading.
|
||||
*
|
||||
* @description:
|
||||
* This section contains various functions used to perform so-called
|
||||
* `incremental' glyph loading. This is a mode where all glyphs loaded
|
||||
* from a given @FT_Face are provided by the client application,
|
||||
*
|
||||
* Apart from that, all other tables are loaded normally from the font
|
||||
* file. This mode is useful when FreeType is used within another
|
||||
* engine, e.g., a Postscript Imaging Processor.
|
||||
*
|
||||
* To enable this mode, you must use @FT_Open_Face, passing an
|
||||
* @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
|
||||
* @FT_Incremental_Interface value. See the comments for
|
||||
* @FT_Incremental_InterfaceRec for an example.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
@@ -39,8 +66,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* An opaque type describing a user-provided object used to implement
|
||||
* "incremental" glyph loading within FreeType. This is used to support
|
||||
* embedded fonts in certain environments (e.g. Postscript interpreters),
|
||||
* `incremental' glyph loading within FreeType. This is used to support
|
||||
* embedded fonts in certain environments (e.g., Postscript interpreters),
|
||||
* where the glyph data isn't in the font file, or must be overridden by
|
||||
* different values.
|
||||
*
|
||||
@@ -77,7 +104,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* These correspond to horizontal or vertical metrics depending on the
|
||||
* value of the 'vertical' argument to the function
|
||||
* value of the `vertical' argument to the function
|
||||
* @FT_Incremental_GetGlyphMetricsFunc.
|
||||
*/
|
||||
typedef struct FT_Incremental_MetricsRec_
|
||||
@@ -101,8 +128,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* Note that the format of the glyph's data bytes depends on the font
|
||||
* file format. For TrueType, it must correspond to the raw bytes within
|
||||
* the 'glyf' table. For Postscript formats, it must correspond to the
|
||||
* *unencrypted* charstring bytes, without any 'lenIV' header. It is
|
||||
* the `glyf' table. For Postscript formats, it must correspond to the
|
||||
* *unencrypted* charstring bytes, without any `lenIV' header. It is
|
||||
* undefined for any other format.
|
||||
*
|
||||
* @input:
|
||||
@@ -270,6 +297,18 @@ FT_BEGIN_HEADER
|
||||
} FT_Incremental_InterfaceRec;
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Incremental_Interface
|
||||
*
|
||||
* @description:
|
||||
* A pointer to an @FT_Incremental_InterfaceRec structure.
|
||||
*
|
||||
*/
|
||||
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* @constant:
|
||||
|
||||
@@ -174,12 +174,12 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An FT_List iterator function which is called during a list parse */
|
||||
/* by FT_List_Iterate(). */
|
||||
/* by @FT_List_Iterate. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* node :: The current iteration list node. */
|
||||
/* */
|
||||
/* user :: A typeless pointer passed to FT_List_Iterate(). */
|
||||
/* user :: A typeless pointer passed to @FT_List_Iterate. */
|
||||
/* Can be used to point to the iteration's state. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
@@ -219,8 +219,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_List_Destructor */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An FT_List iterator function which is called during a list */
|
||||
/* finalization by FT_List_Finalize() to destroy all elements in a */
|
||||
/* An @FT_List iterator function which is called during a list */
|
||||
/* finalization by @FT_List_Finalize to destroy all elements in a */
|
||||
/* given list. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@@ -228,7 +228,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* data :: The current object to destroy. */
|
||||
/* */
|
||||
/* user :: A typeless pointer passed to FT_List_Iterate(). It can */
|
||||
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */
|
||||
/* be used to point to the iteration's state. */
|
||||
/* */
|
||||
typedef void
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* LZW-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -54,7 +54,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse LZW-compressed font files. This is
|
||||
* mainly used to support the compressed *.pcf.Z fonts that come
|
||||
* mainly used to support the compressed `*.pcf.Z' fonts that come
|
||||
* with XFree86.
|
||||
*
|
||||
* @input:
|
||||
@@ -68,8 +68,8 @@ FT_BEGIN_HEADER
|
||||
* @note:
|
||||
* The source stream must be opened _before_ calling this function.
|
||||
*
|
||||
* Calling the internal function FT_Stream_Close on the new stream will
|
||||
* *not* call FT_Stream_Close on the source stream. None of the stream
|
||||
* Calling the internal function `FT_Stream_Close' on the new stream will
|
||||
* *not* call `FT_Stream_Close' on the source stream. None of the stream
|
||||
* objects will be released to the heap.
|
||||
*
|
||||
* The stream implementation is very basic and resets the decompression
|
||||
@@ -81,8 +81,8 @@ FT_BEGIN_HEADER
|
||||
* compressed file, the library will try to open a LZW stream from it
|
||||
* and re-open the face with it.
|
||||
*
|
||||
* This function may return "FT_Err_Unimplemented" if your build of
|
||||
* FreeType was not compiled with LZW support.
|
||||
* This function may return `FT_Err_Unimplemented_Feature' if your build
|
||||
* of FreeType was not compiled with LZW support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stream_OpenLZW( FT_Stream stream,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Additional Mac-specific API. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2004 by */
|
||||
/* Copyright 1996-2001, 2004, 2006 by */
|
||||
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -59,13 +59,13 @@ FT_BEGIN_HEADER
|
||||
/* FT_New_Face_From_FOND */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new face object from an FOND resource. */
|
||||
/* Create a new face object from a FOND resource. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to the library resource. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* fond :: An FOND resource. */
|
||||
/* fond :: A FOND resource. */
|
||||
/* */
|
||||
/* face_index :: Only supported for the -1 `sanity check' special */
|
||||
/* case. */
|
||||
@@ -77,8 +77,8 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Notes> */
|
||||
/* This function can be used to create FT_Face abjects from fonts */
|
||||
/* that are installed in the system like so: */
|
||||
/* This function can be used to create @FT_Face objects from fonts */
|
||||
/* that are installed in the system as follows. */
|
||||
/* */
|
||||
/* { */
|
||||
/* fond = GetResource( 'FOND', fontName ); */
|
||||
@@ -98,10 +98,11 @@ FT_BEGIN_HEADER
|
||||
/* FT_GetFile_From_Mac_Name */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns an FSSpec for the disk file containing the named font. */
|
||||
/* Return an FSSpec for the disk file containing the named font. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* fontName :: Mac OS name of the font (eg. Times New Roman Bold). */
|
||||
/* fontName :: Mac OS name of the font (e.g., Times New Roman */
|
||||
/* Bold). */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* pathSpec :: FSSpec to the file. For passing to @FT_New_Face. */
|
||||
@@ -112,18 +113,43 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GetFile_From_Mac_Name( const char* fontName,
|
||||
FT_GetFile_From_Mac_Name( const char* fontName,
|
||||
FSSpec* pathSpec,
|
||||
FT_Long* face_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_GetFile_From_Mac_ATS_Name */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return an FSSpec for the disk file containing the named font. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* fontName :: Mac OS name of the font in ATS framework. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* pathSpec :: FSSpec to the file. For passing to @FT_New_Face. */
|
||||
/* */
|
||||
/* face_index :: Index of the face. For passing to @FT_New_Face. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
|
||||
FSSpec* pathSpec,
|
||||
FT_Long* face_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Face_From_FSSpec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new face object from a given resource and typeface index */
|
||||
/* Create a new face object from a given resource and typeface index */
|
||||
/* using an FSSpec to the font file. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
@@ -150,6 +176,40 @@ FT_BEGIN_HEADER
|
||||
FT_Long face_index,
|
||||
FT_Face *aface );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Face_From_FSRef */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Create a new face object from a given resource and typeface index */
|
||||
/* using an FSRef to the font file. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to the library resource. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* spec :: FSRef to the font file. */
|
||||
/* */
|
||||
/* face_index :: The index of the face within the resource. The */
|
||||
/* first face has index 0. */
|
||||
/* <Output> */
|
||||
/* aface :: A handle to a new face object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
|
||||
/* it accepts an FSRef instead of a path. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_New_Face_From_FSRef( FT_Library library,
|
||||
const FSRef *ref,
|
||||
FT_Long face_index,
|
||||
FT_Face *aface );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType Multiple Master font interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -40,11 +40,11 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The following types and functions are used to manage Multiple */
|
||||
/* Master fonts, i.e. the selection of specific design instances by */
|
||||
/* Master fonts, i.e., the selection of specific design instances by */
|
||||
/* setting design axis coordinates. */
|
||||
/* */
|
||||
/* George Williams has extended this interface to make it work with */
|
||||
/* both Type 1 Multiple Masters fonts, and GX distortable (var) */
|
||||
/* both Type 1 Multiple Masters fonts and GX distortable (var) */
|
||||
/* fonts. Some of these routines only work with MM fonts, others */
|
||||
/* will work with both types. They are similar enough that a */
|
||||
/* consistent interface makes sense. */
|
||||
@@ -93,7 +93,7 @@ FT_BEGIN_HEADER
|
||||
/* <Fields> */
|
||||
/* num_axis :: Number of axes. Cannot exceed 4. */
|
||||
/* */
|
||||
/* num_designs :: Number of designs; should ne normally 2^num_axis */
|
||||
/* num_designs :: Number of designs; should be normally 2^num_axis */
|
||||
/* even though the Type 1 specification strangely */
|
||||
/* allows for intermediate designs to be present. This */
|
||||
/* number cannot exceed 16. */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType modules public interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -84,7 +84,7 @@ FT_BEGIN_HEADER
|
||||
typedef void
|
||||
(*FT_Module_Destructor)( FT_Module module );
|
||||
|
||||
typedef FT_Module_Interface
|
||||
typedef FT_Module_Interface
|
||||
(*FT_Module_Requester)( FT_Module module,
|
||||
const char* name );
|
||||
|
||||
@@ -98,27 +98,28 @@ FT_BEGIN_HEADER
|
||||
/* The module class descriptor. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* module_flags :: Bit flags describing the module. */
|
||||
/* module_flags :: Bit flags describing the module. */
|
||||
/* */
|
||||
/* module_size :: The size of one module object/instance in */
|
||||
/* bytes. */
|
||||
/* module_size :: The size of one module object/instance in */
|
||||
/* bytes. */
|
||||
/* */
|
||||
/* module_name :: The name of the module. */
|
||||
/* module_name :: The name of the module. */
|
||||
/* */
|
||||
/* module_version :: The version, as a 16.16 fixed number */
|
||||
/* (major.minor). */
|
||||
/* module_version :: The version, as a 16.16 fixed number */
|
||||
/* (major.minor). */
|
||||
/* */
|
||||
/* module_requires :: The version of FreeType this module requires */
|
||||
/* (starts at version 2.0, i.e 0x20000) */
|
||||
/* module_requires :: The version of FreeType this module requires, */
|
||||
/* as a 16.16 fixed number (major.minor). Starts */
|
||||
/* at version 2.0, i.e., 0x20000. */
|
||||
/* */
|
||||
/* module_init :: A function used to initialize (not create) a */
|
||||
/* new module object. */
|
||||
/* module_init :: A function used to initialize (not create) a */
|
||||
/* new module object. */
|
||||
/* */
|
||||
/* module_done :: A function used to finalize (not destroy) a */
|
||||
/* given module object */
|
||||
/* module_done :: A function used to finalize (not destroy) a */
|
||||
/* given module object */
|
||||
/* */
|
||||
/* get_interface :: Queries a given module for a specific */
|
||||
/* interface by name. */
|
||||
/* get_interface :: Queries a given module for a specific */
|
||||
/* interface by name. */
|
||||
/* */
|
||||
typedef struct FT_Module_Class_
|
||||
{
|
||||
@@ -180,8 +181,8 @@ FT_BEGIN_HEADER
|
||||
/* A module handle. 0 if none was found. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should better be familiar with FreeType internals to know */
|
||||
/* which module to look for :-) */
|
||||
/* FreeType's internal modules aren't documented very well, and you */
|
||||
/* should look up the source code for details. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Module )
|
||||
FT_Get_Module( FT_Library library,
|
||||
@@ -255,7 +256,7 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Done_Library( FT_Library library );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
typedef void
|
||||
(*FT_DebugHook_Func)( void* arg );
|
||||
@@ -275,8 +276,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hook_index :: The index of the debug hook. You should use the */
|
||||
/* values defined in ftobjs.h, e.g. */
|
||||
/* FT_DEBUG_HOOK_TRUETYPE. */
|
||||
/* values defined in `ftobjs.h', e.g., */
|
||||
/* `FT_DEBUG_HOOK_TRUETYPE'. */
|
||||
/* */
|
||||
/* debug_hook :: The function used to debug the interpreter. */
|
||||
/* */
|
||||
@@ -284,13 +285,16 @@ FT_BEGIN_HEADER
|
||||
/* Currently, four debug hook slots are available, but only two (for */
|
||||
/* the TrueType and the Type 1 interpreter) are defined. */
|
||||
/* */
|
||||
/* Since the internal headers of FreeType are no longer installed, */
|
||||
/* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
|
||||
/* This is a bug and will be fixed in a forthcoming release. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Set_Debug_Hook( FT_Library library,
|
||||
FT_UInt hook_index,
|
||||
FT_DebugHook_Func debug_hook );
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
@@ -299,7 +303,7 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* Adds the set of default drivers to a given library object. */
|
||||
/* This is only useful when you create a library object with */
|
||||
/* FT_New_Library() (usually to plug a custom memory manager). */
|
||||
/* @FT_New_Library (usually to plug a custom memory manager). */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to a new library object. */
|
||||
@@ -308,6 +312,89 @@ FT_BEGIN_HEADER
|
||||
FT_Add_Default_Modules( FT_Library library );
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* ttengine
|
||||
*
|
||||
* @title:
|
||||
* The TrueType Engine
|
||||
*
|
||||
* @abstract:
|
||||
* TrueType bytecode support.
|
||||
*
|
||||
* @description:
|
||||
* This section contains a function used to query the level of TrueType
|
||||
* bytecode support compiled in this version of the library.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_TrueTypeEngineType
|
||||
*
|
||||
* @description:
|
||||
* A list of values describing which kind of TrueType bytecode
|
||||
* engine is implemented in a given FT_Library instance. It is used
|
||||
* by the @FT_Get_TrueType_Engine_Type function.
|
||||
*
|
||||
* @values:
|
||||
* FT_TRUETYPE_ENGINE_TYPE_NONE ::
|
||||
* The library doesn't implement any kind of bytecode interpreter.
|
||||
*
|
||||
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
|
||||
* The library implements a bytecode interpreter that doesn't
|
||||
* support the patented operations of the TrueType virtual machine.
|
||||
*
|
||||
* Its main use is to load certain Asian fonts which position and
|
||||
* scale glyph components with bytecode instructions. It produces
|
||||
* bad output for most other fonts.
|
||||
*
|
||||
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
|
||||
* The library implements a bytecode interpreter that covers
|
||||
* the full instruction set of the TrueType virtual machine.
|
||||
* See the file `docs/PATENTS' for legal aspects.
|
||||
*
|
||||
* @since:
|
||||
* 2.2
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
|
||||
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
|
||||
FT_TRUETYPE_ENGINE_TYPE_PATENTED
|
||||
|
||||
} FT_TrueTypeEngineType;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @func:
|
||||
* FT_Get_TrueType_Engine_Type
|
||||
*
|
||||
* @description:
|
||||
* Return a @FT_TrueTypeEngineType value to indicate which level of
|
||||
* the TrueType virtual machine a given library instance supports.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A library instance.
|
||||
*
|
||||
* @return:
|
||||
* A value indicating which level is supported.
|
||||
*
|
||||
* @since:
|
||||
* 2.2
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_TrueTypeEngineType )
|
||||
FT_Get_TrueType_Engine_Type( FT_Library library );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for validating OpenType tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005 by */
|
||||
/* Copyright 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_XXX
|
||||
* FT_VALIDATE_OTXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_OpenType_Validate to
|
||||
@@ -121,7 +121,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the tables to be validated. See
|
||||
* @FT_VALIDATE_XXX for possible values.
|
||||
* @FT_VALIDATE_OTXXX for possible values.
|
||||
*
|
||||
* @output:
|
||||
* BASE_table ::
|
||||
@@ -147,8 +147,9 @@ FT_BEGIN_HEADER
|
||||
* otherwise.
|
||||
*
|
||||
* After use, the application should deallocate the five tables with
|
||||
* `free'. A NULL value indicates that the table either doesn't exist
|
||||
* in the font, or the application hasn't asked for validation.
|
||||
* @FT_OpenType_Free. A NULL value indicates that the table either
|
||||
* doesn't exist in the font, or the application hasn't asked for
|
||||
* validation.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_OpenType_Validate( FT_Face face,
|
||||
@@ -159,6 +160,33 @@ FT_BEGIN_HEADER
|
||||
FT_Bytes *GSUB_table,
|
||||
FT_Bytes *JSTF_table );
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_OpenType_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by OpenType validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer that is allocated by
|
||||
* @FT_OpenType_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_OpenType_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_OpenType_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Support for the FT_Outline type used to store glyph shapes of */
|
||||
/* most scalable font formats (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -85,7 +85,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Walks over an outline's structure to decompose it into individual */
|
||||
/* segments and Bezier arcs. This function is also able to emit */
|
||||
/* segments and Bézier arcs. This function is also able to emit */
|
||||
/* `move to' and `close to' operations to indicate the start and end */
|
||||
/* of new contours in the outline. */
|
||||
/* */
|
||||
@@ -122,8 +122,8 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object from where the */
|
||||
/* outline is allocated. Note however that the new */
|
||||
/* outline will NOT necessarily be FREED, when */
|
||||
/* destroying the library, by FT_Done_FreeType(). */
|
||||
/* outline will *not* necessarily be *freed*, when */
|
||||
/* destroying the library, by @FT_Done_FreeType. */
|
||||
/* */
|
||||
/* numPoints :: The maximal number of points within the outline. */
|
||||
/* */
|
||||
@@ -160,7 +160,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Outline_Done */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys an outline created with FT_Outline_New(). */
|
||||
/* Destroys an outline created with @FT_Outline_New. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle of the library object used to allocate the */
|
||||
@@ -176,7 +176,7 @@ FT_BEGIN_HEADER
|
||||
/* descriptor will be released. */
|
||||
/* */
|
||||
/* The reason why this function takes an `library' parameter is */
|
||||
/* simply to use FT_Free(). */
|
||||
/* simply to use ft_mem_free(). */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Done( FT_Library library,
|
||||
@@ -213,10 +213,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns an outline's `control box'. The control box encloses all */
|
||||
/* the outline's points, including Bezier control points. Though it */
|
||||
/* the outline's points, including Bézier control points. Though it */
|
||||
/* coincides with the exact bounding box for most glyphs, it can be */
|
||||
/* slightly larger in some situations (like when rotating an outline */
|
||||
/* which contains Bezier outside arcs). */
|
||||
/* which contains Bézier outside arcs). */
|
||||
/* */
|
||||
/* Computing the control box is very fast, while getting the bounding */
|
||||
/* box can take much more time as it needs to walk over all segments */
|
||||
@@ -296,7 +296,7 @@ FT_BEGIN_HEADER
|
||||
/* matrix :: A pointer to the transformation matrix. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You can use FT_Outline_Translate() if you need to translate the */
|
||||
/* You can use @FT_Outline_Translate if you need to translate the */
|
||||
/* outline's points. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
@@ -314,6 +314,9 @@ FT_BEGIN_HEADER
|
||||
/* `strength' pixels wider and higher. You may think of the left and */
|
||||
/* bottom borders as unchanged. */
|
||||
/* */
|
||||
/* Negative `strength' values to reduce the outline thickness are */
|
||||
/* possible also. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* outline :: A handle to the target outline. */
|
||||
/* */
|
||||
@@ -324,7 +327,21 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
/* <Note> */
|
||||
/* The used algorithm to increase or decrease the thickness of the */
|
||||
/* glyph doesn't change the number of points; this means that certain */
|
||||
/* situations like acute angles or intersections are sometimes */
|
||||
/* handled incorrectly. */
|
||||
/* */
|
||||
/* Example call: */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
|
||||
/* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
|
||||
/* FT_Outline_Embolden( &face->slot->outline, strength ); */
|
||||
/* } */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Embolden( FT_Outline* outline,
|
||||
FT_Pos strength );
|
||||
|
||||
@@ -342,7 +359,7 @@ FT_BEGIN_HEADER
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This functions toggles the bit flag `FT_OUTLINE_REVERSE_FILL' in */
|
||||
/* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
|
||||
/* the outline's `flags' field. */
|
||||
/* */
|
||||
/* It shouldn't be used by a normal client application, unless it */
|
||||
@@ -366,7 +383,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* <InOut> */
|
||||
/* abitmap :: A pointer to the target bitmap descriptor. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
@@ -391,7 +408,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Renders an outline within a bitmap using the current scan-convert. */
|
||||
/* This functions uses an FT_Raster_Params structure as an argument, */
|
||||
/* This functions uses an @FT_Raster_Params structure as an argument, */
|
||||
/* allowing advanced features like direct composition, translucency, */
|
||||
/* etc. */
|
||||
/* */
|
||||
@@ -401,14 +418,14 @@ FT_BEGIN_HEADER
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* params :: A pointer to a FT_Raster_Params structure used to */
|
||||
/* params :: A pointer to an @FT_Raster_Params structure used to */
|
||||
/* describe the rendering operation. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should know what you are doing and how FT_Raster_Params works */
|
||||
/* You should know what you are doing and how @FT_Raster_Params works */
|
||||
/* to use this function. */
|
||||
/* */
|
||||
/* The field `params.source' will be set to `outline' before the scan */
|
||||
@@ -450,13 +467,19 @@ FT_BEGIN_HEADER
|
||||
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
|
||||
* remember that in Postscript, everything that is to the left of
|
||||
* the drawing direction of a contour must be filled.
|
||||
*
|
||||
* FT_ORIENTATION_NONE ::
|
||||
* The orientation cannot be determined. That is, different parts of
|
||||
* the glyph have different orientation.
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_ORIENTATION_TRUETYPE = 0,
|
||||
FT_ORIENTATION_POSTSCRIPT = 1,
|
||||
FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
|
||||
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT
|
||||
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
|
||||
FT_ORIENTATION_NONE
|
||||
|
||||
} FT_Orientation;
|
||||
|
||||
@@ -496,3 +519,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing PFR-specific data (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -154,7 +154,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
|
||||
* to convert the advance to device sub-pixels (i.e. 1/64th of pixels).
|
||||
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_PFR_Advance( FT_Face face,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType renderer modules public interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2005 by */
|
||||
/* Copyright 1996-2001, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -46,9 +46,9 @@ FT_BEGIN_HEADER
|
||||
(*FT_Glyph_DoneFunc)( FT_Glyph glyph );
|
||||
|
||||
typedef void
|
||||
(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta );
|
||||
(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
|
||||
const FT_Matrix* matrix,
|
||||
const FT_Vector* delta );
|
||||
|
||||
typedef void
|
||||
(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
|
||||
@@ -85,16 +85,16 @@ FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt mode,
|
||||
FT_Vector* origin );
|
||||
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt mode,
|
||||
const FT_Vector* origin );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta );
|
||||
(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
const FT_Matrix* matrix,
|
||||
const FT_Vector* delta );
|
||||
|
||||
|
||||
typedef void
|
||||
@@ -124,7 +124,7 @@ FT_BEGIN_HEADER
|
||||
/* The renderer module class descriptor. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The root FT_Module_Class fields. */
|
||||
/* root :: The root @FT_Module_Class fields. */
|
||||
/* */
|
||||
/* glyph_format :: The glyph image format this renderer handles. */
|
||||
/* */
|
||||
@@ -133,10 +133,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* set_mode :: A method used to pass additional parameters. */
|
||||
/* */
|
||||
/* raster_class :: For `FT_GLYPH_FORMAT_OUTLINE' renderers only, this */
|
||||
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
|
||||
/* is a pointer to its raster's class. */
|
||||
/* */
|
||||
/* raster :: For `FT_GLYPH_FORMAT_OUTLINE' renderers only. this */
|
||||
/* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
|
||||
/* is a pointer to the corresponding raster object, */
|
||||
/* if any. */
|
||||
/* */
|
||||
@@ -176,8 +176,8 @@ FT_BEGIN_HEADER
|
||||
/* An error will be returned if a module already exists by that name, */
|
||||
/* or if the module requires a version of FreeType that is too great. */
|
||||
/* */
|
||||
/* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
|
||||
/* renderer by its name, use FT_Get_Module(). */
|
||||
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
|
||||
/* renderer by its name, use @FT_Get_Module. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Renderer )
|
||||
FT_Get_Renderer( FT_Library library,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType size objects management (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -54,9 +54,9 @@ FT_BEGIN_HEADER
|
||||
/* Managing multiple sizes per face. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* When creating a new face object (e.g. with @FT_New_Face), an */
|
||||
/* When creating a new face object (e.g., with @FT_New_Face), an */
|
||||
/* @FT_Size object is automatically created and used to store all */
|
||||
/* pixel-size dependent information, available in the "face->size" */
|
||||
/* pixel-size dependent information, available in the `face->size' */
|
||||
/* field. */
|
||||
/* */
|
||||
/* It is however possible to create more sizes for a given face, */
|
||||
@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
|
||||
/* same font family and style. See @FT_New_Size and @FT_Done_Size. */
|
||||
/* */
|
||||
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
|
||||
/* modify the contents of the current "active" size; you thus need */
|
||||
/* modify the contents of the current `active' size; you thus need */
|
||||
/* to use @FT_Activate_Size to change it. */
|
||||
/* */
|
||||
/* 99% of applications won't need the functions provided here, */
|
||||
@@ -80,7 +80,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_New_Size */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new size object from a given face object. */
|
||||
/* Create a new size object from a given face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to a parent face object. */
|
||||
@@ -107,7 +107,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Done_Size */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Discards a given size object. Note that @FT_Done_Face */
|
||||
/* Discard a given size object. Note that @FT_Done_Face */
|
||||
/* automatically discards all size objects allocated with */
|
||||
/* @FT_New_Size. */
|
||||
/* */
|
||||
@@ -130,9 +130,9 @@ FT_BEGIN_HEADER
|
||||
/* Even though it is possible to create several size objects for a */
|
||||
/* given face (see @FT_New_Size for details), functions like */
|
||||
/* @FT_Load_Glyph or @FT_Load_Char only use the last-created one to */
|
||||
/* determine the "current character pixel size". */
|
||||
/* determine the `current character pixel size'. */
|
||||
/* */
|
||||
/* This function can be used to "activate" a previously created size */
|
||||
/* This function can be used to `activate' a previously created size */
|
||||
/* object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@@ -142,8 +142,8 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* If "face" is the size's parent face object, this function changes */
|
||||
/* the value of "face->size" to the input size handle. */
|
||||
/* If `face' is the size's parent face object, this function changes */
|
||||
/* the value of `face->size' to the input size handle. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Activate_Size( FT_Size size );
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/* */
|
||||
/* This is _not_ used to retrieve glyph names! */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -78,12 +78,12 @@ FT_BEGIN_HEADER
|
||||
/* 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.. */
|
||||
/* 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.. */
|
||||
/* zero-terminated. Please refer to the TrueType */
|
||||
/* specification for details. */
|
||||
/* */
|
||||
/* string_len :: The length of `string' in bytes. */
|
||||
/* */
|
||||
@@ -92,6 +92,9 @@ FT_BEGIN_HEADER
|
||||
/* and `name_id' are given in the file `ttnameid.h'. For details */
|
||||
/* please refer to the TrueType or OpenType specification. */
|
||||
/* */
|
||||
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
|
||||
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
|
||||
/* */
|
||||
typedef struct FT_SfntName_
|
||||
{
|
||||
FT_UShort platform_id;
|
||||
@@ -137,7 +140,7 @@ FT_BEGIN_HEADER
|
||||
/* idx :: The index of the `name' string. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aname :: The indexed FT_SfntName structure. */
|
||||
/* aname :: The indexed @FT_SfntName structure. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
@@ -146,7 +149,7 @@ FT_BEGIN_HEADER
|
||||
/* 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 */
|
||||
/* 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. */
|
||||
/* */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType path stroker (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -29,16 +29,16 @@ FT_BEGIN_HEADER
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* <Section>
|
||||
* @section:
|
||||
* glyph_stroker
|
||||
*
|
||||
* <Title>
|
||||
* @title:
|
||||
* Glyph Stroker
|
||||
*
|
||||
* <Abstract>
|
||||
* @abstract:
|
||||
* Generating bordered and stroked glyphs.
|
||||
*
|
||||
* <Description>
|
||||
* @description:
|
||||
* This component generates stroked outlines of a given vectorial
|
||||
* glyph. It also allows you to retrieve the `outside' and/or the
|
||||
* `inside' borders of the stroke.
|
||||
@@ -142,8 +142,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* Applications are generally interested in the `inside' and `outside'
|
||||
* borders. However, there is no direct mapping between these and
|
||||
* the `left' / `right' ones, since this really depends on the glyph's
|
||||
* borders. However, there is no direct mapping between these and the
|
||||
* `left' and `right' ones, since this really depends on the glyph's
|
||||
* drawing orientation, which varies between font formats.
|
||||
*
|
||||
* You can however use @FT_Outline_GetInsideBorder and
|
||||
@@ -208,17 +208,18 @@ FT_BEGIN_HEADER
|
||||
* Create a new stroker object.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* The memory manager handle.
|
||||
* library ::
|
||||
* FreeType library handle.
|
||||
*
|
||||
* @output:
|
||||
* A new stroker object handle. NULL in case of error.
|
||||
* astroker ::
|
||||
* A new stroker object handle. NULL in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_New( FT_Memory memory,
|
||||
FT_Stroker_New( FT_Library library,
|
||||
FT_Stroker *astroker );
|
||||
|
||||
|
||||
@@ -340,7 +341,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* This function is useful when you need to stroke a path that is
|
||||
* not stored as a @FT_Outline object.
|
||||
* not stored as an @FT_Outline object.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_BeginSubPath( FT_Stroker stroker,
|
||||
@@ -406,7 +407,7 @@ FT_BEGIN_HEADER
|
||||
* FT_Stroker_ConicTo
|
||||
*
|
||||
* @description:
|
||||
* `Draw; a single quadratic bezier in the stroker's current sub-path,
|
||||
* `Draw' a single quadratic Bézier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
@@ -414,7 +415,7 @@ FT_BEGIN_HEADER
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control ::
|
||||
* A pointer to a Bézier control point.
|
||||
* A pointer to a Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
@@ -438,7 +439,7 @@ FT_BEGIN_HEADER
|
||||
* FT_Stroker_CubicTo
|
||||
*
|
||||
* @description:
|
||||
* `Draw' a single cubic Bézier in the stroker's current sub-path,
|
||||
* `Draw' a single cubic Bézier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
@@ -446,10 +447,10 @@ FT_BEGIN_HEADER
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control1 ::
|
||||
* A pointer to the first Bézier control point.
|
||||
* A pointer to the first Bézier control point.
|
||||
*
|
||||
* control2 ::
|
||||
* A pointer to second Bézier control point.
|
||||
* A pointer to second Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
@@ -474,7 +475,7 @@ FT_BEGIN_HEADER
|
||||
* FT_Stroker_GetBorderCounts
|
||||
*
|
||||
* @description:
|
||||
* Vall this function once you have finished parsing your paths
|
||||
* Call this function once you have finished parsing your paths
|
||||
* with the stroker. It will return the number of points and
|
||||
* contours necessary to export one of the `border' or `stroke'
|
||||
* outlines generated by the stroker.
|
||||
@@ -640,8 +641,8 @@ FT_BEGIN_HEADER
|
||||
* Stroke a given outline glyph object with a given stroker.
|
||||
*
|
||||
* @inout:
|
||||
* pglyph :: Source glyph handle on input, new glyph handle
|
||||
* on output.
|
||||
* pglyph ::
|
||||
* Source glyph handle on input, new glyph handle on output.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
@@ -708,3 +709,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* FreeType synthesizing code for emboldening and slanting */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* Copyright 2000-2001, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -50,10 +50,12 @@
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/* Make sure slot owns slot->bitmap. */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
|
||||
|
||||
/* This code is completely experimental -- use with care! */
|
||||
/* It will probably be completely rewritten in the future */
|
||||
/* or even integrated into the library. */
|
||||
/* Do not use this function directly! Copy the code to */
|
||||
/* your application and modify it to suit your need. */
|
||||
FT_EXPORT( void )
|
||||
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
#ifndef __FT_SYSTEM_IO_H__
|
||||
#define __FT_SYSTEM_IO_H__
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/***** *****/
|
||||
/***** NOTE: THE CONTENT OF THIS FILE IS NOT CURRENTLY USED *****/
|
||||
/***** IN NORMAL BUILDS. CONSIDER IT EXPERIMENTAL. *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* designing custom streams is a bit different now
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECT_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @type: FT_Stream
|
||||
*
|
||||
* @description:
|
||||
* handle to an input stream object. These are also @FT_Object handles
|
||||
*/
|
||||
typedef struct FT_StreamRec_* FT_Stream;
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @type: FT_Stream_Class
|
||||
*
|
||||
* @description:
|
||||
* opaque handle to a @FT_Stream_ClassRec class structure describing
|
||||
* the methods of input streams
|
||||
*/
|
||||
typedef const struct FT_Stream_ClassRec_* FT_Stream_Class;
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @functype: FT_Stream_ReadFunc
|
||||
*
|
||||
* @description:
|
||||
* a method used to read bytes from an input stream into memory
|
||||
*
|
||||
* @input:
|
||||
* stream :: target stream handle
|
||||
* buffer :: target buffer address
|
||||
* size :: number of bytes to read
|
||||
*
|
||||
* @return:
|
||||
* number of bytes effectively read. Must be <= 'size'.
|
||||
*/
|
||||
typedef FT_ULong (*FT_Stream_ReadFunc)( FT_Stream stream,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong size );
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @functype: FT_Stream_SeekFunc
|
||||
*
|
||||
* @description:
|
||||
* a method used to seek to a new position within a stream
|
||||
*
|
||||
* @input:
|
||||
* stream :: target stream handle
|
||||
* pos :: new read position, from start of stream
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*/
|
||||
typedef FT_Error (*FT_Stream_SeekFunc)( FT_Stream stream,
|
||||
FT_ULong pos );
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @struct: FT_Stream_ClassRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to describe an input stream class
|
||||
*
|
||||
* @input:
|
||||
* clazz :: root @FT_ClassRec fields
|
||||
* stream_read :: stream byte read method
|
||||
* stream_seek :: stream seek method
|
||||
*/
|
||||
typedef struct FT_Stream_ClassRec_
|
||||
{
|
||||
FT_ClassRec clazz;
|
||||
FT_Stream_ReadFunc stream_read;
|
||||
FT_Stream_SeekFunc stream_seek;
|
||||
|
||||
} FT_Stream_ClassRec;
|
||||
|
||||
/* */
|
||||
|
||||
#define FT_STREAM_CLASS(x) ((FT_Stream_Class)(x))
|
||||
#define FT_STREAM_CLASS__READ(x) FT_STREAM_CLASS(x)->stream_read
|
||||
#define FT_STREAM_CLASS__SEEK(x) FT_STREAM_CLASS(x)->stream_seek;
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @struct: FT_StreamRec
|
||||
*
|
||||
* @description:
|
||||
* the input stream object structure. See @FT_Stream_ClassRec for
|
||||
* its class descriptor
|
||||
*
|
||||
* @fields:
|
||||
* object :: root @FT_ObjectRec fields
|
||||
* size :: size of stream in bytes (0 if unknown)
|
||||
* pos :: current position within stream
|
||||
* base :: for memory-based streams, the address of the stream's
|
||||
* first data byte in memory. NULL otherwise
|
||||
*
|
||||
* cursor :: the current cursor position within an input stream
|
||||
* frame. Only valid within a FT_FRAME_ENTER .. FT_FRAME_EXIT
|
||||
* block; NULL otherwise
|
||||
*
|
||||
* limit :: the current frame limit within a FT_FRAME_ENTER ..
|
||||
* FT_FRAME_EXIT block. NULL otherwise
|
||||
*/
|
||||
typedef struct FT_StreamRec_
|
||||
{
|
||||
FT_ObjectRec object;
|
||||
FT_ULong size;
|
||||
FT_ULong pos;
|
||||
const FT_Byte* base;
|
||||
const FT_Byte* cursor;
|
||||
const FT_Byte* limit;
|
||||
|
||||
} FT_StreamRec;
|
||||
|
||||
/* some useful macros */
|
||||
#define FT_STREAM(x) ((FT_Stream)(x))
|
||||
#define FT_STREAM_P(x) ((FT_Stream*)(x))
|
||||
|
||||
#define FT_STREAM__READ(x) FT_STREAM_CLASS__READ(FT_OBJECT__CLASS(x))
|
||||
#define FT_STREAM__SEEK(x) FT_STREAM_CLASS__SEEK(FT_OBJECT__CLASS(x))
|
||||
|
||||
#define FT_STREAM_IS_BASED(x) ( FT_STREAM(x)->base != NULL )
|
||||
|
||||
/* */
|
||||
|
||||
/* create new memory-based stream */
|
||||
FT_BASE( FT_Error ) ft_stream_new_memory( const FT_Byte* stream_base,
|
||||
FT_ULong stream_size,
|
||||
FT_Memory memory,
|
||||
FT_Stream *astream );
|
||||
|
||||
FT_BASE( FT_Error ) ft_stream_new_iso( const char* pathanme,
|
||||
FT_Memory memory,
|
||||
FT_Stream *astream );
|
||||
|
||||
|
||||
/* handle to default stream class implementation for a given build */
|
||||
/* this is used by "FT_New_Face" */
|
||||
/* */
|
||||
FT_APIVAR( FT_Type ) ft_stream_default_type;
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_SYSTEM_STREAM_H__ */
|
||||
@@ -1,202 +0,0 @@
|
||||
#ifndef __FT_SYSTEM_MEMORY_H__
|
||||
#define __FT_SYSTEM_MEMORY_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/***** *****/
|
||||
/***** NOTE: THE CONTENT OF THIS FILE IS NOT CURRENTLY USED *****/
|
||||
/***** IN NORMAL BUILDS. CONSIDER IT EXPERIMENTAL. *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @type: FT_Memory
|
||||
*
|
||||
* @description:
|
||||
* opaque handle to a memory manager handle. Note that since FreeType
|
||||
* 2.2, the memory manager structure FT_MemoryRec is hidden to client
|
||||
* applications.
|
||||
*
|
||||
* however, you can still define custom allocators easily using the
|
||||
* @ft_memory_new API
|
||||
*/
|
||||
typedef struct FT_MemoryRec_* FT_Memory;
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_AllocFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to allocate a block of memory.
|
||||
*
|
||||
* @input:
|
||||
* size :: size of blocks in bytes. Always > 0 !!
|
||||
* mem_data :: memory-manager specific optional argument
|
||||
* (see @ft_memory_new)
|
||||
*
|
||||
* @return:
|
||||
* address of new block. NULL in case of memory exhaustion
|
||||
*/
|
||||
typedef FT_Pointer (*FT_Memory_AllocFunc)( FT_ULong size,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_FreeFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to release a block of memory created through
|
||||
* @FT_Memory_AllocFunc or @FT_Memory_ReallocFunc
|
||||
*
|
||||
* @input:
|
||||
* block :: address of target memory block. cannot be NULL !!
|
||||
* mem_data :: memory-manager specific optional argument
|
||||
* (see @ft_memory_new)
|
||||
*/
|
||||
typedef void (*FT_Memory_FreeFunc) ( FT_Pointer block,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_ReallocFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to reallocate a memory block.
|
||||
*
|
||||
* @input:
|
||||
* block :: address of target memory block. cannot be NULL !!
|
||||
* new_size :: new requested size in bytes
|
||||
* cur_size :: current block size in bytes
|
||||
* mem_data :: memory-manager specific optional argument
|
||||
* (see @ft_memory_new)
|
||||
*/
|
||||
typedef FT_Pointer (*FT_Memory_ReallocFunc)( FT_Pointer block,
|
||||
FT_ULong new_size,
|
||||
FT_ULong cur_size,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_CreateFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to create a @FT_Memory object to model a
|
||||
* memory manager
|
||||
*
|
||||
* @input:
|
||||
* size :: size of memory manager structure in bytes
|
||||
* init_data :: optional initialisation argument
|
||||
*
|
||||
* @output:
|
||||
* amem_data :: memory-manager specific argument to block management
|
||||
* routines.
|
||||
*
|
||||
* @return:
|
||||
* handle to new memory manager object. NULL in case of failure
|
||||
*/
|
||||
typedef FT_Pointer (*FT_Memory_CreateFunc)( FT_UInt size,
|
||||
FT_Pointer init_data,
|
||||
FT_Pointer *amem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_DestroyFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to destroy a given @FT_Memory manager
|
||||
*
|
||||
* @input:
|
||||
* memory :: target memory manager handle
|
||||
* mem_data :: option manager-specific argument
|
||||
*/
|
||||
typedef void (*FT_Memory_DestroyFunc)( FT_Memory memory,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @struct: FT_Memory_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* a function used to hold all methods of a given memory manager
|
||||
* implementation.
|
||||
*
|
||||
* @fields:
|
||||
* mem_alloc :: block allocation routine
|
||||
* mem_free :: block release routine
|
||||
* mem_realloc :: block re-allocation routine
|
||||
* mem_create :: manager creation routine
|
||||
* mem_destroy :: manager destruction routine
|
||||
*/
|
||||
typedef struct FT_Memory_FuncsRec_
|
||||
{
|
||||
FT_Memory_AllocFunc mem_alloc;
|
||||
FT_Memory_FreeFunc mem_free;
|
||||
FT_Memory_ReallocFunc mem_realloc;
|
||||
FT_Memory_CreateFunc mem_create;
|
||||
FT_Memory_DestroyFunc mem_destroy;
|
||||
|
||||
} FT_Memory_FuncsRec, *FT_Memory_Funcs;
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @type: FT_Memory_Funcs
|
||||
*
|
||||
* @description:
|
||||
* a pointer to a constant @FT_Memory_FuncsRec structure used to
|
||||
* describe a given memory manager implementation.
|
||||
*/
|
||||
typedef const FT_Memory_FuncsRec* FT_Memory_Funcs;
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @function: ft_memory_new
|
||||
*
|
||||
* @description:
|
||||
* create a new memory manager, given a set of memory methods
|
||||
*
|
||||
* @input:
|
||||
* mem_funcs :: handle to memory manager implementation descriptor
|
||||
* mem_init_data :: optional initialisation argument, passed to
|
||||
* @FT_Memory_CreateFunc
|
||||
*
|
||||
* @return:
|
||||
* new memory manager handle. NULL in case of failure
|
||||
*/
|
||||
FT_BASE( FT_Memory )
|
||||
ft_memory_new( FT_Memory_Funcs mem_funcs,
|
||||
FT_Pointer mem_init_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @function: ft_memory_destroy
|
||||
*
|
||||
* @description:
|
||||
* destroy a given memory manager
|
||||
*
|
||||
* @input:
|
||||
* memory :: handle to target memory manager
|
||||
*/
|
||||
FT_BASE( void )
|
||||
ft_memory_destroy( FT_Memory memory );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_SYSTEM_MEMORY_H__ */
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType low-level system interface definition (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -29,19 +29,19 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* system_interface */
|
||||
/* system_interface */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* System Interface */
|
||||
/* System Interface */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* How FreeType manages memory and i/o. */
|
||||
/* 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. */
|
||||
/* 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 */
|
||||
/* i/o streams. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@@ -53,80 +53,92 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Memory */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to a given memory manager object, defined with a */
|
||||
/* @FT_MemoryRec structure. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Memory
|
||||
*
|
||||
* @description:
|
||||
* A handle to a given memory manager object, defined with an
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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,
|
||||
@@ -134,23 +146,28 @@ FT_BEGIN_HEADER
|
||||
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
|
||||
*
|
||||
* @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;
|
||||
@@ -167,26 +184,28 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Stream */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to an input stream. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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;
|
||||
@@ -195,30 +214,35 @@ FT_BEGIN_HEADER
|
||||
} FT_StreamDesc;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Stream_IoFunc */
|
||||
/* */
|
||||
/* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Stream_IoFunc
|
||||
*
|
||||
* @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_IoFunc)( FT_Stream stream,
|
||||
unsigned long offset,
|
||||
@@ -226,60 +250,73 @@ FT_BEGIN_HEADER
|
||||
unsigned long count );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Stream_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to close a given input stream. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* stream :: A handle to the target stream. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Stream_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* A function used to close a given input stream.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* A handle to the target stream.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*FT_Stream_CloseFunc)( 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
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_StreamRec_
|
||||
{
|
||||
unsigned char* base;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType trigonometric functions (specification). */
|
||||
/* */
|
||||
/* Copyright 2001, 2003 by */
|
||||
/* Copyright 2001, 2003, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -33,272 +33,307 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @section: */
|
||||
/* <Section> */
|
||||
/* computations */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Angle */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This type is used to model angle values in FreeType. Note that */
|
||||
/* the angle is a 16.16 fixed float value expressed in degrees. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Angle
|
||||
*
|
||||
* @description:
|
||||
* This type is used to model angle values in FreeType. Note that the
|
||||
* angle is a 16.16 fixed float value expressed in degrees.
|
||||
*
|
||||
*/
|
||||
typedef FT_Fixed FT_Angle;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_PI */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle pi expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_PI
|
||||
*
|
||||
* @description:
|
||||
* The angle pi expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_PI ( 180L << 16 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_2PI */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle 2*pi expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_2PI
|
||||
*
|
||||
* @description:
|
||||
* The angle 2*pi expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_PI2 */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle pi/2 expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_PI2
|
||||
*
|
||||
* @description:
|
||||
* The angle pi/2 expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_PI4 */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle pi/4 expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_PI4
|
||||
*
|
||||
* @description:
|
||||
* The angle pi/4 expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Sin */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the sinus of a given angle in fixed point format. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The input angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The sinus value. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If you need both the sinus and cosinus for a given angle, use the */
|
||||
/* function @FT_Vector_Unit. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Sin
|
||||
*
|
||||
* @description:
|
||||
* Return the sinus of a given angle in fixed point format.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The input angle.
|
||||
*
|
||||
* @return:
|
||||
* The sinus value.
|
||||
*
|
||||
* @note:
|
||||
* If you need both the sinus and cosinus for a given angle, use the
|
||||
* function @FT_Vector_Unit.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Sin( FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Cos */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the cosinus of a given angle in fixed point format. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The input angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The cosinus value. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If you need both the sinus and cosinus for a given angle, use the */
|
||||
/* function @FT_Vector_Unit. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Cos
|
||||
*
|
||||
* @description:
|
||||
* Return the cosinus of a given angle in fixed point format.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The input angle.
|
||||
*
|
||||
* @return:
|
||||
* The cosinus value.
|
||||
*
|
||||
* @note:
|
||||
* If you need both the sinus and cosinus for a given angle, use the
|
||||
* function @FT_Vector_Unit.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Cos( FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Tan */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the tangent of a given angle in fixed point format. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The input angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The tangent value. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Tan
|
||||
*
|
||||
* @description:
|
||||
* Return the tangent of a given angle in fixed point format.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The input angle.
|
||||
*
|
||||
* @return:
|
||||
* The tangent value.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Tan( FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Atan2 */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the arc-tangent corresponding to a given vector (x,y) in */
|
||||
/* the 2d plane. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* x :: The horizontal vector coordinate. */
|
||||
/* */
|
||||
/* y :: The vertical vector coordinate. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The arc-tangent value (i.e. angle). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Atan2
|
||||
*
|
||||
* @description:
|
||||
* Return the arc-tangent corresponding to a given vector (x,y) in
|
||||
* the 2d plane.
|
||||
*
|
||||
* @input:
|
||||
* x ::
|
||||
* The horizontal vector coordinate.
|
||||
*
|
||||
* y ::
|
||||
* The vertical vector coordinate.
|
||||
*
|
||||
* @return:
|
||||
* The arc-tangent value (i.e. angle).
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Angle )
|
||||
FT_Atan2( FT_Fixed x,
|
||||
FT_Fixed y );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Angle_Diff */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the difference between two angles. The result is always */
|
||||
/* constrained to the ]-PI..PI] interval. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle1 :: First angle. */
|
||||
/* */
|
||||
/* angle2 :: Second angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Contrainted value of `value2-value1'. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Angle_Diff
|
||||
*
|
||||
* @description:
|
||||
* Return the difference between two angles. The result is always
|
||||
* constrained to the ]-PI..PI] interval.
|
||||
*
|
||||
* @input:
|
||||
* angle1 ::
|
||||
* First angle.
|
||||
*
|
||||
* angle2 ::
|
||||
* Second angle.
|
||||
*
|
||||
* @return:
|
||||
* Contrainted value of `value2-value1'.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Angle )
|
||||
FT_Angle_Diff( FT_Angle angle1,
|
||||
FT_Angle angle2 );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Unit */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the unit vector corresponding to a given angle. After the */
|
||||
/* call, the value of `vec.x' will be `sin(angle)', and the value of */
|
||||
/* `vec.y' will be `cos(angle)'. */
|
||||
/* */
|
||||
/* This function is useful to retrieve both the sinus and cosinus of */
|
||||
/* a given angle quickly. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* vec :: The address of target vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The address of angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Unit
|
||||
*
|
||||
* @description:
|
||||
* Return the unit vector corresponding to a given angle. After the
|
||||
* call, the value of `vec.x' will be `sin(angle)', and the value of
|
||||
* `vec.y' will be `cos(angle)'.
|
||||
*
|
||||
* This function is useful to retrieve both the sinus and cosinus of a
|
||||
* given angle quickly.
|
||||
*
|
||||
* @output:
|
||||
* vec ::
|
||||
* The address of target vector.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The address of angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_Unit( FT_Vector* vec,
|
||||
FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Rotate */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Rotate a vector by a given angle. */
|
||||
/* */
|
||||
/* @inout: */
|
||||
/* vec :: The address of target vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The address of angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Rotate
|
||||
*
|
||||
* @description:
|
||||
* Rotate a vector by a given angle.
|
||||
*
|
||||
* @inout:
|
||||
* vec ::
|
||||
* The address of target vector.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The address of angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_Rotate( FT_Vector* vec,
|
||||
FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Length */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the length of a given vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* vec :: The address of target vector. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The vector length, expressed in the same units that the original */
|
||||
/* vector coordinates. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Length
|
||||
*
|
||||
* @description:
|
||||
* Return the length of a given vector.
|
||||
*
|
||||
* @input:
|
||||
* vec ::
|
||||
* The address of target vector.
|
||||
*
|
||||
* @return:
|
||||
* The vector length, expressed in the same units that the original
|
||||
* vector coordinates.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Vector_Length( FT_Vector* vec );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Polarize */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Compute both the length and angle of a given vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* vec :: The address of source vector. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* length :: The vector length. */
|
||||
/* angle :: The vector angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Polarize
|
||||
*
|
||||
* @description:
|
||||
* Compute both the length and angle of a given vector.
|
||||
*
|
||||
* @input:
|
||||
* vec ::
|
||||
* The address of source vector.
|
||||
*
|
||||
* @output:
|
||||
* length ::
|
||||
* The vector length.
|
||||
*
|
||||
* angle ::
|
||||
* The vector angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_Polarize( FT_Vector* vec,
|
||||
FT_Fixed *length,
|
||||
FT_Angle *angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_From_Polar */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Compute vector coordinates from a length and angle. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* vec :: The address of source vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* length :: The vector length. */
|
||||
/* angle :: The vector angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_From_Polar
|
||||
*
|
||||
* @description:
|
||||
* Compute vector coordinates from a length and angle.
|
||||
*
|
||||
* @output:
|
||||
* vec ::
|
||||
* The address of source vector.
|
||||
*
|
||||
* @input:
|
||||
* length ::
|
||||
* The vector length.
|
||||
*
|
||||
* angle ::
|
||||
* The vector angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_From_Polar( FT_Vector* vec,
|
||||
FT_Fixed length,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType simple types definitions (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -273,8 +273,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_Fixed */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This type is used to store 16.16 fixed float values, like scales */
|
||||
/* or matrix coefficients. */
|
||||
/* This type is used to store 16.16 fixed float values, like scaling */
|
||||
/* values or matrix coefficients. */
|
||||
/* */
|
||||
typedef signed long FT_Fixed;
|
||||
|
||||
@@ -308,7 +308,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Offset */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This is equivalent to the ANSI C `size_t' type, i.e. the largest */
|
||||
/* This is equivalent to the ANSI C `size_t' type, i.e., the largest */
|
||||
/* _unsigned_ integer type used to express a file size or position, */
|
||||
/* or a memory block size. */
|
||||
/* */
|
||||
@@ -321,7 +321,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_PtrDist */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This is equivalent to the ANSI C `ptrdiff_t' type, i.e. the */
|
||||
/* This is equivalent to the ANSI C `ptrdiff_t' type, i.e., the */
|
||||
/* largest _signed_ integer type used to express the distance */
|
||||
/* between two pointers. */
|
||||
/* */
|
||||
@@ -409,7 +409,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Describes a function used to destroy the `client' data of any */
|
||||
/* FreeType object. See the description of the FT_Generic type for */
|
||||
/* FreeType object. See the description of the @FT_Generic type for */
|
||||
/* details of usage. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@@ -461,7 +461,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_MAKE_TAG */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro converts four letter tags which are used to label */
|
||||
/* This macro converts four-letter tags which are used to label */
|
||||
/* TrueType tables into an unsigned long to be used within FreeType. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
@@ -498,8 +498,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_ListNode */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Many elements and objects in FreeType are listed through a */
|
||||
/* FT_List record (see FT_ListRec). As its name suggests, a */
|
||||
/* Many elements and objects in FreeType are listed through an */
|
||||
/* @FT_List record (see @FT_ListRec). As its name suggests, an */
|
||||
/* FT_ListNode is a handle to a single list element. */
|
||||
/* */
|
||||
typedef struct FT_ListNodeRec_* FT_ListNode;
|
||||
@@ -511,7 +511,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_List */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to a list record (see FT_ListRec). */
|
||||
/* A handle to a list record (see @FT_ListRec). */
|
||||
/* */
|
||||
typedef struct FT_ListRec_* FT_List;
|
||||
|
||||
|
||||
@@ -77,7 +77,8 @@ FT_BEGIN_HEADER
|
||||
* Mac Roman encoding.
|
||||
*
|
||||
* FT_WinFNT_ID_OEM ::
|
||||
* From Michael Pöttgen <michael@poettgen.de>:
|
||||
* From Michael Pöttgen <michael@poettgen.de>:
|
||||
*
|
||||
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
|
||||
* is used for the charset of vector fonts, like `modern.fon',
|
||||
* `roman.fon', and `script.fon' on Windows.
|
||||
@@ -255,3 +256,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Arithmetic computations (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -44,12 +44,11 @@ FT_BEGIN_HEADER
|
||||
/* <Note> */
|
||||
/* This function is not very fast. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_BASE( FT_Int32 )
|
||||
FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
|
||||
#define SQRT_32( x ) FT_Sqrt32( x )
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@@ -69,6 +68,8 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_Sqrt32( FT_Int32 x );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Debugging and logging component (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -15,7 +15,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* IMPORTANT: A description of FreeType's debugging support can be */
|
||||
/* found in "docs/DEBUG.TXT". Read it if you need to use or */
|
||||
/* found in `docs/DEBUG.TXT'. Read it if you need to use or */
|
||||
/* understand this code. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
@@ -113,7 +113,7 @@ FT_BEGIN_HEADER
|
||||
/* This function may be useful if you want to access elements of */
|
||||
/* the internal `ft_trace_levels' array by an index. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int )
|
||||
FT_BASE( FT_Int )
|
||||
FT_Trace_Get_Count( void );
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ FT_BEGIN_HEADER
|
||||
/* This function may be useful if you want to control FreeType 2's */
|
||||
/* debug level in your appliaciton. */
|
||||
/* */
|
||||
FT_EXPORT( const char * )
|
||||
FT_BASE( const char * )
|
||||
FT_Trace_Get_Name( FT_Int idx );
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define 'FT_Message' and 'FT_Panic' when needed */
|
||||
/* Define `FT_Message' and `FT_Panic' when needed */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@@ -213,11 +213,11 @@ FT_BEGIN_HEADER
|
||||
#include "stdio.h" /* for vprintf() */
|
||||
|
||||
/* print a message */
|
||||
FT_EXPORT( void )
|
||||
FT_BASE( void )
|
||||
FT_Message( const char* fmt, ... );
|
||||
|
||||
/* print a message and exit */
|
||||
FT_EXPORT( void )
|
||||
FT_BASE( void )
|
||||
FT_Panic( const char* fmt, ... );
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType font driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -52,6 +52,16 @@ FT_BEGIN_HEADER
|
||||
(*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_RequestFunc)( FT_Size size,
|
||||
FT_Size_Request req );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_SelectFunc)( FT_Size size,
|
||||
FT_ULong size_index );
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_ResetPointsFunc)( FT_Size size,
|
||||
FT_F26Dot6 char_width,
|
||||
@@ -64,6 +74,8 @@ FT_BEGIN_HEADER
|
||||
FT_UInt pixel_width,
|
||||
FT_UInt pixel_height );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
@@ -129,16 +141,9 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* 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! */
|
||||
/* load_glyph :: A function handle to load a glyph to 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 */
|
||||
@@ -156,7 +161,7 @@ FT_BEGIN_HEADER
|
||||
/* face, or a CIDMap on a CID-keyed face. */
|
||||
/* */
|
||||
/* get_advances :: A function handle used to return advance */
|
||||
/* widths of 'count' glyphs (in font units), */
|
||||
/* widths of `count' glyphs (in font units), */
|
||||
/* starting at `first'. The `vertical' flag must */
|
||||
/* be set to get vertical advance heights. The */
|
||||
/* `advances' buffer is caller-allocated. */
|
||||
@@ -165,6 +170,15 @@ FT_BEGIN_HEADER
|
||||
/* device-independent text layout without loading */
|
||||
/* a single glyph image. */
|
||||
/* */
|
||||
/* request_size :: A handle to a function used to request the new */
|
||||
/* character size. Can be set to 0 if the */
|
||||
/* scaling done in the base layer suffices. */
|
||||
/* */
|
||||
/* select_size :: A handle to a function used to select a new */
|
||||
/* fixed size. It is used only if */
|
||||
/* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
|
||||
/* to 0 if the scaling done in the base layer */
|
||||
/* suffices. */
|
||||
/* <Note> */
|
||||
/* Most function pointers, with the exception of `load_glyph' and */
|
||||
/* `get_char_index' can be set to 0 to indicate a default behaviour. */
|
||||
@@ -186,18 +200,50 @@ FT_BEGIN_HEADER
|
||||
FT_Slot_InitFunc init_slot;
|
||||
FT_Slot_DoneFunc done_slot;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_Size_ResetPointsFunc set_char_sizes;
|
||||
FT_Size_ResetPixelsFunc set_pixel_sizes;
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
FT_Slot_LoadFunc load_glyph;
|
||||
|
||||
FT_Face_GetKerningFunc get_kerning;
|
||||
FT_Face_AttachFunc attach_file;
|
||||
FT_Face_GetAdvancesFunc get_advances;
|
||||
|
||||
/* since version 2.2 */
|
||||
FT_Size_RequestFunc request_size;
|
||||
FT_Size_SelectFunc select_size;
|
||||
|
||||
} FT_Driver_ClassRec, *FT_Driver_Class;
|
||||
|
||||
|
||||
/*
|
||||
* The following functions are used as stubs for `set_char_sizes' and
|
||||
* `set_pixel_sizes'; the code uses `request_size' and `select_size'
|
||||
* functions instead.
|
||||
*
|
||||
* Implementation is in `src/base/ftobjs.c'.
|
||||
*/
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
ft_stub_set_char_sizes( FT_Size size,
|
||||
FT_F26Dot6 width,
|
||||
FT_F26Dot6 height,
|
||||
FT_UInt horz_res,
|
||||
FT_UInt vert_res );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
ft_stub_set_pixel_sizes( FT_Size size,
|
||||
FT_UInt width,
|
||||
FT_UInt height );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTDRIVER_H__ */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType glyph loader (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* Copyright 2002, 2003, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -43,6 +43,7 @@ FT_BEGIN_HEADER
|
||||
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
|
||||
|
||||
|
||||
#if 0 /* moved to freetype.h in version 2.2 */
|
||||
#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
|
||||
@@ -50,6 +51,7 @@ FT_BEGIN_HEADER
|
||||
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
|
||||
#define FT_SUBGLYPH_FLAG_2X2 0x80
|
||||
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct FT_SubGlyphRec_
|
||||
@@ -59,7 +61,7 @@ FT_BEGIN_HEADER
|
||||
FT_Int arg1;
|
||||
FT_Int arg2;
|
||||
FT_Matrix transform;
|
||||
|
||||
|
||||
} FT_SubGlyphRec;
|
||||
|
||||
|
||||
@@ -117,6 +119,24 @@ FT_BEGIN_HEADER
|
||||
FT_UInt n_points,
|
||||
FT_UInt n_contours );
|
||||
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
|
||||
( (_count) == 0 || (int)((_loader)->base.outline.n_points + \
|
||||
(_loader)->current.outline.n_points + \
|
||||
(_count)) <= (int)(_loader)->max_points )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
|
||||
( (_count) == 0 || (int)((_loader)->base.outline.n_contours + \
|
||||
(_loader)->current.outline.n_contours + \
|
||||
(_count)) <= (int)(_loader)->max_contours )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \
|
||||
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
|
||||
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
|
||||
? 0 \
|
||||
: FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
|
||||
|
||||
|
||||
/* check that there is enough space to add `n_subs' sub-glyphs to */
|
||||
/* a glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType memory management macros (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -56,198 +56,134 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#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_QAlloc_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( FT_Error )
|
||||
FT_QRealloc_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 );
|
||||
/*
|
||||
* C++ refuses to handle statements like p = (void*)anything; where `p'
|
||||
* is a typed pointer. Since we don't have a `typeof' operator in
|
||||
* standard C++, we have to use ugly casts.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_ASSIGNP( p, val ) *((void**)&(p)) = (val)
|
||||
#else
|
||||
#define FT_ASSIGNP( p, val ) (p) = (val)
|
||||
#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 );
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
FT_BASE( const char* ) _ft_debug_file;
|
||||
FT_BASE( long ) _ft_debug_lineno;
|
||||
|
||||
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
(exp) )
|
||||
|
||||
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
FT_ASSIGNP( p, exp ) )
|
||||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
||||
#define FT_DEBUG_INNER( exp ) (exp)
|
||||
#define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp )
|
||||
|
||||
#endif /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_QAlloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Allocates a new block of memory. The returned area is *not* */
|
||||
/* zero-filled, making allocation quicker. */
|
||||
/* */
|
||||
/* <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_QAlloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
/*
|
||||
* The allocation functions return a pointer, and the error code
|
||||
* is written to through the `p_error' parameter. See below for
|
||||
* for documentation.
|
||||
*/
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
FT_Error *p_error );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Realloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Reallocates a block of memory pointed to by `*P' to `Size' bytes */
|
||||
/* from the heap, possibly changing `*P'. The returned area is */
|
||||
/* zero-filled. */
|
||||
/* */
|
||||
/* <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 );
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_qalloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
FT_Error *p_error );
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_realloc( FT_Memory memory,
|
||||
FT_Long item_size,
|
||||
FT_Long cur_count,
|
||||
FT_Long new_count,
|
||||
void* block,
|
||||
FT_Error *p_error );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_QRealloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Reallocates a block of memory pointed to by `*P' to `Size' bytes */
|
||||
/* from the heap, possibly changing `*P'. The returned area is *not* */
|
||||
/* zero-filled, making reallocation quicker. */
|
||||
/* */
|
||||
/* <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_QRealloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_qrealloc( FT_Memory memory,
|
||||
FT_Long item_size,
|
||||
FT_Long cur_count,
|
||||
FT_Long new_count,
|
||||
void* block,
|
||||
FT_Error *p_error );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <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. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* If P or *P is 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 );
|
||||
ft_mem_free( FT_Memory memory,
|
||||
const void* P );
|
||||
|
||||
|
||||
#define FT_MEM_ALLOC( ptr, size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )
|
||||
|
||||
#define FT_MEM_FREE( ptr ) \
|
||||
FT_BEGIN_STMNT \
|
||||
ft_mem_free( memory, (ptr) ); \
|
||||
(ptr) = NULL; \
|
||||
FT_END_STMNT
|
||||
|
||||
#define FT_MEM_NEW( ptr ) \
|
||||
FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
|
||||
|
||||
#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1, \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_QALLOC( ptr, size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )
|
||||
|
||||
#define FT_MEM_QNEW( ptr ) \
|
||||
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
|
||||
|
||||
#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1, \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz), \
|
||||
(oldcnt), (newcnt), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz), \
|
||||
(oldcnt), (newcnt), \
|
||||
(ptr), &error ) )
|
||||
|
||||
|
||||
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
|
||||
|
||||
|
||||
#define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count )
|
||||
@@ -261,6 +197,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
|
||||
|
||||
|
||||
#define FT_ARRAY_ZERO( dest, count ) \
|
||||
FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )
|
||||
|
||||
@@ -281,157 +218,108 @@ FT_BEGIN_HEADER
|
||||
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* We first define FT_MEM_ALLOC, FT_MEM_REALLOC, and FT_MEM_FREE. All */
|
||||
/* macros use an _implicit_ `memory' parameter to access the current */
|
||||
/* memory allocator. */
|
||||
/* */
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
#define FT_MEM_ALLOC( _pointer_, _size_ ) \
|
||||
FT_Alloc_Debug( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc_Debug( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_QALLOC( _pointer_, _size_ ) \
|
||||
FT_QAlloc_Debug( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_QRealloc_Debug( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_FREE( _pointer_ ) \
|
||||
FT_Free_Debug( memory, (void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
#define FT_MEM_ALLOC( _pointer_, _size_ ) \
|
||||
FT_Alloc( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_FREE( _pointer_ ) \
|
||||
FT_Free( memory, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_QALLOC( _pointer_, _size_ ) \
|
||||
FT_QAlloc( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_QRealloc( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#endif /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The following functions macros expect that their pointer argument is */
|
||||
/* _typed_ in order to automatically compute array element sizes. */
|
||||
/* */
|
||||
|
||||
#define FT_MEM_NEW( _pointer_ ) \
|
||||
FT_MEM_ALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_NEW_ARRAY( ptr, count ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_NEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_MEM_ALLOC( _pointer_, (_count_) * sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_RENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_MEM_REALLOC( _pointer_, (_old_) * sizeof ( *(_pointer_) ), \
|
||||
(_new_) * sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_QNEW_ARRAY( ptr, count ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_QNEW( _pointer_ ) \
|
||||
FT_MEM_QALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_MEM_QNEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_MEM_QALLOC( _pointer_, (_count_) * sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_MEM_QRENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_MEM_QREALLOC( _pointer_, (_old_) * sizeof ( *(_pointer_) ), \
|
||||
(_new_) * sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* the following macros are obsolete but kept for compatibility reasons */
|
||||
/* */
|
||||
#define FT_ALLOC( ptr, size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
|
||||
|
||||
#define FT_MEM_ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
|
||||
FT_MEM_ALLOC( _pointer_, (_count_) * sizeof ( _type_ ) )
|
||||
#define FT_REALLOC( ptr, cursz, newsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
|
||||
|
||||
#define FT_MEM_REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) \
|
||||
FT_MEM_REALLOC( _pointer_, (_old_) * sizeof ( _type ), \
|
||||
(_new_) * sizeof ( _type_ ) )
|
||||
#define FT_ALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
|
||||
|
||||
#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
|
||||
newcnt, itmsz ) )
|
||||
|
||||
#define FT_QALLOC( ptr, size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
|
||||
|
||||
#define FT_QREALLOC( ptr, cursz, newsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
|
||||
|
||||
#define FT_QALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
|
||||
|
||||
#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
|
||||
newcnt, itmsz ) )
|
||||
|
||||
#define FT_FREE( ptr ) FT_MEM_FREE( ptr )
|
||||
|
||||
#define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
|
||||
|
||||
#define FT_NEW_ARRAY( ptr, count ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
|
||||
|
||||
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||
|
||||
#define FT_QNEW( ptr ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
|
||||
|
||||
#define FT_QNEW_ARRAY( ptr, count ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
|
||||
|
||||
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The following macros are variants of their FT_MEM_XXXX equivalents; */
|
||||
/* they are used to set an _implicit_ `error' variable and return TRUE */
|
||||
/* if an error occured (i.e. if 'error != 0'). */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
#define FT_ALLOC( _pointer_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_ALLOC( _pointer_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_Alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
#define FT_REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_REALLOC( _pointer_, _current_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_QAlloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
|
||||
#define FT_QALLOC( _pointer_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_QALLOC( _pointer_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_Realloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
#define FT_QREALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_QRealloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Free( FT_Memory memory,
|
||||
void* *P );
|
||||
|
||||
#define FT_FREE( _pointer_ ) \
|
||||
FT_MEM_FREE( _pointer_ )
|
||||
|
||||
|
||||
#define FT_NEW( _pointer_ ) \
|
||||
FT_ALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_NEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_ALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_count_) )
|
||||
|
||||
#define FT_RENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_REALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_old_), \
|
||||
sizeof ( *(_pointer_) ) * (_new_) )
|
||||
|
||||
#define FT_QNEW( _pointer_ ) \
|
||||
FT_QALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_QNEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_QALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_count_) )
|
||||
|
||||
#define FT_QRENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_QREALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_old_), \
|
||||
sizeof ( *(_pointer_) ) * (_new_) )
|
||||
|
||||
|
||||
#define FT_ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
|
||||
FT_ALLOC( _pointer_, (_count_) * sizeof ( _type_ ) )
|
||||
|
||||
#define FT_REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) \
|
||||
FT_REALLOC( _pointer, (_old_) * sizeof ( _type_ ), \
|
||||
(_new_) * sizeof ( _type_ ) )
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType private base classes (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -213,9 +213,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
typedef struct FT_Face_InternalRec_
|
||||
{
|
||||
FT_UShort max_points;
|
||||
FT_Short max_contours;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_UShort reserved1;
|
||||
FT_Short reserved2;
|
||||
#endif
|
||||
FT_Matrix transform_matrix;
|
||||
FT_Vector transform_delta;
|
||||
FT_Int transform_flags;
|
||||
@@ -451,26 +452,58 @@ FT_BEGIN_HEADER
|
||||
|
||||
/* */
|
||||
|
||||
/*
|
||||
* Free the bitmap of a given glyphslot when needed
|
||||
* (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).
|
||||
*/
|
||||
#define FT_REQUEST_WIDTH( req ) \
|
||||
( (req)->horiResolution \
|
||||
? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
|
||||
: (req)->width )
|
||||
|
||||
#define FT_REQUEST_HEIGHT( req ) \
|
||||
( (req)->vertResolution \
|
||||
? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
|
||||
: (req)->height )
|
||||
|
||||
|
||||
/* Set the metrics according to a bitmap strike. */
|
||||
FT_BASE( void )
|
||||
FT_Select_Metrics( FT_Face face,
|
||||
FT_ULong strike_index );
|
||||
|
||||
|
||||
/* Set the metrics according to a size request. */
|
||||
FT_BASE( void )
|
||||
FT_Request_Metrics( FT_Face face,
|
||||
FT_Size_Request req );
|
||||
|
||||
|
||||
/* Match a size request against `available_sizes'. */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Match_Size( FT_Face face,
|
||||
FT_Size_Request req,
|
||||
FT_Bool ignore_width,
|
||||
FT_ULong* size_index );
|
||||
|
||||
|
||||
/* Use the horizontal metrics to synthesize the vertical metrics. */
|
||||
/* If `advance' is zero, it is also synthesized. */
|
||||
FT_BASE( void )
|
||||
ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
|
||||
FT_Pos advance );
|
||||
|
||||
|
||||
/* Free the bitmap of a given glyphslot when needed (i.e., only when it */
|
||||
/* was allocated with ft_glyphslot_alloc_bitmap). */
|
||||
FT_BASE( void )
|
||||
ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a new bitmap buffer in a glyph slot.
|
||||
*/
|
||||
/* Allocate a new bitmap buffer in a glyph slot. */
|
||||
FT_BASE( FT_Error )
|
||||
ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
|
||||
FT_ULong size );
|
||||
|
||||
|
||||
/*
|
||||
* Set the bitmap buffer in a glyph slot to a given pointer.
|
||||
* The buffer will not be freed by a later call to ft_glyphslot_free_bitmap.
|
||||
*/
|
||||
/* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
|
||||
/* will not be freed by a later call to ft_glyphslot_free_bitmap. */
|
||||
FT_BASE( void )
|
||||
ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
|
||||
FT_Byte* buffer );
|
||||
@@ -582,17 +615,15 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* this hook is used by the TrueType debugger. It must be set to an alternate
|
||||
* truetype bytecode interpreter function
|
||||
*/
|
||||
/* This hook is used by the TrueType debugger. It must be set to an */
|
||||
/* alternate truetype bytecode interpreter function. */
|
||||
#define FT_DEBUG_HOOK_TRUETYPE 0
|
||||
|
||||
|
||||
/* set this debug hook to a non-null pointer to force unpatented hinting
|
||||
* for all faces when both TT_CONFIG_OPTION_BYTECODE_INTERPRETER and
|
||||
* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. this is only used
|
||||
* during debugging
|
||||
*/
|
||||
/* Set this debug hook to a non-null pointer to force unpatented hinting */
|
||||
/* for all faces when both TT_CONFIG_OPTION_BYTECODE_INTERPRETER and */
|
||||
/* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. this is only used */
|
||||
/* during debugging. */
|
||||
#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
|
||||
|
||||
|
||||
@@ -709,7 +740,7 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* A pointer to the new memory object. 0 in case of error. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Memory )
|
||||
FT_BASE( FT_Memory )
|
||||
FT_New_Memory( void );
|
||||
|
||||
|
||||
@@ -724,7 +755,7 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* memory :: A handle to the memory manager. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_BASE( void )
|
||||
FT_Done_Memory( FT_Memory memory );
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Embedded resource forks accessor (specification). */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* Masatake YAMATO and Redhat K.K. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -154,7 +154,7 @@ FT_BEGIN_HEADER
|
||||
/* offsets :: */
|
||||
/* The stream offsets for the resource data specified by `tag'. */
|
||||
/* This array is allocated by the function, so you have to call */
|
||||
/* @FT_Free after use. */
|
||||
/* @ft_mem_free after use. */
|
||||
/* */
|
||||
/* count :: */
|
||||
/* The length of offsets array. */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType services (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -302,6 +302,8 @@ FT_BEGIN_HEADER
|
||||
|
||||
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
|
||||
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
|
||||
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
|
||||
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
|
||||
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
|
||||
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
|
||||
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
|
||||
@@ -309,6 +311,7 @@ FT_BEGIN_HEADER
|
||||
#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
|
||||
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
|
||||
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
|
||||
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
|
||||
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
|
||||
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Stream handling (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -328,7 +328,7 @@ FT_BEGIN_HEADER
|
||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||
|
||||
/* initialize a stream for reading a regular system stream */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Open( FT_Stream stream,
|
||||
const char* filepathname );
|
||||
|
||||
@@ -514,18 +514,21 @@ FT_BEGIN_HEADER
|
||||
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
|
||||
|
||||
|
||||
#define FT_FRAME_ENTER( size ) \
|
||||
FT_SET_ERROR( FT_Stream_EnterFrame( stream, size ) )
|
||||
#define FT_FRAME_ENTER( size ) \
|
||||
FT_SET_ERROR( \
|
||||
FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )
|
||||
|
||||
#define FT_FRAME_EXIT() \
|
||||
FT_Stream_ExitFrame( stream )
|
||||
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
|
||||
|
||||
#define FT_FRAME_EXTRACT( size, bytes ) \
|
||||
FT_SET_ERROR( FT_Stream_ExtractFrame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
#define FT_FRAME_EXTRACT( size, bytes ) \
|
||||
FT_SET_ERROR( \
|
||||
FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) ) )
|
||||
|
||||
#define FT_FRAME_RELEASE( bytes ) \
|
||||
FT_Stream_ReleaseFrame( stream, (FT_Byte**)&(bytes) )
|
||||
#define FT_FRAME_RELEASE( bytes ) \
|
||||
FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Tracing handling (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2004, 2005 by */
|
||||
/* Copyright 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -45,6 +45,7 @@ FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
|
||||
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
|
||||
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
|
||||
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
|
||||
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
|
||||
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
|
||||
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
|
||||
|
||||
@@ -114,5 +115,19 @@ FT_TRACE_DEF( otvgpos )
|
||||
FT_TRACE_DEF( otvgsub )
|
||||
FT_TRACE_DEF( otvjstf )
|
||||
|
||||
/* TrueTypeGX/AAT validation components */
|
||||
FT_TRACE_DEF( gxvmodule )
|
||||
FT_TRACE_DEF( gxvcommon )
|
||||
FT_TRACE_DEF( gxvfeat )
|
||||
FT_TRACE_DEF( gxvmort )
|
||||
FT_TRACE_DEF( gxvmorx )
|
||||
FT_TRACE_DEF( gxvbsln )
|
||||
FT_TRACE_DEF( gxvjust )
|
||||
FT_TRACE_DEF( gxvkern )
|
||||
FT_TRACE_DEF( gxvopbd )
|
||||
FT_TRACE_DEF( gxvtrak )
|
||||
FT_TRACE_DEF( gxvprop )
|
||||
FT_TRACE_DEF( gxvlcar )
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Auxiliary functions and data structures related to PostScript fonts */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -516,9 +516,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* last :: The last point position. */
|
||||
/* */
|
||||
/* scale_x :: The horizontal scale (FUnits to sub-pixels). */
|
||||
/* scale_x :: The horizontal scaling value (FUnits to */
|
||||
/* sub-pixels). */
|
||||
/* */
|
||||
/* scale_y :: The vertical scale (FUnits to sub-pixels). */
|
||||
/* scale_y :: The vertical scaling value (FUnits to sub-pixels). */
|
||||
/* */
|
||||
/* pos_x :: The horizontal translation (if composite glyph). */
|
||||
/* */
|
||||
@@ -685,6 +686,70 @@ FT_BEGIN_HEADER
|
||||
} T1_DecoderRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** AFM PARSER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct AFM_ParserRec_* AFM_Parser;
|
||||
|
||||
typedef struct AFM_Parser_FuncsRec_
|
||||
{
|
||||
FT_Error
|
||||
(*init)( AFM_Parser parser,
|
||||
FT_Memory memory,
|
||||
FT_Byte* base,
|
||||
FT_Byte* limit );
|
||||
|
||||
void
|
||||
(*done)( AFM_Parser parser );
|
||||
|
||||
FT_Error
|
||||
(*parse)( AFM_Parser parser );
|
||||
|
||||
} AFM_Parser_FuncsRec;
|
||||
|
||||
typedef struct AFM_StreamRec_* AFM_Stream;
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* AFM_ParserRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An AFM_Parser is a parser for the AFM files. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* memory :: The object used for memory operations (alloc and */
|
||||
/* realloc). */
|
||||
/* */
|
||||
/* stream :: This is an opaque object. */
|
||||
/* */
|
||||
/* FontInfo :: The result will be stored here. */
|
||||
/* */
|
||||
/* get_index :: A user provided function to get a glyph index by its */
|
||||
/* name. */
|
||||
/* */
|
||||
typedef struct AFM_ParserRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
AFM_Stream stream;
|
||||
|
||||
AFM_FontInfo FontInfo;
|
||||
|
||||
FT_Int
|
||||
(*get_index)( const char* name,
|
||||
FT_UInt len,
|
||||
void* user_data );
|
||||
|
||||
void* user_data;
|
||||
|
||||
} AFM_ParserRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
@@ -728,6 +793,9 @@ FT_BEGIN_HEADER
|
||||
|
||||
T1_CMap_Classes t1_cmap_classes;
|
||||
|
||||
/* fields after this comment line were added after version 2.1.10 */
|
||||
const AFM_Parser_FuncsRec* afm_parser_funcs;
|
||||
|
||||
} PSAux_ServiceRec, *PSAux_Service;
|
||||
|
||||
/* backwards-compatible type definition */
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
/* */
|
||||
/* 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. */
|
||||
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
|
||||
/* */
|
||||
/* Copyright 2001, 2002, 2003 by */
|
||||
/* Copyright 2001, 2002, 2003, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -73,212 +73,233 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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 rewinds 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
|
||||
* returns 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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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]". */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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 is interpreted as a `ghost' stem, according to the 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). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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 is set to indicate that an error occurred 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. */
|
||||
/* */
|
||||
/* hint_mode :: Hinting information. */
|
||||
/* */
|
||||
/* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* hint_mode ::
|
||||
* Hinting information.
|
||||
*
|
||||
* @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,
|
||||
@@ -286,30 +307,37 @@ FT_BEGIN_HEADER
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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;
|
||||
@@ -331,100 +359,108 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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 rewinds 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
|
||||
* returns 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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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 is interpreted as a `ghost' stem, according to the Type 1
|
||||
* specification.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_StemsFunc)( T2_Hints hints,
|
||||
FT_UInt dimension,
|
||||
@@ -432,36 +468,41 @@ FT_BEGIN_HEADER
|
||||
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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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
|
||||
* or 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,
|
||||
@@ -469,97 +510,110 @@ FT_BEGIN_HEADER
|
||||
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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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 or
|
||||
* 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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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 is set to indicate that an error occurred 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. */
|
||||
/* */
|
||||
/* hint_mode :: Hinting information. */
|
||||
/* */
|
||||
/* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* hint_mode ::
|
||||
* Hinting information.
|
||||
*
|
||||
* @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,
|
||||
@@ -567,30 +621,37 @@ FT_BEGIN_HEADER
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @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;
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* svgxval.h */
|
||||
/* */
|
||||
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005 by */
|
||||
/* Masatake YAMATO, Red Hat K.K., */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* gxvalid is derived from both gxlayout module and otvalid module. */
|
||||
/* Development of gxlayout is supported by the Information-technology */
|
||||
/* Promotion Agency(IPA), Japan. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVGXVAL_H__
|
||||
#define __SVGXVAL_H__
|
||||
|
||||
#include FT_GX_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate"
|
||||
#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
|
||||
|
||||
typedef FT_Error
|
||||
(*gxv_validate_func)( FT_Face face,
|
||||
FT_UInt gx_flags,
|
||||
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
|
||||
FT_UInt table_length );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*ckern_validate_func)( FT_Face face,
|
||||
FT_UInt ckern_flags,
|
||||
FT_Bytes *ckern_table );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( GXvalidate )
|
||||
{
|
||||
gxv_validate_func validate;
|
||||
};
|
||||
|
||||
FT_DEFINE_SERVICE( CKERNvalidate )
|
||||
{
|
||||
ckern_validate_func validate;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVGXVAL_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,51 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* svkern.h */
|
||||
/* */
|
||||
/* The FreeType Kerning service (specification). */
|
||||
/* */
|
||||
/* Copyright 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVKERN_H__
|
||||
#define __SVKERN_H__
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#define FT_SERVICE_ID_KERNING "kerning"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Kerning_TrackGetFunc)( FT_Face face,
|
||||
FT_Fixed point_size,
|
||||
FT_Int degree,
|
||||
FT_Fixed* akerning );
|
||||
|
||||
FT_DEFINE_SERVICE( Kerning )
|
||||
{
|
||||
FT_Kerning_TrackGetFunc get_track;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVKERN_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType OpenType validation service (specification). */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -19,6 +19,8 @@
|
||||
#ifndef __SVOTVAL_H__
|
||||
#define __SVOTVAL_H__
|
||||
|
||||
#include FT_OPENTYPE_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Internal PFR service functions (specification). */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef __SVPFR_H__
|
||||
#define __SVPFR_H__
|
||||
|
||||
#include FT_PFR_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType PostScript charmap service (specification). */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -19,6 +19,8 @@
|
||||
#ifndef __SVPSCMAP_H__
|
||||
#define __SVPSCMAP_H__
|
||||
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
@@ -27,30 +29,23 @@ FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* Adobe glyph name to unicode value
|
||||
* Adobe glyph name to unicode value.
|
||||
*/
|
||||
typedef FT_UInt32
|
||||
(*PS_Unicode_ValueFunc)( const char* glyph_name );
|
||||
|
||||
/*
|
||||
* Unicode value to Adobe glyph name index. 0xFFFF if not found.
|
||||
*/
|
||||
typedef FT_UInt
|
||||
(*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
FT_ULong unicode );
|
||||
|
||||
/*
|
||||
* Macintosh name id to glyph name. NULL if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Macintosh_Name_Func)( FT_UInt name_index );
|
||||
(*PS_Macintosh_NameFunc)( FT_UInt name_index );
|
||||
|
||||
/*
|
||||
* Adobe standard string ID to glyph name. NULL if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
|
||||
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
|
||||
|
||||
|
||||
/*
|
||||
* Simple unicode -> glyph index charmap built from font glyph names
|
||||
@@ -58,33 +53,45 @@ FT_BEGIN_HEADER
|
||||
*/
|
||||
typedef struct PS_UniMap_
|
||||
{
|
||||
FT_UInt unicode;
|
||||
FT_UInt glyph_index;
|
||||
FT_UInt32 unicode; /* bit 31 set: is glyph variant */
|
||||
FT_UInt glyph_index;
|
||||
|
||||
} PS_UniMap;
|
||||
|
||||
|
||||
typedef struct PS_Unicodes_
|
||||
typedef struct PS_UnicodesRec_* PS_Unicodes;
|
||||
|
||||
typedef struct PS_UnicodesRec_
|
||||
{
|
||||
FT_CMapRec cmap;
|
||||
FT_UInt num_maps;
|
||||
PS_UniMap* maps;
|
||||
|
||||
} PS_Unicodes;
|
||||
} PS_UnicodesRec;
|
||||
|
||||
|
||||
/*
|
||||
* A function which returns a glyph name for a given index. Returns
|
||||
* NULL if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Glyph_NameFunc)( FT_Pointer data,
|
||||
FT_UInt string_index );
|
||||
|
||||
typedef FT_Error
|
||||
(*PS_Unicodes_InitFunc)( FT_Memory memory,
|
||||
FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
PS_Unicodes* unicodes );
|
||||
(*PS_Unicodes_InitFunc)( FT_Memory memory,
|
||||
PS_Unicodes unicodes,
|
||||
FT_UInt num_glyphs,
|
||||
PS_Glyph_NameFunc get_glyph_name,
|
||||
FT_Pointer glyph_data );
|
||||
|
||||
typedef FT_UInt
|
||||
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes* unicodes,
|
||||
FT_UInt unicode );
|
||||
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
|
||||
FT_UInt32 unicode );
|
||||
|
||||
typedef FT_ULong
|
||||
(*PS_Unicodes_CharNextFunc)( PS_Unicodes* unicodes,
|
||||
FT_ULong unicode );
|
||||
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
|
||||
FT_UInt32 *unicode );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( PsCMaps )
|
||||
@@ -95,8 +102,8 @@ FT_BEGIN_HEADER
|
||||
PS_Unicodes_CharIndexFunc unicodes_char_index;
|
||||
PS_Unicodes_CharNextFunc unicodes_char_next;
|
||||
|
||||
PS_Macintosh_Name_Func macintosh_name;
|
||||
PS_Adobe_Std_Strings_Func adobe_std_strings;
|
||||
PS_Macintosh_NameFunc macintosh_name;
|
||||
PS_Adobe_Std_StringsFunc adobe_std_strings;
|
||||
const unsigned short* adobe_std_encoding;
|
||||
const unsigned short* adobe_expert_encoding;
|
||||
};
|
||||
|
||||
@@ -70,7 +70,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* svtteng.h */
|
||||
/* */
|
||||
/* The FreeType TrueType engine query service (specification). */
|
||||
/* */
|
||||
/* Copyright 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVTTENG_H__
|
||||
#define __SVTTENG_H__
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* SFNT table loading service.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
|
||||
|
||||
/*
|
||||
* Used to implement FT_Get_TrueType_Engine_Type
|
||||
*/
|
||||
|
||||
FT_DEFINE_SERVICE( TrueTypeEngine )
|
||||
{
|
||||
FT_TrueTypeEngineType engine_type;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVTTENG_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* High-level `sfnt' driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -34,7 +34,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Init_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* First part of the SFNT face object initialization. This will find */
|
||||
/* First part of the SFNT face object initialization. This finds */
|
||||
/* the face in a SFNT file or collection, and load its format tag in */
|
||||
/* face->format_tag. */
|
||||
/* */
|
||||
@@ -77,9 +77,9 @@ FT_BEGIN_HEADER
|
||||
/* 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. */
|
||||
/* Second part of the SFNT face object initialization. This loads */
|
||||
/* the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the */
|
||||
/* face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
@@ -125,6 +125,8 @@ FT_BEGIN_HEADER
|
||||
(*TT_Done_Face_Func)( TT_Face face );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
@@ -172,11 +174,11 @@ FT_BEGIN_HEADER
|
||||
/* Loads the table directory into a face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
@@ -191,6 +193,8 @@ FT_BEGIN_HEADER
|
||||
FT_Stream stream,
|
||||
SFNT_Header sfnt );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@@ -198,7 +202,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_Any_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads any font table into client memory. */
|
||||
/* Load any font table into client memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The face object to look for. */
|
||||
@@ -246,7 +250,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Find_SBit_Image_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Checks whether an embedded bitmap (an `sbit') exists for a given */
|
||||
/* Check whether an embedded bitmap (an `sbit') exists for a given */
|
||||
/* glyph, at a given strike. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@@ -283,7 +287,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_SBit_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Gets the big metrics for a given embedded bitmap. */
|
||||
/* Get the big metrics for a given embedded bitmap. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
@@ -316,7 +320,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_SBit_Image_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given glyph sbit image from the font resource. This also */
|
||||
/* Load a given glyph sbit image from the font resource. This also */
|
||||
/* returns its metrics. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@@ -359,21 +363,20 @@ FT_BEGIN_HEADER
|
||||
TT_SBit_MetricsRec *ametrics );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Set_SBit_Strike_Func */
|
||||
/* TT_Set_SBit_Strike_OldFunc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Selects an sbit strike for given horizontal and vertical ppem */
|
||||
/* values. */
|
||||
/* Select an sbit strike for a given size request. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* x_ppem :: The horizontal resolution in points per EM. */
|
||||
/* */
|
||||
/* y_ppem :: The vertical resolution in points per EM. */
|
||||
/* req :: The size request. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* astrike_index :: The index of the sbit strike. */
|
||||
@@ -383,10 +386,115 @@ FT_BEGIN_HEADER
|
||||
/* sbit strike exists for the selected ppem values. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Set_SBit_Strike_Func)( TT_Face face,
|
||||
FT_UInt x_ppem,
|
||||
FT_UInt y_ppem,
|
||||
FT_ULong *astrike_index );
|
||||
(*TT_Set_SBit_Strike_OldFunc)( TT_Face face,
|
||||
FT_UInt x_ppem,
|
||||
FT_UInt y_ppem,
|
||||
FT_ULong* astrike_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <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,
|
||||
void* 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,
|
||||
void* cmap );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Set_SBit_Strike_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Select an sbit strike for a given size request. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* req :: The size request. */
|
||||
/* */
|
||||
/* <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_Size_Request req,
|
||||
FT_ULong* astrike_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Strike_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Load the metrics of a given strike. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* strike_index :: The strike index. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* metrics :: the metrics of the strike. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. Returns an error if no */
|
||||
/* such sbit strike exists. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Strike_Metrics_Func)( TT_Face face,
|
||||
FT_ULong strike_index,
|
||||
FT_Size_Metrics* metrics );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -395,7 +503,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Get_PS_Name_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Gets the PostScript glyph name of a glyph. */
|
||||
/* Get the PostScript glyph name of a glyph. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* idx :: The glyph index. */
|
||||
@@ -420,14 +528,15 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the horizontal or vertical header in a face object. */
|
||||
/* Load a metrics table, which is a table with a horizontal and a */
|
||||
/* vertical version. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */
|
||||
/* vertical :: A boolean flag. If set, load the vertical one. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
@@ -438,13 +547,39 @@ FT_BEGIN_HEADER
|
||||
FT_Bool vertical );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Get_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Load 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_Get_Metrics_Func)( TT_Face face,
|
||||
FT_Bool vertical,
|
||||
FT_UInt gindex,
|
||||
FT_Short* abearing,
|
||||
FT_UShort* aadvance );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given TrueType table. */
|
||||
/* Load a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
@@ -455,8 +590,8 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The function will use `face->goto_table' to seek the stream to */
|
||||
/* the start of the table. */
|
||||
/* The function uses `face->goto_table' to seek the stream to the */
|
||||
/* start of the table, except while loading the font directory. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Table_Func)( TT_Face face,
|
||||
@@ -469,7 +604,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Free_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Frees a given TrueType table. */
|
||||
/* Free a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
@@ -521,47 +656,97 @@ FT_BEGIN_HEADER
|
||||
FT_Module_Requester get_interface;
|
||||
|
||||
TT_Load_Any_Func load_any;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Load_SFNT_HeaderRec_Func load_sfnt_header;
|
||||
TT_Load_Directory_Func load_directory;
|
||||
#endif
|
||||
|
||||
/* 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_head;
|
||||
TT_Load_Metrics_Func load_hhea;
|
||||
TT_Load_Table_Func load_cmap;
|
||||
TT_Load_Table_Func load_maxp;
|
||||
TT_Load_Table_Func load_os2;
|
||||
TT_Load_Table_Func load_psnames;
|
||||
TT_Load_Table_Func load_post;
|
||||
|
||||
TT_Load_Table_Func load_names;
|
||||
TT_Free_Table_Func free_names;
|
||||
TT_Load_Table_Func load_name;
|
||||
TT_Free_Table_Func free_name;
|
||||
|
||||
/* optional tables */
|
||||
TT_Load_Table_Func load_hdmx;
|
||||
TT_Free_Table_Func free_hdmx;
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Load_Table_Func load_hdmx_stub;
|
||||
TT_Free_Table_Func free_hdmx_stub;
|
||||
#endif
|
||||
|
||||
/* this field was called `load_kerning' up to version 2.1.10 */
|
||||
TT_Load_Table_Func load_kern;
|
||||
|
||||
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 `ttload.h'; this field was called `load_bitmap_header' up to */
|
||||
/* version 2.1.10 */
|
||||
TT_Load_Table_Func load_bhed;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/* see `ttsbit.h' */
|
||||
TT_Set_SBit_Strike_Func set_sbit_strike;
|
||||
TT_Load_Table_Func load_sbits;
|
||||
TT_Set_SBit_Strike_OldFunc set_sbit_strike_stub;
|
||||
TT_Load_Table_Func load_sbits_stub;
|
||||
|
||||
/*
|
||||
* The following two fields appeared in version 2.1.8, and were placed
|
||||
* between `load_sbits' and `load_sbit_image'. We support them as a
|
||||
* special exception since they are used by Xfont library within the
|
||||
* X.Org xserver, and because the probability that other rogue clients
|
||||
* use the other version 2.1.7 fields below is _extremely_ low.
|
||||
*
|
||||
* Note that this forces us to disable an interesting memory-saving
|
||||
* optimization though...
|
||||
*/
|
||||
|
||||
TT_Find_SBit_Image_Func find_sbit_image;
|
||||
TT_Load_SBit_Metrics_Func load_sbit_metrics;
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
TT_Free_Table_Func free_sbits;
|
||||
|
||||
/* see `ttkern.h' */
|
||||
TT_Face_GetKerningFunc get_kerning;
|
||||
|
||||
#endif
|
||||
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Free_Table_Func free_sbits_stub;
|
||||
#endif
|
||||
|
||||
/* see `ttpost.h' */
|
||||
TT_Get_PS_Name_Func get_psname;
|
||||
TT_Free_Table_Func free_psnames;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_CharMap_Load_Func load_charmap_stub;
|
||||
TT_CharMap_Free_Func free_charmap_stub;
|
||||
#endif
|
||||
|
||||
/* starting here, the structure differs from version 2.1.7 */
|
||||
|
||||
/* this field was introduced in version 2.1.8, named `get_psname' */
|
||||
TT_Face_GetKerningFunc get_kerning;
|
||||
|
||||
/* new elements introduced after version 2.1.10 */
|
||||
|
||||
/* load the font directory, i.e., the offset table and */
|
||||
/* the table directory */
|
||||
TT_Load_Table_Func load_font_dir;
|
||||
TT_Load_Metrics_Func load_hmtx;
|
||||
|
||||
TT_Load_Table_Func load_eblc;
|
||||
TT_Free_Table_Func free_eblc;
|
||||
|
||||
TT_Set_SBit_Strike_Func set_sbit_strike;
|
||||
TT_Load_Strike_Metrics_Func load_strike_metrics;
|
||||
|
||||
TT_Get_Metrics_Func get_metrics;
|
||||
|
||||
} SFNT_Interface;
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Basic Type1/Type2 type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -129,6 +129,51 @@ FT_BEGIN_HEADER
|
||||
} CID_SubrsRec, *CID_Subrs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** AFM FONT INFORMATION STRUCTURES ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct AFM_TrackKernRec_
|
||||
{
|
||||
FT_Int degree;
|
||||
FT_Fixed min_ptsize;
|
||||
FT_Fixed min_kern;
|
||||
FT_Fixed max_ptsize;
|
||||
FT_Fixed max_kern;
|
||||
|
||||
} AFM_TrackKernRec, *AFM_TrackKern;
|
||||
|
||||
typedef struct AFM_KernPairRec_
|
||||
{
|
||||
FT_Int index1;
|
||||
FT_Int index2;
|
||||
FT_Int x;
|
||||
FT_Int y;
|
||||
|
||||
} AFM_KernPairRec, *AFM_KernPair;
|
||||
|
||||
typedef struct AFM_FontInfoRec_
|
||||
{
|
||||
FT_Bool IsCIDFont;
|
||||
FT_BBox FontBBox;
|
||||
FT_Fixed Ascender;
|
||||
FT_Fixed Descender;
|
||||
AFM_TrackKern TrackKerns; /* free if non-NULL */
|
||||
FT_Int NumTrackKern;
|
||||
AFM_KernPair KernPairs; /* free if non-NULL */
|
||||
FT_Int NumKernPair;
|
||||
|
||||
} AFM_FontInfoRec, *AFM_FontInfo;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
@@ -148,20 +193,23 @@ FT_BEGIN_HEADER
|
||||
|
||||
typedef struct T1_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
T1_FontRec type1;
|
||||
const void* psnames;
|
||||
const void* psaux;
|
||||
const void* afm_data;
|
||||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
PS_Unicodes unicode_map;
|
||||
FT_FaceRec root;
|
||||
T1_FontRec type1;
|
||||
const void* psnames;
|
||||
const void* psaux;
|
||||
const void* afm_data;
|
||||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
PS_Unicodes unicode_map;
|
||||
#endif
|
||||
|
||||
/* support for Multiple Masters fonts */
|
||||
PS_Blend blend;
|
||||
PS_Blend blend;
|
||||
|
||||
/* since FT 2.1 - interface to PostScript hinter */
|
||||
const void* pshinter;
|
||||
/* since version 2.1 - interface to PostScript hinter */
|
||||
const void* pshinter;
|
||||
|
||||
} T1_FaceRec;
|
||||
|
||||
@@ -173,13 +221,15 @@ FT_BEGIN_HEADER
|
||||
void* psaux;
|
||||
CID_FaceInfoRec cid;
|
||||
void* afm_data;
|
||||
FT_Byte* binary_data; /* used if hex data has been converted */
|
||||
FT_Stream cid_stream;
|
||||
CID_Subrs subrs;
|
||||
|
||||
/* since FT 2.1 - interface to PostScript hinter */
|
||||
/* since version 2.1 - interface to PostScript hinter */
|
||||
void* pshinter;
|
||||
|
||||
/* since version 2.1.8, but was originally positioned after `afm_data' */
|
||||
FT_Byte* binary_data; /* used if hex data has been converted */
|
||||
FT_Stream cid_stream;
|
||||
|
||||
} CID_FaceRec;
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Basic SFNT/TrueType type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -311,7 +311,7 @@ FT_BEGIN_HEADER
|
||||
} TT_GaspRec;
|
||||
|
||||
|
||||
#ifndef FT_OPTIMIZE_MEMORY
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@@ -389,7 +389,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
} TT_Kern0_PairRec, *TT_Kern0_Pair;
|
||||
|
||||
#endif /* !OPTIMIZE_MEMORY */
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -843,6 +843,72 @@ FT_BEGIN_HEADER
|
||||
typedef struct GX_BlendRec_ *GX_Blend;
|
||||
#endif
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* These types are used to support a `BDF ' table that isn't part of the
|
||||
* official TrueType specification. It is mainly used in SFNT-based
|
||||
* bitmap fonts that were generated from a set of BDF fonts.
|
||||
*
|
||||
* The format of the table is as follows.
|
||||
*
|
||||
* USHORT version `BDF ' table version number, should be 0x0001.
|
||||
* USHORT strikeCount Number of strikes (bitmap sizes) in this table.
|
||||
* ULONG stringTable Offset (froms start of BDF table) to string
|
||||
* table.
|
||||
*
|
||||
* This is followed by an array of `strikeCount' descriptors, having the
|
||||
* following format.
|
||||
*
|
||||
* USHORT ppem Vertical pixels per EM for this strike.
|
||||
* USHORT numItems Number of items for this strike (properties and
|
||||
* atoms). Maximum is 255.
|
||||
*
|
||||
* This array in turn is followed by `strikeCount' value sets. Each
|
||||
* `value set' is an array of `numItems' items with the following format.
|
||||
*
|
||||
* ULONG item_name Offset in string table to item name.
|
||||
* USHORT item_type The item type. Possible values are
|
||||
* 0 => string (e.g., COMMENT)
|
||||
* 1 => atom (e.g., FONT or even SIZE)
|
||||
* 2 => int32
|
||||
* 3 => uint32
|
||||
* 0x10 => A flag to indicate a properties. This
|
||||
* is ORed with the above values.
|
||||
* ULONG item_value For strings => Offset into string table without
|
||||
* the corresponding double quotes.
|
||||
* For atoms => Offset into string table.
|
||||
* For integers => Direct value.
|
||||
*
|
||||
* All strings in the string table consist of bytes and are
|
||||
* zero-terminated.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_BDF
|
||||
|
||||
typedef struct TT_BDFRec_
|
||||
{
|
||||
FT_Byte* table;
|
||||
FT_Byte* table_end;
|
||||
FT_Byte* strings;
|
||||
FT_UInt32 strings_size;
|
||||
FT_UInt num_strikes;
|
||||
FT_Bool loaded;
|
||||
|
||||
} TT_BDFRec, *TT_BDF;
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_BDF */
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
@@ -1036,10 +1102,6 @@ FT_BEGIN_HEADER
|
||||
/* table. We thus define additional fields */
|
||||
/* below to hold the computed maxima. */
|
||||
/* */
|
||||
/* max_components :: The maximum number of glyph components */
|
||||
/* required to load any composite glyph from */
|
||||
/* this font. Used to size the load stack. */
|
||||
/* */
|
||||
/* vertical_info :: A boolean which is set when the font file */
|
||||
/* contains vertical metrics. If not, the */
|
||||
/* value of the `vertical' field is */
|
||||
@@ -1205,20 +1267,14 @@ FT_BEGIN_HEADER
|
||||
|
||||
TT_Header header; /* TrueType header table */
|
||||
TT_HoriHeader horizontal; /* TrueType horizontal header */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* horz_metrics;
|
||||
FT_ULong horz_metrics_size;
|
||||
#endif
|
||||
|
||||
TT_MaxProfile max_profile;
|
||||
FT_ULong max_components;
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_ULong max_components; /* stubbed to 0 */
|
||||
#endif
|
||||
|
||||
FT_Bool vertical_info;
|
||||
TT_VertHeader vertical; /* TT Vertical header, if present */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* vert_metrics;
|
||||
FT_ULong vert_metrics_size;
|
||||
#endif
|
||||
|
||||
FT_UShort num_names; /* number of name records */
|
||||
TT_NameTableRec name_table; /* name table */
|
||||
@@ -1226,7 +1282,7 @@ FT_BEGIN_HEADER
|
||||
TT_OS2 os2; /* TrueType OS/2 table */
|
||||
TT_Postscript postscript; /* TrueType Postscript table */
|
||||
|
||||
FT_Byte* cmap_table; /* extracted 'cmap' table */
|
||||
FT_Byte* cmap_table; /* extracted `cmap' table */
|
||||
FT_ULong cmap_size;
|
||||
|
||||
TT_Loader_GotoTableFunc goto_table;
|
||||
@@ -1253,13 +1309,7 @@ FT_BEGIN_HEADER
|
||||
/***********************************************************************/
|
||||
|
||||
/* horizontal device metrics */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* hdmx_table;
|
||||
FT_ULong hdmx_table_size;
|
||||
FT_UInt hdmx_record_count;
|
||||
FT_ULong hdmx_record_size;
|
||||
FT_Byte* hdmx_record_sizes;
|
||||
#else
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_HdmxRec hdmx;
|
||||
#endif
|
||||
|
||||
@@ -1270,11 +1320,7 @@ FT_BEGIN_HEADER
|
||||
TT_PCLT pclt;
|
||||
|
||||
/* embedded bitmaps support */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* sbit_table;
|
||||
FT_ULong sbit_table_size;
|
||||
FT_UInt sbit_num_strikes;
|
||||
#else
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_ULong num_sbit_strikes;
|
||||
TT_SBit_Strike sbit_strikes;
|
||||
#endif
|
||||
@@ -1293,16 +1339,11 @@ FT_BEGIN_HEADER
|
||||
/***********************************************************************/
|
||||
|
||||
/* the glyph locations */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_UInt num_locations;
|
||||
FT_Byte* glyph_locations;
|
||||
#else
|
||||
FT_UShort num_locations;
|
||||
FT_Long* glyph_locations;
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_UShort num_locations_stub;
|
||||
FT_Long* glyph_locations_stub;
|
||||
#endif
|
||||
|
||||
FT_ULong glyf_len;
|
||||
|
||||
/* the font program, if any */
|
||||
FT_ULong font_program_size;
|
||||
FT_Byte* font_program;
|
||||
@@ -1315,13 +1356,7 @@ FT_BEGIN_HEADER
|
||||
FT_ULong cvt_size;
|
||||
FT_Short* cvt;
|
||||
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* kern_table;
|
||||
FT_ULong kern_table_size;
|
||||
FT_UInt num_kern_tables;
|
||||
FT_UInt32 kern_avail_bits;
|
||||
FT_UInt32 kern_order_bits;
|
||||
#else
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
/* the format 0 kerning table, if any */
|
||||
FT_Int num_kern_pairs;
|
||||
FT_Int kern_table_index;
|
||||
@@ -1337,11 +1372,6 @@ FT_BEGIN_HEADER
|
||||
FT_Bool unpatented_hinting;
|
||||
#endif
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
FT_Bool doblend;
|
||||
GX_Blend blend;
|
||||
#endif
|
||||
|
||||
/***********************************************************************/
|
||||
/* */
|
||||
/* Other tables or fields. This is used by derivative formats like */
|
||||
@@ -1353,6 +1383,49 @@ FT_BEGIN_HEADER
|
||||
|
||||
const char* postscript_name;
|
||||
|
||||
/* since version 2.1.8, but was originally placed after */
|
||||
/* `glyph_locations_stub' */
|
||||
FT_ULong glyf_len;
|
||||
|
||||
/* since version 2.1.8, but was originally placed before `extra' */
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
FT_Bool doblend;
|
||||
GX_Blend blend;
|
||||
#endif
|
||||
|
||||
/* since version 2.2 */
|
||||
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* horz_metrics;
|
||||
FT_ULong horz_metrics_size;
|
||||
|
||||
FT_Byte* vert_metrics;
|
||||
FT_ULong vert_metrics_size;
|
||||
|
||||
FT_UInt num_locations;
|
||||
FT_Byte* glyph_locations;
|
||||
|
||||
FT_Byte* hdmx_table;
|
||||
FT_ULong hdmx_table_size;
|
||||
FT_UInt hdmx_record_count;
|
||||
FT_ULong hdmx_record_size;
|
||||
FT_Byte* hdmx_record_sizes;
|
||||
|
||||
FT_Byte* sbit_table;
|
||||
FT_ULong sbit_table_size;
|
||||
FT_UInt sbit_num_strikes;
|
||||
|
||||
FT_Byte* kern_table;
|
||||
FT_ULong kern_table_size;
|
||||
FT_UInt num_kern_tables;
|
||||
FT_UInt32 kern_avail_bits;
|
||||
FT_UInt32 kern_order_bits;
|
||||
#endif
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_BDF
|
||||
TT_BDFRec bdf;
|
||||
#endif /* TT_CONFIG_OPTION_BDF */
|
||||
|
||||
} TT_FaceRec;
|
||||
|
||||
|
||||
@@ -1423,15 +1496,11 @@ FT_BEGIN_HEADER
|
||||
FT_BBox bbox;
|
||||
FT_Int left_bearing;
|
||||
FT_Int advance;
|
||||
FT_Int top_bearing;
|
||||
FT_Int vadvance;
|
||||
FT_Int linear;
|
||||
FT_Bool linear_def;
|
||||
FT_Bool preserve_pps;
|
||||
FT_Vector pp1;
|
||||
FT_Vector pp2;
|
||||
FT_Vector pp3;
|
||||
FT_Vector pp4;
|
||||
|
||||
FT_ULong glyf_offset;
|
||||
|
||||
@@ -1446,6 +1515,12 @@ FT_BEGIN_HEADER
|
||||
/* for possible extensibility in other formats */
|
||||
void* other;
|
||||
|
||||
/* since version 2.1.8 */
|
||||
FT_Int top_bearing;
|
||||
FT_Int vadvance;
|
||||
FT_Vector pp3;
|
||||
FT_Vector pp4;
|
||||
|
||||
} TT_LoaderRec;
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
|
||||
/* that for Multiple Master fonts, each instance has its own */
|
||||
/* FontInfo. */
|
||||
/* FontInfo dictionary. */
|
||||
/* */
|
||||
typedef struct PS_FontInfoRec
|
||||
{
|
||||
@@ -193,6 +193,8 @@ FT_BEGIN_HEADER
|
||||
|
||||
} T1_Blend_Flags;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*# backwards compatible definitions */
|
||||
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
|
||||
@@ -286,6 +288,14 @@ FT_BEGIN_HEADER
|
||||
typedef CID_FaceDictRec CID_FontDict;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* CID_FaceInfoRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to represent CID Face information. */
|
||||
/* */
|
||||
typedef struct CID_FaceInfoRec_
|
||||
{
|
||||
FT_String* cid_font_name;
|
||||
@@ -322,7 +332,7 @@ FT_BEGIN_HEADER
|
||||
/* CID_Info */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This type is equivalent to CID_FaceInfoRec. It is deprecated but */
|
||||
/* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
|
||||
/* kept to maintain source compatibility between various versions of */
|
||||
/* FreeType. */
|
||||
/* */
|
||||
@@ -381,7 +391,7 @@ FT_BEGIN_HEADER
|
||||
* the face and don't need to be freed by the caller.
|
||||
*
|
||||
* If the font's format is not Postscript-based, this function will
|
||||
* return the FT_Err_Invalid_Argument error code.
|
||||
* return the `FT_Err_Invalid_Argument' error code.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_PS_Font_Info( FT_Face face,
|
||||
@@ -413,7 +423,7 @@ FT_BEGIN_HEADER
|
||||
* the face and don't need to be freed by the caller.
|
||||
*
|
||||
* If the font's format is not Postscript-based, this function will
|
||||
* return the FT_Err_Invalid_Argument error code.
|
||||
* return the `FT_Err_Invalid_Argument' error code.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_PS_Font_Private( FT_Face face,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* TrueType name ID definitions (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -65,7 +65,7 @@ FT_BEGIN_HEADER
|
||||
* Used by Microsoft to indicate Windows-specific charmaps. See
|
||||
* @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
|
||||
* Note that most fonts contain a Unicode charmap using
|
||||
* (@TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
|
||||
* (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
|
||||
*
|
||||
* TT_PLATFORM_CUSTOM ::
|
||||
* Used to indicate application-specific charmaps.
|
||||
@@ -96,14 +96,18 @@ FT_BEGIN_HEADER
|
||||
* @values:
|
||||
* TT_APPLE_ID_DEFAULT ::
|
||||
* Unicode version 1.0.
|
||||
*
|
||||
* TT_APPLE_ID_UNICODE_1_1 ::
|
||||
* Unicode 1.1; specifies Hangul characters starting at U+34xx.
|
||||
*
|
||||
* TT_APPLE_ID_ISO_10646 ::
|
||||
* Deprecated (identical to preceding.)
|
||||
* Deprecated (identical to preceding).
|
||||
*
|
||||
* TT_APPLE_ID_UNICODE_2_0 ::
|
||||
* Unicode 2.0 and beyond (UTF-16 BMP only.)
|
||||
* Unicode 2.0 and beyond (UTF-16 BMP only).
|
||||
*
|
||||
* TT_APPLE_ID_UNICODE_32 ::
|
||||
* Unicode 3.1 and beyond, using UTF-32
|
||||
* Unicode 3.1 and beyond, using UTF-32.
|
||||
*/
|
||||
|
||||
#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
|
||||
@@ -491,7 +495,7 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
|
||||
#endif
|
||||
|
||||
#if 0 /* used only with .NET "cultures"; commented out */
|
||||
#if 0 /* used only with .NET `cultures'; commented out */
|
||||
#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Basic SFNT/TrueType tables definitions and interface */
|
||||
/* (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -407,9 +407,9 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType Postscript table. All fields */
|
||||
/* comply to the TrueType table. This structure does not reference */
|
||||
/* the Postscript glyph names, which can be nevertheless accessed */
|
||||
/* with the `ttpost' module. */
|
||||
/* comply to the TrueType specification. This structure does not */
|
||||
/* reference the Postscript glyph names, which can be nevertheless */
|
||||
/* accessed with the `ttpost' module. */
|
||||
/* */
|
||||
typedef struct TT_Postscript_
|
||||
{
|
||||
@@ -436,7 +436,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType PCLT table. All fields */
|
||||
/* comply to the TrueType table. */
|
||||
/* comply to the TrueType specification. */
|
||||
/* */
|
||||
typedef struct TT_PCLT_
|
||||
{
|
||||
@@ -594,8 +594,8 @@ FT_BEGIN_HEADER
|
||||
/* The table is owned by the face object and disappears with it. */
|
||||
/* */
|
||||
/* This function is only useful to access SFNT tables that are loaded */
|
||||
/* by the sfnt/truetype/opentype drivers. See @FT_Sfnt_Tag for a */
|
||||
/* list. */
|
||||
/* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
|
||||
/* a list. */
|
||||
/* */
|
||||
FT_EXPORT( void* )
|
||||
FT_Get_Sfnt_Table( FT_Face face,
|
||||
@@ -604,56 +604,61 @@ FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* <Function>
|
||||
* FT_Load_Sfnt_Table
|
||||
* @function:
|
||||
* FT_Load_Sfnt_Table
|
||||
*
|
||||
* <Description>
|
||||
* @description:
|
||||
* Loads any font table into client memory.
|
||||
*
|
||||
* <Input>
|
||||
* face :: A handle to the source face.
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the source face.
|
||||
*
|
||||
* tag :: The 4-byte tag of the table to load. Use the value 0 if
|
||||
* you want to access the whole font file. Otherwise, you can
|
||||
* use one of the definitions found in the @FT_TRUETYPE_TAGS_H
|
||||
* file, or forge a new one with @FT_MAKE_TAG.
|
||||
* tag ::
|
||||
* The four-byte tag of the table to load. Use the value 0 if you want
|
||||
* to access the whole font file. Otherwise, you can use one of the
|
||||
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
|
||||
* one with @FT_MAKE_TAG.
|
||||
*
|
||||
* offset :: The starting offset in the table (or file if tag == 0).
|
||||
* offset ::
|
||||
* The starting offset in the table (or file if tag == 0).
|
||||
*
|
||||
* <Output>
|
||||
* buffer :: The target buffer address. The client must ensure that
|
||||
* the memory array is big enough to hold the data.
|
||||
* @output:
|
||||
* buffer ::
|
||||
* The target buffer address. The client must ensure that the memory
|
||||
* array is big enough to hold the data.
|
||||
*
|
||||
* <InOut>
|
||||
* length :: If the `length' parameter is NULL, then try to load the whole
|
||||
* table. Return an error code if it fails.
|
||||
* @inout:
|
||||
* length ::
|
||||
* If the `length' parameter is NULL, then try to load the whole table.
|
||||
* Return an error code if it fails.
|
||||
*
|
||||
* Else, if `*length' is 0, exit immediately while returning
|
||||
* the table's (or file) full size in it.
|
||||
* Else, if `*length' is 0, exit immediately while returning the
|
||||
* table's (or file) full size in it.
|
||||
*
|
||||
* Else the number of bytes to read from the table or file,
|
||||
* from the starting offset.
|
||||
* Else the number of bytes to read from the table or file, from the
|
||||
* starting offset.
|
||||
*
|
||||
* <Return>
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* <Note>
|
||||
* @note:
|
||||
* If you need to determine the table's length you should first call this
|
||||
* function with `*length' set to 0, as in the following example:
|
||||
*
|
||||
* {
|
||||
* FT_ULong length = 0;
|
||||
* {
|
||||
* FT_ULong length = 0;
|
||||
*
|
||||
*
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
|
||||
* if ( error ) { ... table does not exist ... }
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
|
||||
* if ( error ) { ... table does not exist ... }
|
||||
*
|
||||
* buffer = malloc( length );
|
||||
* if ( buffer == NULL ) { ... not enough memory ... }
|
||||
* buffer = malloc( length );
|
||||
* if ( buffer == NULL ) { ... not enough memory ... }
|
||||
*
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
|
||||
* if ( error ) { ... could not load table ... }
|
||||
* }
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
|
||||
* if ( error ) { ... could not load table ... }
|
||||
* }
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Load_Sfnt_Table( FT_Face face,
|
||||
@@ -665,13 +670,13 @@ FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* <Function>
|
||||
* FT_Sfnt_Table_Info
|
||||
* @function:
|
||||
* FT_Sfnt_Table_Info
|
||||
*
|
||||
* <Description>
|
||||
* @description:
|
||||
* Returns information on an SFNT table.
|
||||
*
|
||||
* <Input>
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the source face.
|
||||
*
|
||||
@@ -679,17 +684,17 @@ FT_BEGIN_HEADER
|
||||
* The index of an SFNT table. The function returns
|
||||
* FT_Err_Table_Missing for an invalid value.
|
||||
*
|
||||
* <Output>
|
||||
* @output:
|
||||
* tag ::
|
||||
* The name tag of the SFNT table.
|
||||
*
|
||||
* length ::
|
||||
* The length of the SFNT table.
|
||||
*
|
||||
* <Return>
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* <Note>
|
||||
* @note:
|
||||
* SFNT tables with length zero are treated as missing by Windows.
|
||||
*
|
||||
*/
|
||||
@@ -707,7 +712,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return TrueType/sfnt specific cmap language ID. Definitions of */
|
||||
/* language ID values are in freetype/ttnameid.h. */
|
||||
/* language ID values are in `freetype/ttnameid.h'. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* charmap :: */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Tags for TrueType and OpenType tables (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2004 by */
|
||||
/* Copyright 1996-2001, 2004, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -36,8 +36,10 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
|
||||
#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
|
||||
#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
|
||||
#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
|
||||
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
|
||||
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
|
||||
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
|
||||
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
|
||||
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
|
||||
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
|
||||
@@ -46,6 +48,7 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
|
||||
#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
|
||||
#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
|
||||
#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
|
||||
#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
|
||||
#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
|
||||
#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
|
||||
@@ -59,18 +62,27 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
|
||||
#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
|
||||
#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
|
||||
#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' )
|
||||
#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
|
||||
#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
|
||||
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
|
||||
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
|
||||
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
|
||||
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
|
||||
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
|
||||
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
|
||||
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
|
||||
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
|
||||
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
|
||||
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
|
||||
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
|
||||
#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
|
||||
#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
|
||||
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
|
||||
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
|
||||
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
|
||||
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
|
||||
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
|
||||
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
|
||||
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
|
||||
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Definitions for the unpatented TrueType hinting system */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* Written by Graham Asher <[email protected]> */
|
||||
@@ -43,7 +43,7 @@ FT_BEGIN_HEADER
|
||||
* @description:
|
||||
* A constant used as the tag of an @FT_Parameter structure to indicate
|
||||
* that unpatented methods only should be used by the TrueType bytecode
|
||||
* interpreter for a typeface opened by FT_Open_Face.
|
||||
* interpreter for a typeface opened by @FT_Open_Face.
|
||||
*
|
||||
*/
|
||||
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* FreeType 2 build and setup macros. */
|
||||
/* (Generic version) */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file corresponds to the default "ft2build.h" file for */
|
||||
/* FreeType 2. It uses the "freetype" include root. */
|
||||
/* This file corresponds to the default `ft2build.h' file for */
|
||||
/* FreeType 2. It uses the `freetype' include root. */
|
||||
/* */
|
||||
/* Note that specific platforms might use a different configuration. */
|
||||
/* See builds/unix/ft2unix.h for an example. */
|
||||
|
||||
Reference in New Issue
Block a user