20 #include FT_FREETYPE_H 23 #include FT_INTERNAL_MEMORY_H 24 #include FT_INTERNAL_OBJECTS_H 25 #include FT_INTERNAL_DEBUG_H 31 #define FT_COMPONENT trace_cache 34 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 36 typedef enum FTC_OldCMapType_
38 FTC_OLD_CMAP_BY_INDEX = 0,
39 FTC_OLD_CMAP_BY_ENCODING = 1,
40 FTC_OLD_CMAP_BY_ID = 2
45 typedef struct FTC_OldCMapIdRec_
50 } FTC_OldCMapIdRec, *FTC_OldCMapId;
53 typedef struct FTC_OldCMapDescRec_
66 } FTC_OldCMapDescRec, *FTC_OldCMapDesc;
86 #define FTC_CMAP_INDICES_MAX 128 89 #define FTC_CMAP_HASH( faceid, index, charcode ) \ 90 ( _FTC_FACE_ID_HASH( faceid ) + 211 * (index) + \ 91 ( (charcode) / FTC_CMAP_INDICES_MAX ) ) 94 typedef struct FTC_CMapQueryRec_
102 #define FTC_CMAP_QUERY( x ) ((FTC_CMapQuery)(x)) 103 #define FTC_CMAP_QUERY_HASH( x ) \ 104 FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->char_code ) 107 typedef struct FTC_CMapNodeRec_
117 #define FTC_CMAP_NODE( x ) ( (FTC_CMapNode)( x ) ) 118 #define FTC_CMAP_NODE_HASH( x ) \ 119 FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->first ) 123 #define FTC_CMAP_UNKNOWN (FT_UInt16)~0 163 node->face_id =
query->face_id;
164 node->cmap_index =
query->cmap_index;
185 return sizeof ( *cnode );
202 *list_changed =
FALSE;
203 if ( node->face_id ==
query->face_id &&
204 node->cmap_index ==
query->cmap_index )
228 *list_changed =
FALSE;
229 return FT_BOOL( node->face_id == face_id );
264 &ftc_cmap_cache_class,
269 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 298 FT_Int no_cmap_change = 0;
301 if ( cmap_index < 0 )
314 FT_TRACE0((
"FTC_CMapCache_Lookup: bad arguments, returning 0\n" ));
318 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 325 if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE && !no_cmap_change )
327 FTC_OldCMapDesc desc = (FTC_OldCMapDesc) face_id;
331 query.face_id = desc->face_id;
334 switch ( desc->type )
336 case FTC_OLD_CMAP_BY_INDEX:
337 query.cmap_index = desc->u.index;
341 case FTC_OLD_CMAP_BY_ENCODING:
365 query.face_id = face_id;
367 query.char_code = char_code;
376 error = FTC_Cache_Lookup( cache, hash, &
query, &node );
404 #ifdef FT_MAX_CHARMAP_CACHEABLE 406 if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE )
418 if ( old != cmap && !no_cmap_change )
423 if ( old != cmap && !no_cmap_change )
struct FTC_CMapCacheRec_ * FTC_CMapCache
ftc_cmap_node_new(FTC_Node *ftcanode, FT_Pointer ftcquery, FTC_Cache cache)
ftc_cmap_node_weight(FTC_Node cnode, FTC_Cache cache)
struct FTC_CMapQueryRec_ FTC_CMapQueryRec
FTC_CMapCache_Lookup(FTC_CMapCache cmap_cache, FTC_FaceID face_id, FT_Int cmap_index, FT_UInt32 char_code)
FT_CALLBACK_TABLE_DEF const FTC_CacheClassRec ftc_cmap_cache_class
ftc_cmap_node_compare(FTC_Node ftcnode, FT_Pointer ftcquery, FTC_Cache cache, FT_Bool *list_changed)
struct FTC_CMapNodeRec_ * FTC_CMapNode
#define FTC_CMAP_INDICES_MAX
ftc_cmap_node_free(FTC_Node ftcnode, FTC_Cache cache)
FT_BEGIN_HEADER typedef FT_Pointer FTC_FaceID
ftc_cache_init(FTC_Cache cache)
struct FTC_CMapQueryRec_ * FTC_CMapQuery
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum GLuint GLint GLenum face
#define FT_ASSERT(condition)
FTC_Manager_RegisterCache(FTC_Manager manager, FTC_CacheClass clazz, FTC_Cache *acache)
FT_Get_Char_Index(FT_Face face, FT_ULong charcode)
FT_Select_Charmap(FT_Face face, FT_Encoding encoding)
#define FTC_CMAP_HASH(faceid, index, charcode)
#define FT_CALLBACK_DEF(x)
FTC_CMapCache_New(FTC_Manager manager, FTC_CMapCache *acache)
enum FT_Encoding_ FT_Encoding
FT_Set_Charmap(FT_Face face, FT_CharMap charmap)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
struct FTC_CacheRec_ FTC_CacheRec
#define FTC_CACHE_LOOKUP_CMP(cache, nodecmp, hash, query, node, error)
#define FT_CALLBACK_TABLE_DEF
struct FTC_CMapNodeRec_ FTC_CMapNodeRec
GLuint GLuint GLsizei GLenum const GLvoid * indices
FT_TRACE0(("cff_property_set: missing property `%s'\, property_name))
ftc_cache_done(FTC_Cache cache)
FTC_Manager_LookupFace(FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface)
ftc_cmap_node_remove_faceid(FTC_Node ftcnode, FT_Pointer ftcface_id, FTC_Cache cache, FT_Bool *list_changed)