25 #ifndef __vtkFreeTypeUtilities_h
26 #define __vtkFreeTypeUtilities_h
28 #define VTK_FTFC_CACHE_CAPACITY 150
39 #include "vtk_freetype.h"
40 #include FT_FREETYPE_H
43 #if (FREETYPE_MAJOR >2 ||(FREETYPE_MAJOR == 2 && ( FREETYPE_MINOR > 1 || (FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 9))))
46 # define VTK_FREETYPE_CACHING_SUPPORTED
49 #ifdef FTGL_USE_NAMESPACE
54 #ifdef FTGL_USE_NAMESPACE
93 FT_Library* GetLibrary();
100 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
102 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
104 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
124 int GetGlyphIndex(
vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex);
141 GLYPH_REQUEST_DEFAULT = 0,
142 GLYPH_REQUEST_BITMAP = 1,
143 GLYPH_REQUEST_OUTLINE = 2
149 int request = GLYPH_REQUEST_DEFAULT);
162 int GetBoundingBox(
vtkTextProperty *tprop,
const char *str,
int bbox[4]);
163 int IsBoundingBoxValid(
int bbox[4]);
191 void MapTextPropertyToId(
vtkTextProperty *tprop,
unsigned long *tprop_cache_id);
192 void MapIdToTextProperty(
unsigned long tprop_cache_id,
vtkTextProperty *tprop);
198 int GetSize(
unsigned long tprop_cache_id,
int font_size, FT_Size *
size);
199 int GetFace(
unsigned long tprop_cache_id, FT_Face *face);
200 int GetGlyphIndex(
unsigned long tprop_cache_id, FT_UInt32 c,
202 int GetGlyph(
unsigned long tprop_cache_id,
206 int request = GLYPH_REQUEST_DEFAULT);
215 void GetWidthHeightDescender(
const char *str,
242 int totalWidth,
int *x,
int *y);
251 #ifdef FTGL_USE_NAMESPACE
261 double override_color[3] = NULL);
281 #ifdef VTK_FREETYPE_CACHING_SUPPORTED
282 FTC_Manager *CacheManager;
283 FTC_ImageCache *ImageCache;
284 FTC_CMapCache *CMapCache;
288 FTC_Manager* GetCacheManager();
289 FTC_ImageCache* GetImageCache();
290 FTC_CMapCache* GetCMapCache();
294 unsigned int MaximumNumberOfFaces;
295 unsigned int MaximumNumberOfSizes;
296 unsigned long MaximumNumberOfBytes;
298 void InitializeCacheManager();
299 void ReleaseCacheManager();
303 void PrintEntry(
int i,
char *msg = 0);
304 void ReleaseEntry(
int i);
306 void InitializeCache();