28 #ifndef __vtkFreeTypeUtilities_h
29 #define __vtkFreeTypeUtilities_h
31 #define VTK_FTFC_CACHE_CAPACITY 150
33 #include "vtkRenderingFreeTypeModule.h"
34 #include "vtkObject.h"
37 class vtkTextProperty;
45 #include "vtk_freetype.h"
46 #include FT_FREETYPE_H
49 #if (FREETYPE_MAJOR >2 ||(FREETYPE_MAJOR == 2 && ( FREETYPE_MINOR > 1 || (FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 9))))
52 # define VTK_FREETYPE_CACHING_SUPPORTED
55 #ifdef FTGL_USE_NAMESPACE
60 #ifdef FTGL_USE_NAMESPACE
81 void PrintSelf(ostream& os, vtkIndent indent);
99 FT_Library* GetLibrary();
105 vtkSetClampMacro(MaximumNumberOfFaces,
unsigned int,1,VTK_UNSIGNED_INT_MAX);
106 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
107 vtkSetClampMacro(MaximumNumberOfSizes,
unsigned int,1,VTK_UNSIGNED_INT_MAX);
108 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
109 vtkSetClampMacro(MaximumNumberOfBytes,
unsigned long,1,VTK_UNSIGNED_LONG_MAX);
110 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
118 int GetSize(vtkTextProperty *tprop, FT_Size *size);
125 int GetFace(vtkTextProperty *tprop, FT_Face *face);
130 int GetGlyphIndex(vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex);
147 GLYPH_REQUEST_DEFAULT = 0,
148 GLYPH_REQUEST_BITMAP = 1,
149 GLYPH_REQUEST_OUTLINE = 2
152 int GetGlyph(vtkTextProperty *tprop,
155 int request = GLYPH_REQUEST_DEFAULT);
168 int GetBoundingBox(vtkTextProperty *tprop,
const char *str,
int bbox[4]);
169 int IsBoundingBoxValid(
int bbox[4]);
175 int RenderString(vtkTextProperty *tprop,
182 VTK_LEGACY(
int RenderString(vtkTextProperty *tprop,
185 vtkImageData *data));
197 void MapTextPropertyToId(vtkTextProperty *tprop,
unsigned long *tprop_cache_id);
198 void MapIdToTextProperty(
unsigned long tprop_cache_id, vtkTextProperty *tprop);
204 int GetSize(
unsigned long tprop_cache_id,
int font_size, FT_Size *size);
205 int GetFace(
unsigned long tprop_cache_id, FT_Face *face);
206 int GetGlyphIndex(
unsigned long tprop_cache_id, FT_UInt32 c,
208 int GetGlyph(
unsigned long tprop_cache_id,
212 int request = GLYPH_REQUEST_DEFAULT);
221 void GetWidthHeightDescender(
const char *str,
222 vtkTextProperty *tprop,
231 void PrepareImageData(vtkImageData *data,
232 vtkTextProperty *tprop,
240 int GetConstrainedFontSize(
const char *str, vtkTextProperty *tprop,
241 double orientation,
int targetWidth,
247 void JustifyLine(
const char *str, vtkTextProperty *tprop,
248 int totalWidth,
int *x,
int *y);
257 #ifdef FTGL_USE_NAMESPACE
267 double override_color[3] = NULL);
271 int PopulateImageData(vtkTextProperty *tprop,
const char *str,
272 int x,
int y, vtkImageData *data,
int use_shadow_color);
287 #ifdef VTK_FREETYPE_CACHING_SUPPORTED
288 FTC_Manager *CacheManager;
289 FTC_ImageCache *ImageCache;
290 FTC_CMapCache *CMapCache;
294 FTC_Manager* GetCacheManager();
295 FTC_ImageCache* GetImageCache();
296 FTC_CMapCache* GetCMapCache();
300 unsigned int MaximumNumberOfFaces;
301 unsigned int MaximumNumberOfSizes;
302 unsigned long MaximumNumberOfBytes;
304 void InitializeCacheManager();
305 void ReleaseCacheManager();
309 void PrintEntry(
int i,
char *msg = 0);
310 void ReleaseEntry(
int i);
312 void InitializeCache();
An actor that displays text. Scaled or unscaled.
#define VTK_FTFC_CACHE_CAPACITY
FreeType library support.
vtkTextProperty * TextProperty