OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ftcache.h */ | 3 /* ftcache.h */ |
4 /* */ | 4 /* */ |
5 /* FreeType Cache subsystem (specification). */ | 5 /* FreeType Cache subsystem (specification). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ | 7 /* Copyright 1996-2008, 2010, 2013 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 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 */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
15 /* */ | 15 /* */ |
16 /***************************************************************************/ | 16 /***************************************************************************/ |
17 | 17 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 * transformation through @FT_Set_Transform! | 207 * transformation through @FT_Set_Transform! |
208 */ | 208 */ |
209 typedef FT_Error | 209 typedef FT_Error |
210 (*FTC_Face_Requester)( FTC_FaceID face_id, | 210 (*FTC_Face_Requester)( FTC_FaceID face_id, |
211 FT_Library library, | 211 FT_Library library, |
212 FT_Pointer request_data, | 212 FT_Pointer request_data, |
213 FT_Face* aface ); | 213 FT_Face* aface ); |
214 | 214 |
215 /* */ | 215 /* */ |
216 | 216 |
217 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS | |
218 | |
219 /* these macros are incompatible with LLP64, should not be used */ | |
220 | |
221 #define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) ) | |
222 | |
223 #define FTC_FACE_ID_HASH( i ) \ | |
224 ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \ | |
225 ( FT_POINTER_TO_ULONG( i ) << 7 ) ) ) | |
226 | |
227 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ | |
228 | 217 |
229 /*************************************************************************/ | 218 /*************************************************************************/ |
230 /*************************************************************************/ | 219 /*************************************************************************/ |
231 /*************************************************************************/ | 220 /*************************************************************************/ |
232 /***** *****/ | 221 /***** *****/ |
233 /***** CACHE MANAGER OBJECT *****/ | 222 /***** CACHE MANAGER OBJECT *****/ |
234 /***** *****/ | 223 /***** *****/ |
235 /*************************************************************************/ | 224 /*************************************************************************/ |
236 /*************************************************************************/ | 225 /*************************************************************************/ |
237 /*************************************************************************/ | 226 /*************************************************************************/ |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 /* aface :: A handle to the face object. */ | 363 /* aface :: A handle to the face object. */ |
375 /* */ | 364 /* */ |
376 /* <Return> */ | 365 /* <Return> */ |
377 /* FreeType error code. 0~means success. */ | 366 /* FreeType error code. 0~means success. */ |
378 /* */ | 367 /* */ |
379 /* <Note> */ | 368 /* <Note> */ |
380 /* The returned @FT_Face object is always owned by the manager. You */ | 369 /* The returned @FT_Face object is always owned by the manager. You */ |
381 /* should never try to discard it yourself. */ | 370 /* should never try to discard it yourself. */ |
382 /* */ | 371 /* */ |
383 /* The @FT_Face object doesn't necessarily have a current size object */ | 372 /* The @FT_Face object doesn't necessarily have a current size object */ |
384 /* (i.e., face->size can be 0). If you need a specific `font size', */ | 373 /* (i.e., face->size can be~0). If you need a specific `font size', */ |
385 /* use @FTC_Manager_LookupSize instead. */ | 374 /* use @FTC_Manager_LookupSize instead. */ |
386 /* */ | 375 /* */ |
387 /* Never change the face's transformation matrix (i.e., never call */ | 376 /* Never change the face's transformation matrix (i.e., never call */ |
388 /* the @FT_Set_Transform function) on a returned face! If you need */ | 377 /* the @FT_Set_Transform function) on a returned face! If you need */ |
389 /* to transform glyphs, do it yourself after glyph loading. */ | 378 /* to transform glyphs, do it yourself after glyph loading. */ |
390 /* */ | 379 /* */ |
391 /* When you perform a lookup, out-of-memory errors are detected */ | 380 /* When you perform a lookup, out-of-memory errors are detected */ |
392 /* _within_ the lookup and force incremental flushes of the cache */ | 381 /* _within_ the lookup and force incremental flushes of the cache */ |
393 /* until enough memory is released for the lookup to succeed. */ | 382 /* until enough memory is released for the lookup to succeed. */ |
394 /* */ | 383 /* */ |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 | 687 |
699 | 688 |
700 /* */ | 689 /* */ |
701 | 690 |
702 | 691 |
703 #define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ | 692 #define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ |
704 ( (d1)->face_id == (d2)->face_id && \ | 693 ( (d1)->face_id == (d2)->face_id && \ |
705 (d1)->width == (d2)->width && \ | 694 (d1)->width == (d2)->width && \ |
706 (d1)->flags == (d2)->flags ) | 695 (d1)->flags == (d2)->flags ) |
707 | 696 |
708 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS | |
709 | |
710 /* this macro is incompatible with LLP64, should not be used */ | |
711 | |
712 #define FTC_IMAGE_TYPE_HASH( d ) \ | |
713 (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \ | |
714 ( (d)->width << 8 ) ^ (d)->height ^ \ | |
715 ( (d)->flags << 4 ) ) | |
716 | |
717 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ | |
718 | |
719 | 697 |
720 /*************************************************************************/ | 698 /*************************************************************************/ |
721 /* */ | 699 /* */ |
722 /* <Type> */ | 700 /* <Type> */ |
723 /* FTC_ImageCache */ | 701 /* FTC_ImageCache */ |
724 /* */ | 702 /* */ |
725 /* <Description> */ | 703 /* <Description> */ |
726 /* A handle to an glyph image cache object. They are designed to */ | 704 /* A handle to a glyph image cache object. They are designed to */ |
727 /* hold many distinct glyph images while not exceeding a certain */ | 705 /* hold many distinct glyph images while not exceeding a certain */ |
728 /* memory threshold. */ | 706 /* memory threshold. */ |
729 /* */ | 707 /* */ |
730 typedef struct FTC_ImageCacheRec_* FTC_ImageCache; | 708 typedef struct FTC_ImageCacheRec_* FTC_ImageCache; |
731 | 709 |
732 | 710 |
733 /*************************************************************************/ | 711 /*************************************************************************/ |
734 /* */ | 712 /* */ |
735 /* <Function> */ | 713 /* <Function> */ |
736 /* FTC_ImageCache_New */ | 714 /* FTC_ImageCache_New */ |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 FTC_SBitCache_LookupScaler( FTC_SBitCache cache, | 1042 FTC_SBitCache_LookupScaler( FTC_SBitCache cache, |
1065 FTC_Scaler scaler, | 1043 FTC_Scaler scaler, |
1066 FT_ULong load_flags, | 1044 FT_ULong load_flags, |
1067 FT_UInt gindex, | 1045 FT_UInt gindex, |
1068 FTC_SBit *sbit, | 1046 FTC_SBit *sbit, |
1069 FTC_Node *anode ); | 1047 FTC_Node *anode ); |
1070 | 1048 |
1071 | 1049 |
1072 /* */ | 1050 /* */ |
1073 | 1051 |
1074 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS | |
1075 | |
1076 /*@***********************************************************************/ | |
1077 /* */ | |
1078 /* <Struct> */ | |
1079 /* FTC_FontRec */ | |
1080 /* */ | |
1081 /* <Description> */ | |
1082 /* A simple structure used to describe a given `font' to the cache */ | |
1083 /* manager. Note that a `font' is the combination of a given face */ | |
1084 /* with a given character size. */ | |
1085 /* */ | |
1086 /* <Fields> */ | |
1087 /* face_id :: The ID of the face to use. */ | |
1088 /* */ | |
1089 /* pix_width :: The character width in integer pixels. */ | |
1090 /* */ | |
1091 /* pix_height :: The character height in integer pixels. */ | |
1092 /* */ | |
1093 typedef struct FTC_FontRec_ | |
1094 { | |
1095 FTC_FaceID face_id; | |
1096 FT_UShort pix_width; | |
1097 FT_UShort pix_height; | |
1098 | |
1099 } FTC_FontRec; | |
1100 | |
1101 | |
1102 /* */ | |
1103 | |
1104 | |
1105 #define FTC_FONT_COMPARE( f1, f2 ) \ | |
1106 ( (f1)->face_id == (f2)->face_id && \ | |
1107 (f1)->pix_width == (f2)->pix_width && \ | |
1108 (f1)->pix_height == (f2)->pix_height ) | |
1109 | |
1110 /* this macro is incompatible with LLP64, should not be used */ | |
1111 #define FTC_FONT_HASH( f ) \ | |
1112 (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \ | |
1113 ((f)->pix_width << 8) ^ \ | |
1114 ((f)->pix_height) ) | |
1115 | |
1116 typedef FTC_FontRec* FTC_Font; | |
1117 | |
1118 | |
1119 FT_EXPORT( FT_Error ) | |
1120 FTC_Manager_Lookup_Face( FTC_Manager manager, | |
1121 FTC_FaceID face_id, | |
1122 FT_Face *aface ); | |
1123 | |
1124 FT_EXPORT( FT_Error ) | |
1125 FTC_Manager_Lookup_Size( FTC_Manager manager, | |
1126 FTC_Font font, | |
1127 FT_Face *aface, | |
1128 FT_Size *asize ); | |
1129 | |
1130 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ | |
1131 | |
1132 | |
1133 /* */ | |
1134 | |
1135 FT_END_HEADER | 1052 FT_END_HEADER |
1136 | 1053 |
1137 #endif /* __FTCACHE_H__ */ | 1054 #endif /* __FTCACHE_H__ */ |
1138 | 1055 |
1139 | 1056 |
1140 /* END */ | 1057 /* END */ |
OLD | NEW |