1 /***************************************************************************/
5 /* FreeType Cache subsystem (specification). */
7 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
30 /*************************************************************************
39 * How to cache face, size, and glyph data with FreeType~2.
42 * This section describes the FreeType~2 cache sub-system, which is used
43 * to limit the number of concurrently opened @FT_Face and @FT_Size
44 * objects, as well as caching information like character maps and glyph
45 * images while limiting their maximum memory usage.
47 * Note that all types and functions begin with the `FTC_' prefix.
49 * The cache is highly portable and thus doesn't know anything about the
50 * fonts installed on your system, or how to access them. This implies
51 * the following scheme:
53 * First, available or installed font faces are uniquely identified by
54 * @FTC_FaceID values, provided to the cache by the client. Note that
55 * the cache only stores and compares these values, and doesn't try to
56 * interpret them in any way.
58 * Second, the cache calls, only when needed, a client-provided function
59 * to convert a @FTC_FaceID into a new @FT_Face object. The latter is
60 * then completely managed by the cache, including its termination
61 * through @FT_Done_Face.
63 * Clients are free to map face IDs to anything else. The most simple
64 * usage is to associate them to a (pathname,face_index) pair that is
65 * used to call @FT_New_Face. However, more complex schemes are also
68 * Note that for the cache to work correctly, the face ID values must be
69 * *persistent*, which means that the contents they point to should not
70 * change at runtime, or that their value should not become invalid.
72 * If this is unavoidable (e.g., when a font is uninstalled at runtime),
73 * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
74 * the cache get rid of any references to the old @FTC_FaceID it may
75 * keep internally. Failure to do so will lead to incorrect behaviour
78 * To use the cache, start with calling @FTC_Manager_New to create a new
79 * @FTC_Manager object, which models a single cache instance. You can
80 * then look up @FT_Face and @FT_Size objects with
81 * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
83 * If you want to use the charmap caching, call @FTC_CMapCache_New, then
84 * later use @FTC_CMapCache_Lookup to perform the equivalent of
85 * @FT_Get_Char_Index, only much faster.
87 * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
88 * later use @FTC_ImageCache_Lookup to retrieve the corresponding
89 * @FT_Glyph objects from the cache.
91 * If you need lots of small bitmaps, it is much more memory efficient
92 * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
93 * returns @FTC_SBitRec structures, which are used to store small
94 * bitmaps directly. (A small bitmap is one whose metrics and
95 * dimensions all fit into 8-bit integers).
97 * We hope to also provide a kerning cache in the near future.
108 * FTC_Manager_LookupFace
109 * FTC_Manager_LookupSize
110 * FTC_Manager_RemoveFaceID
117 * FTC_ImageCache_Lookup
122 * FTC_SBitCache_Lookup
126 * FTC_CMapCache_Lookup
128 *************************************************************************/
131 /*************************************************************************/
132 /*************************************************************************/
133 /*************************************************************************/
135 /***** BASIC TYPE DEFINITIONS *****/
137 /*************************************************************************/
138 /*************************************************************************/
139 /*************************************************************************/
142 /*************************************************************************
147 * An opaque pointer type that is used to identity face objects. The
148 * contents of such objects is application-dependent.
150 * These pointers are typically used to point to a user-defined
151 * structure containing a font file path, and face index.
154 * Never use NULL as a valid @FTC_FaceID.
156 * Face IDs are passed by the client to the cache manager, which calls,
157 * when needed, the @FTC_Face_Requester to translate them into new
160 * If the content of a given face ID changes at runtime, or if the value
161 * becomes invalid (e.g., when uninstalling a font), you should
162 * immediately call @FTC_Manager_RemoveFaceID before any other cache
165 * Failure to do so will result in incorrect behaviour or even
166 * memory leaks and crashes.
168 typedef FT_Pointer FTC_FaceID
;
171 /************************************************************************
177 * A callback function provided by client applications. It is used by
178 * the cache manager to translate a given @FTC_FaceID into a new valid
179 * @FT_Face object, on demand.
183 * The face ID to resolve.
186 * A handle to a FreeType library object.
189 * Application-provided request data (see note below).
193 * A new @FT_Face handle.
196 * FreeType error code. 0~means success.
199 * The third parameter `req_data' is the same as the one passed by the
200 * client when @FTC_Manager_New is called.
202 * The face requester should not perform funny things on the returned
203 * face object, like creating a new @FT_Size for it, or setting a
204 * transformation through @FT_Set_Transform!
207 (*FTC_Face_Requester
)( FTC_FaceID face_id
,
209 FT_Pointer request_data
,
214 #define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
216 #define FTC_FACE_ID_HASH( i ) \
217 ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
218 ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
221 /*************************************************************************/
222 /*************************************************************************/
223 /*************************************************************************/
225 /***** CACHE MANAGER OBJECT *****/
227 /*************************************************************************/
228 /*************************************************************************/
229 /*************************************************************************/
232 /*************************************************************************/
238 /* This object corresponds to one instance of the cache-subsystem. */
239 /* It is used to cache one or more @FT_Face objects, along with */
240 /* corresponding @FT_Size objects. */
242 /* The manager intentionally limits the total number of opened */
243 /* @FT_Face and @FT_Size objects to control memory usage. See the */
244 /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
246 /* The manager is also used to cache `nodes' of various types while */
247 /* limiting their total memory usage. */
249 /* All limitations are enforced by keeping lists of managed objects */
250 /* in most-recently-used order, and flushing old nodes to make room */
253 typedef struct FTC_ManagerRec_
* FTC_Manager
;
256 /*************************************************************************/
262 /* An opaque handle to a cache node object. Each cache node is */
263 /* reference-counted. A node with a count of~0 might be flushed */
264 /* out of a full cache whenever a lookup request is performed. */
266 /* If you lookup nodes, you have the ability to `acquire' them, i.e., */
267 /* to increment their reference count. This will prevent the node */
268 /* from being flushed out of the cache until you explicitly `release' */
269 /* it (see @FTC_Node_Unref). */
271 /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
273 typedef struct FTC_NodeRec_
* FTC_Node
;
276 /*************************************************************************/
279 /* FTC_Manager_New */
282 /* Create a new cache manager. */
285 /* library :: The parent FreeType library handle to use. */
287 /* max_faces :: Maximum number of opened @FT_Face objects managed by */
288 /* this cache instance. Use~0 for defaults. */
290 /* max_sizes :: Maximum number of opened @FT_Size objects managed by */
291 /* this cache instance. Use~0 for defaults. */
293 /* max_bytes :: Maximum number of bytes to use for cached data nodes. */
294 /* Use~0 for defaults. Note that this value does not */
295 /* account for managed @FT_Face and @FT_Size objects. */
297 /* requester :: An application-provided callback used to translate */
298 /* face IDs into real @FT_Face objects. */
300 /* req_data :: A generic pointer that is passed to the requester */
301 /* each time it is called (see @FTC_Face_Requester). */
304 /* amanager :: A handle to a new manager object. 0~in case of */
308 /* FreeType error code. 0~means success. */
310 FT_EXPORT( FT_Error
)
311 FTC_Manager_New( FT_Library library
,
315 FTC_Face_Requester requester
,
317 FTC_Manager
*amanager
);
320 /*************************************************************************/
323 /* FTC_Manager_Reset */
326 /* Empty a given cache manager. This simply gets rid of all the */
327 /* currently cached @FT_Face and @FT_Size objects within the manager. */
330 /* manager :: A handle to the manager. */
333 FTC_Manager_Reset( FTC_Manager manager
);
336 /*************************************************************************/
339 /* FTC_Manager_Done */
342 /* Destroy a given manager after emptying it. */
345 /* manager :: A handle to the target cache manager object. */
348 FTC_Manager_Done( FTC_Manager manager
);
351 /*************************************************************************/
354 /* FTC_Manager_LookupFace */
357 /* Retrieve the @FT_Face object that corresponds to a given face ID */
358 /* through a cache manager. */
361 /* manager :: A handle to the cache manager. */
363 /* face_id :: The ID of the face object. */
366 /* aface :: A handle to the face object. */
369 /* FreeType error code. 0~means success. */
372 /* The returned @FT_Face object is always owned by the manager. You */
373 /* should never try to discard it yourself. */
375 /* The @FT_Face object doesn't necessarily have a current size object */
376 /* (i.e., face->size can be 0). If you need a specific `font size', */
377 /* use @FTC_Manager_LookupSize instead. */
379 /* Never change the face's transformation matrix (i.e., never call */
380 /* the @FT_Set_Transform function) on a returned face! If you need */
381 /* to transform glyphs, do it yourself after glyph loading. */
383 /* When you perform a lookup, out-of-memory errors are detected */
384 /* _within_ the lookup and force incremental flushes of the cache */
385 /* until enough memory is released for the lookup to succeed. */
387 /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
388 /* already been completely flushed, and still no memory was available */
389 /* for the operation. */
391 FT_EXPORT( FT_Error
)
392 FTC_Manager_LookupFace( FTC_Manager manager
,
397 /*************************************************************************/
403 /* A structure used to describe a given character size in either */
404 /* pixels or points to the cache manager. See */
405 /* @FTC_Manager_LookupSize. */
408 /* face_id :: The source face ID. */
410 /* width :: The character width. */
412 /* height :: The character height. */
414 /* pixel :: A Boolean. If 1, the `width' and `height' fields are */
415 /* interpreted as integer pixel character sizes. */
416 /* Otherwise, they are expressed as 1/64th of points. */
418 /* x_res :: Only used when `pixel' is value~0 to indicate the */
419 /* horizontal resolution in dpi. */
421 /* y_res :: Only used when `pixel' is value~0 to indicate the */
422 /* vertical resolution in dpi. */
425 /* This type is mainly used to retrieve @FT_Size objects through the */
428 typedef struct FTC_ScalerRec_
440 /*************************************************************************/
446 /* A handle to an @FTC_ScalerRec structure. */
448 typedef struct FTC_ScalerRec_
* FTC_Scaler
;
451 /*************************************************************************/
454 /* FTC_Manager_LookupSize */
457 /* Retrieve the @FT_Size object that corresponds to a given */
458 /* @FTC_ScalerRec pointer through a cache manager. */
461 /* manager :: A handle to the cache manager. */
463 /* scaler :: A scaler handle. */
466 /* asize :: A handle to the size object. */
469 /* FreeType error code. 0~means success. */
472 /* The returned @FT_Size object is always owned by the manager. You */
473 /* should never try to discard it by yourself. */
475 /* You can access the parent @FT_Face object simply as `size->face' */
476 /* if you need it. Note that this object is also owned by the */
480 /* When you perform a lookup, out-of-memory errors are detected */
481 /* _within_ the lookup and force incremental flushes of the cache */
482 /* until enough memory is released for the lookup to succeed. */
484 /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
485 /* already been completely flushed, and still no memory is available */
486 /* for the operation. */
488 FT_EXPORT( FT_Error
)
489 FTC_Manager_LookupSize( FTC_Manager manager
,
494 /*************************************************************************/
500 /* Decrement a cache node's internal reference count. When the count */
501 /* reaches 0, it is not destroyed but becomes eligible for subsequent */
505 /* node :: The cache node handle. */
507 /* manager :: The cache manager handle. */
510 FTC_Node_Unref( FTC_Node node
,
511 FTC_Manager manager
);
514 /*************************************************************************
517 * FTC_Manager_RemoveFaceID
520 * A special function used to indicate to the cache manager that
521 * a given @FTC_FaceID is no longer valid, either because its
522 * content changed, or because it was deallocated or uninstalled.
526 * The cache manager handle.
529 * The @FTC_FaceID to be removed.
532 * This function flushes all nodes from the cache corresponding to this
533 * `face_id', with the exception of nodes with a non-null reference
536 * Such nodes are however modified internally so as to never appear
537 * in later lookups with the same `face_id' value, and to be immediately
538 * destroyed when released by all their users.
542 FTC_Manager_RemoveFaceID( FTC_Manager manager
,
543 FTC_FaceID face_id
);
546 /*************************************************************************/
549 /* cache_subsystem */
551 /*************************************************************************/
553 /*************************************************************************
559 * An opaque handle used to model a charmap cache. This cache is to
560 * hold character codes -> glyph indices mappings.
563 typedef struct FTC_CMapCacheRec_
* FTC_CMapCache
;
566 /*************************************************************************
572 * Create a new charmap cache.
576 * A handle to the cache manager.
580 * A new cache handle. NULL in case of error.
583 * FreeType error code. 0~means success.
586 * Like all other caches, this one will be destroyed with the cache
590 FT_EXPORT( FT_Error
)
591 FTC_CMapCache_New( FTC_Manager manager
,
592 FTC_CMapCache
*acache
);
595 /************************************************************************
598 * FTC_CMapCache_Lookup
601 * Translate a character code into a glyph index, using the charmap
606 * A charmap cache handle.
609 * The source face ID.
612 * The index of the charmap in the source face. Any negative value
613 * means to use the cache @FT_Face's default charmap.
616 * The character code (in the corresponding charmap).
619 * Glyph index. 0~means `no glyph'.
623 FTC_CMapCache_Lookup( FTC_CMapCache cache
,
626 FT_UInt32 char_code
);
629 /*************************************************************************/
632 /* cache_subsystem */
634 /*************************************************************************/
637 /*************************************************************************/
638 /*************************************************************************/
639 /*************************************************************************/
641 /***** IMAGE CACHE OBJECT *****/
643 /*************************************************************************/
644 /*************************************************************************/
645 /*************************************************************************/
648 /*************************************************************************
654 * A structure used to model the type of images in a glyph cache.
661 * The width in pixels.
664 * The height in pixels.
667 * The load flags, as in @FT_Load_Glyph.
670 typedef struct FTC_ImageTypeRec_
680 /*************************************************************************
686 * A handle to an @FTC_ImageTypeRec structure.
689 typedef struct FTC_ImageTypeRec_
* FTC_ImageType
;
695 #define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
696 ( (d1)->face_id == (d2)->face_id && \
697 (d1)->width == (d2)->width && \
698 (d1)->flags == (d2)->flags )
700 #define FTC_IMAGE_TYPE_HASH( d ) \
701 (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
702 ( (d)->width << 8 ) ^ (d)->height ^ \
703 ( (d)->flags << 4 ) )
706 /*************************************************************************/
712 /* A handle to an glyph image cache object. They are designed to */
713 /* hold many distinct glyph images while not exceeding a certain */
714 /* memory threshold. */
716 typedef struct FTC_ImageCacheRec_
* FTC_ImageCache
;
719 /*************************************************************************/
722 /* FTC_ImageCache_New */
725 /* Create a new glyph image cache. */
728 /* manager :: The parent manager for the image cache. */
731 /* acache :: A handle to the new glyph image cache object. */
734 /* FreeType error code. 0~means success. */
736 FT_EXPORT( FT_Error
)
737 FTC_ImageCache_New( FTC_Manager manager
,
738 FTC_ImageCache
*acache
);
741 /*************************************************************************/
744 /* FTC_ImageCache_Lookup */
747 /* Retrieve a given glyph image from a glyph image cache. */
750 /* cache :: A handle to the source glyph image cache. */
752 /* type :: A pointer to a glyph image type descriptor. */
754 /* gindex :: The glyph index to retrieve. */
757 /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
760 /* anode :: Used to return the address of of the corresponding cache */
761 /* node after incrementing its reference count (see note */
765 /* FreeType error code. 0~means success. */
768 /* The returned glyph is owned and managed by the glyph image cache. */
769 /* Never try to transform or discard it manually! You can however */
770 /* create a copy with @FT_Glyph_Copy and modify the new one. */
772 /* If `anode' is _not_ NULL, it receives the address of the cache */
773 /* node containing the glyph image, after increasing its reference */
774 /* count. This ensures that the node (as well as the @FT_Glyph) will */
775 /* always be kept in the cache until you call @FTC_Node_Unref to */
778 /* If `anode' is NULL, the cache node is left unchanged, which means */
779 /* that the @FT_Glyph could be flushed out of the cache on the next */
780 /* call to one of the caching sub-system APIs. Don't assume that it */
783 FT_EXPORT( FT_Error
)
784 FTC_ImageCache_Lookup( FTC_ImageCache cache
,
791 /*************************************************************************/
794 /* FTC_ImageCache_LookupScaler */
797 /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */
798 /* to specify the face ID and its size. */
801 /* cache :: A handle to the source glyph image cache. */
803 /* scaler :: A pointer to a scaler descriptor. */
805 /* load_flags :: The corresponding load flags. */
807 /* gindex :: The glyph index to retrieve. */
810 /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
813 /* anode :: Used to return the address of of the corresponding */
814 /* cache node after incrementing its reference count */
815 /* (see note below). */
818 /* FreeType error code. 0~means success. */
821 /* The returned glyph is owned and managed by the glyph image cache. */
822 /* Never try to transform or discard it manually! You can however */
823 /* create a copy with @FT_Glyph_Copy and modify the new one. */
825 /* If `anode' is _not_ NULL, it receives the address of the cache */
826 /* node containing the glyph image, after increasing its reference */
827 /* count. This ensures that the node (as well as the @FT_Glyph) will */
828 /* always be kept in the cache until you call @FTC_Node_Unref to */
831 /* If `anode' is NULL, the cache node is left unchanged, which means */
832 /* that the @FT_Glyph could be flushed out of the cache on the next */
833 /* call to one of the caching sub-system APIs. Don't assume that it */
836 /* Calls to @FT_Set_Char_Size and friends have no effect on cached */
837 /* glyphs; you should always use the FreeType cache API instead. */
839 FT_EXPORT( FT_Error
)
840 FTC_ImageCache_LookupScaler( FTC_ImageCache cache
,
848 /*************************************************************************/
854 /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
855 /* structure for details. */
857 typedef struct FTC_SBitRec_
* FTC_SBit
;
860 /*************************************************************************/
866 /* A very compact structure used to describe a small glyph bitmap. */
869 /* width :: The bitmap width in pixels. */
871 /* height :: The bitmap height in pixels. */
873 /* left :: The horizontal distance from the pen position to the */
874 /* left bitmap border (a.k.a. `left side bearing', or */
877 /* top :: The vertical distance from the pen position (on the */
878 /* baseline) to the upper bitmap border (a.k.a. `top */
879 /* side bearing'). The distance is positive for upwards */
882 /* format :: The format of the glyph bitmap (monochrome or gray). */
884 /* max_grays :: Maximum gray level value (in the range 1 to~255). */
886 /* pitch :: The number of bytes per bitmap line. May be positive */
889 /* xadvance :: The horizontal advance width in pixels. */
891 /* yadvance :: The vertical advance height in pixels. */
893 /* buffer :: A pointer to the bitmap pixels. */
895 typedef struct FTC_SBitRec_
913 /*************************************************************************/
919 /* A handle to a small bitmap cache. These are special cache objects */
920 /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
921 /* much more efficient way than the traditional glyph image cache */
922 /* implemented by @FTC_ImageCache. */
924 typedef struct FTC_SBitCacheRec_
* FTC_SBitCache
;
927 /*************************************************************************/
930 /* FTC_SBitCache_New */
933 /* Create a new cache to store small glyph bitmaps. */
936 /* manager :: A handle to the source cache manager. */
939 /* acache :: A handle to the new sbit cache. NULL in case of error. */
942 /* FreeType error code. 0~means success. */
944 FT_EXPORT( FT_Error
)
945 FTC_SBitCache_New( FTC_Manager manager
,
946 FTC_SBitCache
*acache
);
949 /*************************************************************************/
952 /* FTC_SBitCache_Lookup */
955 /* Look up a given small glyph bitmap in a given sbit cache and */
956 /* `lock' it to prevent its flushing from the cache until needed. */
959 /* cache :: A handle to the source sbit cache. */
961 /* type :: A pointer to the glyph image type descriptor. */
963 /* gindex :: The glyph index. */
966 /* sbit :: A handle to a small bitmap descriptor. */
968 /* anode :: Used to return the address of of the corresponding cache */
969 /* node after incrementing its reference count (see note */
973 /* FreeType error code. 0~means success. */
976 /* The small bitmap descriptor and its bit buffer are owned by the */
977 /* cache and should never be freed by the application. They might */
978 /* as well disappear from memory on the next cache lookup, so don't */
979 /* treat them as persistent data. */
981 /* The descriptor's `buffer' field is set to~0 to indicate a missing */
984 /* If `anode' is _not_ NULL, it receives the address of the cache */
985 /* node containing the bitmap, after increasing its reference count. */
986 /* This ensures that the node (as well as the image) will always be */
987 /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
989 /* If `anode' is NULL, the cache node is left unchanged, which means */
990 /* that the bitmap could be flushed out of the cache on the next */
991 /* call to one of the caching sub-system APIs. Don't assume that it */
994 FT_EXPORT( FT_Error
)
995 FTC_SBitCache_Lookup( FTC_SBitCache cache
,
1002 /*************************************************************************/
1005 /* FTC_SBitCache_LookupScaler */
1008 /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */
1009 /* to specify the face ID and its size. */
1012 /* cache :: A handle to the source sbit cache. */
1014 /* scaler :: A pointer to the scaler descriptor. */
1016 /* load_flags :: The corresponding load flags. */
1018 /* gindex :: The glyph index. */
1021 /* sbit :: A handle to a small bitmap descriptor. */
1023 /* anode :: Used to return the address of of the corresponding */
1024 /* cache node after incrementing its reference count */
1025 /* (see note below). */
1028 /* FreeType error code. 0~means success. */
1031 /* The small bitmap descriptor and its bit buffer are owned by the */
1032 /* cache and should never be freed by the application. They might */
1033 /* as well disappear from memory on the next cache lookup, so don't */
1034 /* treat them as persistent data. */
1036 /* The descriptor's `buffer' field is set to~0 to indicate a missing */
1039 /* If `anode' is _not_ NULL, it receives the address of the cache */
1040 /* node containing the bitmap, after increasing its reference count. */
1041 /* This ensures that the node (as well as the image) will always be */
1042 /* kept in the cache until you call @FTC_Node_Unref to `release' it. */
1044 /* If `anode' is NULL, the cache node is left unchanged, which means */
1045 /* that the bitmap could be flushed out of the cache on the next */
1046 /* call to one of the caching sub-system APIs. Don't assume that it */
1047 /* is persistent! */
1049 FT_EXPORT( FT_Error
)
1050 FTC_SBitCache_LookupScaler( FTC_SBitCache cache
,
1052 FT_ULong load_flags
,
1060 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
1062 /*@***********************************************************************/
1068 /* A simple structure used to describe a given `font' to the cache */
1069 /* manager. Note that a `font' is the combination of a given face */
1070 /* with a given character size. */
1073 /* face_id :: The ID of the face to use. */
1075 /* pix_width :: The character width in integer pixels. */
1077 /* pix_height :: The character height in integer pixels. */
1079 typedef struct FTC_FontRec_
1082 FT_UShort pix_width
;
1083 FT_UShort pix_height
;
1091 #define FTC_FONT_COMPARE( f1, f2 ) \
1092 ( (f1)->face_id == (f2)->face_id && \
1093 (f1)->pix_width == (f2)->pix_width && \
1094 (f1)->pix_height == (f2)->pix_height )
1096 #define FTC_FONT_HASH( f ) \
1097 (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
1098 ((f)->pix_width << 8) ^ \
1101 typedef FTC_FontRec
* FTC_Font
;
1104 FT_EXPORT( FT_Error
)
1105 FTC_Manager_Lookup_Face( FTC_Manager manager
,
1109 FT_EXPORT( FT_Error
)
1110 FTC_Manager_Lookup_Size( FTC_Manager manager
,
1115 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
1122 #endif /* __FTCACHE_H__ */