25 #ifndef __vtkFreeTypeUtilities_h
26 #define __vtkFreeTypeUtilities_h
28 #define VTK_FTFC_CACHE_CAPACITY 150
37 #include "vtk_freetype.h"
38 #include FT_FREETYPE_H
41 #if (FREETYPE_MAJOR >2 ||(FREETYPE_MAJOR == 2 && ( FREETYPE_MINOR > 1 || (FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 9))))
44 # define VTK_FREETYPE_CACHING_SUPPORTED
84 FT_Library* GetLibrary();
91 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
93 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
95 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
115 int GetGlyphIndex(
vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex);
132 GLYPH_REQUEST_DEFAULT = 0,
133 GLYPH_REQUEST_BITMAP = 1,
134 GLYPH_REQUEST_OUTLINE = 2
140 int request = GLYPH_REQUEST_DEFAULT);
153 int GetBoundingBox(
vtkTextProperty *tprop,
const char *str,
int bbox[4]);
154 int IsBoundingBoxValid(
int bbox[4]);
182 void MapTextPropertyToId(
vtkTextProperty *tprop,
unsigned long *tprop_cache_id);
183 void MapIdToTextProperty(
unsigned long tprop_cache_id,
vtkTextProperty *tprop);
189 int GetSize(
unsigned long tprop_cache_id,
int font_size, FT_Size *
size);
190 int GetFace(
unsigned long tprop_cache_id, FT_Face *face);
191 int GetGlyphIndex(
unsigned long tprop_cache_id, FT_UInt32 c,
193 int GetGlyph(
unsigned long tprop_cache_id,
197 int request = GLYPH_REQUEST_DEFAULT);
206 void GetWidthHeightDescender(
const char *str,
233 int totalWidth,
int *x,
int *y);
248 double override_color[3] = NULL);
268 #ifdef VTK_FREETYPE_CACHING_SUPPORTED
269 FTC_Manager *CacheManager;
270 FTC_ImageCache *ImageCache;
271 FTC_CMapCache *CMapCache;
275 FTC_Manager* GetCacheManager();
276 FTC_ImageCache* GetImageCache();
277 FTC_CMapCache* GetCMapCache();
281 unsigned int MaximumNumberOfFaces;
282 unsigned int MaximumNumberOfSizes;
283 unsigned long MaximumNumberOfBytes;
285 void InitializeCacheManager();
286 void ReleaseCacheManager();
290 void PrintEntry(
int i,
char *msg = 0);
291 void ReleaseEntry(
int i);
293 void InitializeCache();