2000-08-23 23:11:13 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftcache.h */
|
|
|
|
/* */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* FreeType Cache subsystem (specification). */
|
2000-08-23 23:11:13 +02:00
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
2000-08-23 23:11:13 +02:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
|
2000-10-12 07:05:40 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/********* *********/
|
2000-11-08 01:24:58 +01:00
|
|
|
/********* WARNING, THIS IS BETA CODE. *********/
|
2000-10-12 07:05:40 +02:00
|
|
|
/********* *********/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-08-30 23:40:45 +02:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
#ifndef __FTCACHE_H__
|
|
|
|
#define __FTCACHE_H__
|
2000-08-23 23:11:13 +02:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_GLYPH_H
|
|
|
|
|
2000-10-12 07:05:40 +02:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
FT_BEGIN_HEADER
|
2000-08-23 23:11:13 +02:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
2001-01-11 10:27:49 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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 */
|
|
|
|
/* stile in beta. */
|
|
|
|
/* */
|
2001-12-05 16:59:33 +01:00
|
|
|
/* <Order> */
|
|
|
|
/* FTC_Manager */
|
|
|
|
/* FTC_FaceID */
|
|
|
|
/* FTC_Face_Requester */
|
|
|
|
/* */
|
|
|
|
/* FTC_Manager_New */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* FTC_Manager_LookupFace */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* FTC_Manager_LookupSize */
|
2001-12-05 16:59:33 +01:00
|
|
|
/* */
|
|
|
|
/* FTC_Node */
|
2001-12-16 09:17:33 +01:00
|
|
|
/* FTC_Node_Ref */
|
2001-12-05 16:59:33 +01:00
|
|
|
/* FTC_Node_Unref */
|
|
|
|
/* */
|
|
|
|
/* FTC_Font */
|
|
|
|
/* FTC_ImageCache */
|
|
|
|
/* FTC_ImageCache_New */
|
|
|
|
/* FTC_ImageCache_Lookup */
|
|
|
|
/* */
|
|
|
|
/* FTC_SBit */
|
|
|
|
/* FTC_SBitCache */
|
|
|
|
/* FTC_SBitCache_New */
|
|
|
|
/* FTC_SBitCache_Lookup */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* FTC_Image_Desc */
|
|
|
|
/* FTC_Image_Cache */
|
|
|
|
/* FTC_Image_Cache_Lookup */
|
|
|
|
/* */
|
|
|
|
/* FTC_SBit_Cache */
|
2001-12-16 09:17:33 +01:00
|
|
|
/* FTC_SBit_Cache_Lookup */
|
2001-12-05 16:59:33 +01:00
|
|
|
/* */
|
2001-01-11 10:27:49 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-08-23 23:11:13 +02:00
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** BASIC TYPE DEFINITIONS *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
2000-08-23 23:11:13 +02:00
|
|
|
|
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FTC_FaceID */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
* include/freetype/ftcache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftccache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftcmru.h (added),
include/freetype/cache/ftlru.h (removed),
include/freetype/cache/ftcsbits.h,
include/freetype/cache/ftcimage.h,
include/freetype/cache/ftcglyph.h,
src/cache/ftcmru.c,
src/cache/ftcmanag.c,
src/cache/ftccache.c,
src/cache/ftcglyph.c,
src/cache/ftcimage.c,
src/cache/ftcsbits.c,
src/cache/ftccmap.c,
src/cache/ftcbasic.c (added),
src/cache/ftclru.c (removed):
*Complete* rewrite of the cache sub-system to "solve" the
following points:
- all public APIs have been moved to FT_CACHE_H, everything
under "include/freetype/cache" is only needed by client
applications that want to implement their own caches
- a new function named FTC_Manager_RemoveFaceID to deal
with the uninstallation of FaceIDs
- the image and sbit cache are now abstract classes, that
can be extended much more easily by client applications
- better performance in certain areas. Further optimizations
to come shortly anyway...
- the FTC_CMapCache_Lookup function has changed its signature,
charmaps can now only be retrieved by index
- FTC_Manager_Lookup_Face => FTC_Manager_LookupFace
FTC_Manager_Lookup_Size => FTC_Manager_LookupSize (still in
private header for the moment)
2003-12-22 22:53:37 +01:00
|
|
|
/* An opaque pointer type that is used to identity face objects. The */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* contents of such objects is application-dependent. */
|
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
typedef struct FTC_FaceIDRec_* FTC_FaceID;
|
2000-08-23 23:11:13 +02:00
|
|
|
|
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <FuncType> */
|
|
|
|
/* FTC_Face_Requester */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A callback function provided by client applications. It is used */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* to translate a given @FTC_FaceID into a new valid @FT_Face object. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face_id :: The face ID to resolve. */
|
|
|
|
/* */
|
|
|
|
/* library :: A handle to a FreeType library object. */
|
|
|
|
/* */
|
|
|
|
/* data :: Application-provided request data. */
|
|
|
|
/* */
|
|
|
|
/* <Output> */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* aface :: A new @FT_Face handle. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
2000-10-29 01:34:45 +02:00
|
|
|
/* <Note> */
|
2000-10-31 18:49:07 +01:00
|
|
|
/* The face requester should not perform funny things on the returned */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* face object, like creating a new @FT_Size for it, or setting a */
|
|
|
|
/* transformation through @FT_Set_Transform! */
|
2000-10-29 01:34:45 +02:00
|
|
|
/* */
|
2001-06-28 09:17:51 +02:00
|
|
|
typedef FT_Error
|
|
|
|
(*FTC_Face_Requester)( FTC_FaceID face_id,
|
|
|
|
FT_Library library,
|
|
|
|
FT_Pointer request_data,
|
|
|
|
FT_Face* aface );
|
2000-08-23 23:11:13 +02:00
|
|
|
|
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
2000-09-16 00:50:59 +02:00
|
|
|
/* FTC_FontRec */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-09-16 00:50:59 +02:00
|
|
|
/* A simple structure used to describe a given `font' to the cache */
|
2000-10-12 07:05:40 +02:00
|
|
|
/* manager. Note that a `font' is the combination of a given face */
|
|
|
|
/* with a given character size. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <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. */
|
|
|
|
/* */
|
2000-09-16 00:50:59 +02:00
|
|
|
typedef struct FTC_FontRec_
|
2000-08-23 23:11:13 +02:00
|
|
|
{
|
|
|
|
FTC_FaceID face_id;
|
|
|
|
FT_UShort pix_width;
|
|
|
|
FT_UShort pix_height;
|
2000-10-12 07:05:40 +02:00
|
|
|
|
2000-09-16 00:50:59 +02:00
|
|
|
} FTC_FontRec;
|
2000-08-23 23:11:13 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
|
2001-12-20 18:49:10 +01:00
|
|
|
/* */
|
|
|
|
|
2001-10-26 18:58:27 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
#define FTC_FONT_COMPARE( f1, f2 ) \
|
|
|
|
( (f1)->face_id == (f2)->face_id && \
|
|
|
|
(f1)->pix_width == (f2)->pix_width && \
|
|
|
|
(f1)->pix_height == (f2)->pix_height )
|
|
|
|
|
2002-10-25 14:22:31 +02:00
|
|
|
#define FT_POINTER_TO_ULONG( p ) ((FT_ULong)(FT_Pointer)(p))
|
|
|
|
|
|
|
|
#define FTC_FACE_ID_HASH( i ) \
|
|
|
|
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
|
|
|
|
( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
|
2001-10-26 18:58:27 +02:00
|
|
|
|
2001-12-05 02:22:05 +01:00
|
|
|
#define FTC_FONT_HASH( f ) \
|
|
|
|
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
|
|
|
|
((f)->pix_width << 8) ^ \
|
|
|
|
((f)->pix_height) )
|
2001-10-26 18:58:27 +02:00
|
|
|
|
2001-12-20 18:49:10 +01:00
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
2000-09-16 00:50:59 +02:00
|
|
|
/* FTC_Font */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* A simple handle to an @FTC_FontRec structure. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2000-09-16 00:50:59 +02:00
|
|
|
typedef FTC_FontRec* FTC_Font;
|
2000-10-12 07:05:40 +02:00
|
|
|
|
2000-08-23 23:11:13 +02:00
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** CACHE MANAGER OBJECT *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FTC_Manager */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* This object is used to cache one or more @FT_Face objects, along */
|
|
|
|
/* with corresponding @FT_Size objects. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2000-08-23 23:11:13 +02:00
|
|
|
typedef struct FTC_ManagerRec_* FTC_Manager;
|
|
|
|
|
|
|
|
|
2001-12-05 16:59:33 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FTC_Node */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* An opaque handle to a cache node object. Each cache node is */
|
|
|
|
/* reference-counted. A node with a count of 0 might be flushed */
|
|
|
|
/* out of a full cache whenever a lookup request is performed. */
|
2001-12-05 16:59:33 +01:00
|
|
|
/* */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* 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" */
|
2003-07-25 07:57:21 +02:00
|
|
|
/* it (see @FTC_Node_Unref). */
|
2001-12-05 16:59:33 +01:00
|
|
|
/* */
|
2003-07-25 07:57:21 +02:00
|
|
|
/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
|
2001-12-05 16:59:33 +01:00
|
|
|
/* */
|
2001-12-20 18:49:10 +01:00
|
|
|
typedef struct FTC_NodeRec_* FTC_Node;
|
2001-12-05 16:59:33 +01:00
|
|
|
|
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_Manager_New */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Creates a new cache manager. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* library :: The parent FreeType library handle to use. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* max_bytes :: Maximum number of bytes to use for cached data. */
|
|
|
|
/* Use 0 for defaults. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* requester :: An application-provided callback used to translate */
|
|
|
|
/* face IDs into real @FT_Face objects. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* req_data :: A generic pointer that is passed to the requester */
|
|
|
|
/* each time it is called (see @FTC_Face_Requester). */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* amanager :: A handle to a new manager object. 0 in case of */
|
|
|
|
/* failure. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FTC_Manager_New( FT_Library library,
|
|
|
|
FT_UInt max_faces,
|
|
|
|
FT_UInt max_sizes,
|
|
|
|
FT_ULong max_bytes,
|
|
|
|
FTC_Face_Requester requester,
|
|
|
|
FT_Pointer req_data,
|
|
|
|
FTC_Manager *amanager );
|
2000-08-23 23:11:13 +02:00
|
|
|
|
2000-10-12 07:05:40 +02:00
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_Manager_Reset */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Empties a given cache manager. This simply gets rid of all the */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* currently cached @FT_Face and @FT_Size objects within the manager. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* <InOut> */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* manager :: A handle to the manager. */
|
|
|
|
/* */
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FTC_Manager_Reset( FTC_Manager manager );
|
2000-08-24 18:29:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_Manager_Done */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Destroys a given manager after emptying it. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* manager :: A handle to the target cache manager object. */
|
|
|
|
/* */
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FTC_Manager_Done( FTC_Manager manager );
|
2000-08-24 18:29:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* FTC_Manager_LookupFace */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* Retrieves the @FT_Face object that corresponds to a given face ID */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* through a cache manager. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* manager :: A handle to the cache manager. */
|
|
|
|
/* */
|
|
|
|
/* face_id :: The ID of the face object. */
|
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* aface :: A handle to the face object. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* The returned @FT_Face object is always owned by the manager. You */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* should never try to discard it yourself. */
|
|
|
|
/* */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* The @FT_Face object doesn't necessarily have a current size object */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* (i.e., face->size can be 0). If you need a specific `font size', */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* use @FTC_Manager_LookupSize instead. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* Never change the face's transformation matrix (i.e., never call */
|
2001-12-20 18:49:10 +01:00
|
|
|
/* the @FT_Set_Transform function) on a returned face! If you need */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* to transform glyphs, do it yourself after glyph loading. */
|
|
|
|
/* */
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2003-12-19 22:23:58 +01:00
|
|
|
FTC_Manager_LookupFace( FTC_Manager manager,
|
2003-12-26 08:26:08 +01:00
|
|
|
FTC_FaceID face_id,
|
|
|
|
FT_Face *aface );
|
2000-10-12 07:05:40 +02:00
|
|
|
|
2000-08-23 23:11:13 +02:00
|
|
|
|
2004-01-16 10:07:59 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FTC_ScalerRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to describe a given character size in either */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* pixels or points to the cache manager. See */
|
|
|
|
/* @FTC_Manager_LookupSize. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* face_id :: The source face ID. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* width :: The character width. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* height :: The character height. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* pixel :: A Boolean. If TRUE, the `width' and `height' fields */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* are interpreted as integer pixel character sizes. */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* Otherwise, they are expressed as 1/64th of points. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* x_res :: Only used when `pixel' is FALSE to indicate the */
|
|
|
|
/* horizontal resolution in dpi. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* y_res :: Only used when `pixel' is FALSE to indicate the */
|
|
|
|
/* vertical resolution in dpi. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This type is mainly used to retrieve @FT_Size objects through the */
|
|
|
|
/* cache manager. */
|
|
|
|
/* */
|
|
|
|
typedef struct FTC_ScalerRec_
|
|
|
|
{
|
|
|
|
FTC_FaceID face_id;
|
|
|
|
FT_UInt width;
|
|
|
|
FT_UInt height;
|
|
|
|
FT_Int pixel;
|
|
|
|
FT_UInt x_res;
|
|
|
|
FT_UInt y_res;
|
|
|
|
|
|
|
|
} FTC_ScalerRec, *FTC_Scaler;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_Manager_LookupSize */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* Retrieve the @FT_Size object that corresponds to a given */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* @FTC_Scaler through a cache manager. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* manager :: A handle to the cache manager. */
|
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* scaler :: A scaler handle. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* asize :: A handle to the size object. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The returned @FT_Size object is always owned by the manager. You */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* should never try to discard it by yourself. */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* */
|
2004-01-22 10:07:12 +01:00
|
|
|
/* You can access the parent @FT_Face object simply as `size->face' */
|
|
|
|
/* if you need it. Note that this object is also owned by the */
|
2004-01-16 10:07:59 +01:00
|
|
|
/* manager. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FTC_Manager_LookupSize( FTC_Manager manager,
|
|
|
|
FTC_Scaler scaler,
|
|
|
|
FT_Size *asize );
|
|
|
|
|
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* FTC_Node_Unref */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* Decrement a cache node's internal reference count. When the count */
|
|
|
|
/* reaches 0, it is not destroyed but becomes eligible for subsequent */
|
|
|
|
/* cache flushes. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* node :: The cache node handle. */
|
|
|
|
/* */
|
|
|
|
/* manager :: The cache manager handle. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( void )
|
|
|
|
FTC_Node_Unref( FTC_Node node,
|
|
|
|
FTC_Manager manager );
|
|
|
|
|
|
|
|
|
2003-12-26 08:26:08 +01:00
|
|
|
/* remove all nodes belonging to a given face_id */
|
2003-12-19 22:23:58 +01:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FTC_Manager_RemoveFaceID( FTC_Manager manager,
|
2003-12-26 08:26:08 +01:00
|
|
|
FTC_FaceID face_id );
|
2003-12-19 22:23:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* @function: */
|
|
|
|
/* FTC_CMapCache_New */
|
|
|
|
/* */
|
|
|
|
/* @description: */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* Create a new charmap cache. */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
|
|
|
/* @input: */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* manager :: A handle to the cache manager. */
|
|
|
|
/* */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* @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 );
|
|
|
|
|
|
|
|
|
2003-12-26 08:26:08 +01:00
|
|
|
/* retrieve the index of a given charmap */
|
* include/freetype/ftcache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftccache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftcmru.h (added),
include/freetype/cache/ftlru.h (removed),
include/freetype/cache/ftcsbits.h,
include/freetype/cache/ftcimage.h,
include/freetype/cache/ftcglyph.h,
src/cache/ftcmru.c,
src/cache/ftcmanag.c,
src/cache/ftccache.c,
src/cache/ftcglyph.c,
src/cache/ftcimage.c,
src/cache/ftcsbits.c,
src/cache/ftccmap.c,
src/cache/ftcbasic.c (added),
src/cache/ftclru.c (removed):
*Complete* rewrite of the cache sub-system to "solve" the
following points:
- all public APIs have been moved to FT_CACHE_H, everything
under "include/freetype/cache" is only needed by client
applications that want to implement their own caches
- a new function named FTC_Manager_RemoveFaceID to deal
with the uninstallation of FaceIDs
- the image and sbit cache are now abstract classes, that
can be extended much more easily by client applications
- better performance in certain areas. Further optimizations
to come shortly anyway...
- the FTC_CMapCache_Lookup function has changed its signature,
charmaps can now only be retrieved by index
- FTC_Manager_Lookup_Face => FTC_Manager_LookupFace
FTC_Manager_Lookup_Size => FTC_Manager_LookupSize (still in
private header for the moment)
2003-12-22 22:53:37 +01:00
|
|
|
FT_EXPORT( FT_Int )
|
2003-12-19 22:23:58 +01:00
|
|
|
FT_Get_CharMap_Index( FT_CharMap charmap );
|
|
|
|
|
2003-12-26 08:26:08 +01:00
|
|
|
|
2003-12-19 22:23:58 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* @function: */
|
|
|
|
/* FTC_CMapCache_Lookup */
|
|
|
|
/* */
|
|
|
|
/* @description: */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* Translate a character code into a glyph index, using the charmap */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* cache. */
|
|
|
|
/* */
|
|
|
|
/* @input: */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* cache :: A charmap cache handle. */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
* include/freetype/ftcache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftccache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftcmru.h (added),
include/freetype/cache/ftlru.h (removed),
include/freetype/cache/ftcsbits.h,
include/freetype/cache/ftcimage.h,
include/freetype/cache/ftcglyph.h,
src/cache/ftcmru.c,
src/cache/ftcmanag.c,
src/cache/ftccache.c,
src/cache/ftcglyph.c,
src/cache/ftcimage.c,
src/cache/ftcsbits.c,
src/cache/ftccmap.c,
src/cache/ftcbasic.c (added),
src/cache/ftclru.c (removed):
*Complete* rewrite of the cache sub-system to "solve" the
following points:
- all public APIs have been moved to FT_CACHE_H, everything
under "include/freetype/cache" is only needed by client
applications that want to implement their own caches
- a new function named FTC_Manager_RemoveFaceID to deal
with the uninstallation of FaceIDs
- the image and sbit cache are now abstract classes, that
can be extended much more easily by client applications
- better performance in certain areas. Further optimizations
to come shortly anyway...
- the FTC_CMapCache_Lookup function has changed its signature,
charmaps can now only be retrieved by index
- FTC_Manager_Lookup_Face => FTC_Manager_LookupFace
FTC_Manager_Lookup_Size => FTC_Manager_LookupSize (still in
private header for the moment)
2003-12-22 22:53:37 +01:00
|
|
|
/* face_id :: source face id */
|
|
|
|
/* */
|
|
|
|
/* cmap_index :: index of charmap in source face */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* char_code :: The character code (in the corresponding charmap). */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
|
|
|
/* @return: */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* Glyph index. 0 means `no glyph'. */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_UInt )
|
|
|
|
FTC_CMapCache_Lookup( FTC_CMapCache cache,
|
|
|
|
FTC_FaceID face_id,
|
* include/freetype/ftcache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftccache.h,
include/freetype/cache/ftcmanag.h,
include/freetype/cache/ftcmru.h (added),
include/freetype/cache/ftlru.h (removed),
include/freetype/cache/ftcsbits.h,
include/freetype/cache/ftcimage.h,
include/freetype/cache/ftcglyph.h,
src/cache/ftcmru.c,
src/cache/ftcmanag.c,
src/cache/ftccache.c,
src/cache/ftcglyph.c,
src/cache/ftcimage.c,
src/cache/ftcsbits.c,
src/cache/ftccmap.c,
src/cache/ftcbasic.c (added),
src/cache/ftclru.c (removed):
*Complete* rewrite of the cache sub-system to "solve" the
following points:
- all public APIs have been moved to FT_CACHE_H, everything
under "include/freetype/cache" is only needed by client
applications that want to implement their own caches
- a new function named FTC_Manager_RemoveFaceID to deal
with the uninstallation of FaceIDs
- the image and sbit cache are now abstract classes, that
can be extended much more easily by client applications
- better performance in certain areas. Further optimizations
to come shortly anyway...
- the FTC_CMapCache_Lookup function has changed its signature,
charmaps can now only be retrieved by index
- FTC_Manager_Lookup_Face => FTC_Manager_LookupFace
FTC_Manager_Lookup_Size => FTC_Manager_LookupSize (still in
private header for the moment)
2003-12-22 22:53:37 +01:00
|
|
|
FT_Int cmap_index,
|
2003-12-19 22:23:58 +01:00
|
|
|
FT_UInt32 char_code );
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Section> */
|
|
|
|
/* cache_subsystem */
|
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
/*************************************************************************/
|
2003-12-19 22:23:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** IMAGE CACHE OBJECT *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
typedef struct FTC_ImageTypeRec_
|
|
|
|
{
|
|
|
|
FTC_FaceID face_id;
|
|
|
|
FT_Int width;
|
|
|
|
FT_Int height;
|
|
|
|
FT_Int32 flags;
|
|
|
|
|
|
|
|
} FTC_ImageTypeRec;
|
|
|
|
|
|
|
|
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 ) )
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FTC_ImageCache */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to an glyph image cache object. They are designed to */
|
|
|
|
/* hold many distinct glyph images while not exceeding a certain */
|
|
|
|
/* memory threshold. */
|
|
|
|
/* */
|
|
|
|
typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_ImageCache_New */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Creates a new glyph image cache. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* manager :: The parent manager for the image cache. */
|
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* acache :: A handle to the new glyph image cache object. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FTC_ImageCache_New( FTC_Manager manager,
|
|
|
|
FTC_ImageCache *acache );
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_ImageCache_Lookup */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Retrieves a given glyph image from a glyph image cache. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* cache :: A handle to the source glyph image cache. */
|
|
|
|
/* */
|
|
|
|
/* type :: A pointer to a glyph image type descriptor. */
|
|
|
|
/* */
|
|
|
|
/* gindex :: The glyph index to retrieve. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2000-11-06 05:33:56 +01:00
|
|
|
/* <Output> */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* aglyph :: The corresponding @FT_Glyph object. 0 in case of */
|
|
|
|
/* failure. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* anode :: Used to return the address of of the corresponding cache */
|
|
|
|
/* node after incrementing its reference count (see note */
|
|
|
|
/* below). */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* The returned glyph is owned and managed by the glyph image cache. */
|
|
|
|
/* Never try to transform or discard it manually! You can however */
|
|
|
|
/* create a copy with @FT_Glyph_Copy and modify the new one. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* node containing the glyph image, after increasing its reference */
|
|
|
|
/* count. This ensures that the node (as well as the FT_Glyph) will */
|
|
|
|
/* always be kept in the cache until you call @FTC_Node_Unref to */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* `release' it. */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* that the FT_Glyph could be flushed out of the cache on the next */
|
|
|
|
/* call to one of the caching sub-system APIs. Don't assume that it */
|
|
|
|
/* is persistent! */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FTC_ImageCache_Lookup( FTC_ImageCache cache,
|
|
|
|
FTC_ImageType type,
|
|
|
|
FT_UInt gindex,
|
|
|
|
FT_Glyph *aglyph,
|
|
|
|
FTC_Node *anode );
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FTC_SBit */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
|
|
|
|
/* structure for details. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2003-12-19 22:23:58 +01:00
|
|
|
typedef struct FTC_SBitRec_* FTC_SBit;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FTC_SBitRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A very compact structure used to describe a small glyph bitmap. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* width :: The bitmap width in pixels. */
|
|
|
|
/* */
|
|
|
|
/* height :: The bitmap height in pixels. */
|
|
|
|
/* */
|
|
|
|
/* left :: The horizontal distance from the pen position to the */
|
|
|
|
/* left bitmap border (a.k.a. `left side bearing', or */
|
|
|
|
/* `lsb'). */
|
|
|
|
/* */
|
|
|
|
/* top :: The vertical distance from the pen position (on the */
|
|
|
|
/* baseline) to the upper bitmap border (a.k.a. `top */
|
|
|
|
/* side bearing'). The distance is positive for upwards */
|
|
|
|
/* Y coordinates. */
|
|
|
|
/* */
|
|
|
|
/* format :: The format of the glyph bitmap (monochrome or gray). */
|
|
|
|
/* */
|
|
|
|
/* max_grays :: Maximum gray level value (in the range 1 to 255). */
|
|
|
|
/* */
|
|
|
|
/* pitch :: The number of bytes per bitmap line. May be positive */
|
|
|
|
/* or negative. */
|
|
|
|
/* */
|
|
|
|
/* xadvance :: The horizontal advance width in pixels. */
|
|
|
|
/* */
|
|
|
|
/* yadvance :: The vertical advance height in pixels. */
|
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* buffer :: A pointer to the bitmap pixels. */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
|
|
|
typedef struct FTC_SBitRec_
|
|
|
|
{
|
|
|
|
FT_Byte width;
|
|
|
|
FT_Byte height;
|
|
|
|
FT_Char left;
|
|
|
|
FT_Char top;
|
|
|
|
|
|
|
|
FT_Byte format;
|
|
|
|
FT_Byte max_grays;
|
|
|
|
FT_Short pitch;
|
|
|
|
FT_Char xadvance;
|
|
|
|
FT_Char yadvance;
|
|
|
|
|
|
|
|
FT_Byte* buffer;
|
|
|
|
|
|
|
|
} FTC_SBitRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FTC_SBitCache */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a small bitmap cache. These are special cache objects */
|
|
|
|
/* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
|
|
|
|
/* much more efficient way than the traditional glyph image cache */
|
|
|
|
/* implemented by @FTC_ImageCache. */
|
|
|
|
/* */
|
|
|
|
typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_SBitCache_New */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Creates a new cache to store small glyph bitmaps. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* manager :: A handle to the source cache manager. */
|
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* acache :: A handle to the new sbit cache. NULL in case of error. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
2000-08-24 18:29:15 +02:00
|
|
|
/* */
|
2001-06-28 09:17:51 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2003-12-19 22:23:58 +01:00
|
|
|
FTC_SBitCache_New( FTC_Manager manager,
|
|
|
|
FTC_SBitCache *acache );
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FTC_SBitCache_Lookup */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Looks up a given small glyph bitmap in a given sbit cache and */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* `lock' it to prevent its flushing from the cache until needed. */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* cache :: A handle to the source sbit cache. */
|
|
|
|
/* */
|
|
|
|
/* type :: A pointer to the glyph image type descriptor. */
|
|
|
|
/* */
|
|
|
|
/* gindex :: The glyph index. */
|
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* sbit :: A handle to a small bitmap descriptor. */
|
|
|
|
/* */
|
|
|
|
/* anode :: Used to return the address of of the corresponding cache */
|
|
|
|
/* node after incrementing its reference count (see note */
|
|
|
|
/* below). */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The small bitmap descriptor and its bit buffer are owned by the */
|
|
|
|
/* cache and should never be freed by the application. They might */
|
|
|
|
/* as well disappear from memory on the next cache lookup, so don't */
|
|
|
|
/* treat them as persistent data. */
|
|
|
|
/* */
|
|
|
|
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
|
|
|
|
/* glyph bitmap. */
|
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* node containing the bitmap, after increasing its reference count. */
|
|
|
|
/* This ensures that the node (as well as the image) will always be */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
2003-12-26 08:26:08 +01:00
|
|
|
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
2003-12-19 22:23:58 +01:00
|
|
|
/* that the bitmap could be flushed out of the cache on the next */
|
|
|
|
/* call to one of the caching sub-system APIs. Don't assume that it */
|
|
|
|
/* is persistent! */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FTC_SBitCache_Lookup( FTC_SBitCache cache,
|
|
|
|
FTC_ImageType type,
|
|
|
|
FT_UInt gindex,
|
|
|
|
FTC_SBit *sbit,
|
|
|
|
FTC_Node *anode );
|
|
|
|
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2003-12-19 22:23:58 +01:00
|
|
|
/* */
|
2001-01-11 10:27:49 +01:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
FT_END_HEADER
|
2000-08-24 18:29:15 +02:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
#endif /* __FTCACHE_H__ */
|
2000-08-24 18:29:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|