25 #ifndef __vtkFreeTypeTools_h
26 #define __vtkFreeTypeTools_h
28 #include "vtkRenderingFreeTypeModule.h"
37 #include "vtk_freetype.h"
38 #include FT_FREETYPE_H
69 FT_Library* GetLibrary();
76 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
78 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
80 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
97 bool IsBoundingBoxValid(
int bbox[4]);
118 void MapTextPropertyToId(
vtkTextProperty *tprop,
unsigned long *tprop_cache_id);
119 void MapIdToTextProperty(
unsigned long tprop_cache_id,
vtkTextProperty *tprop);
127 vtkSetMacro(ScaleToPowerTwo,
bool);
128 vtkGetMacro(ScaleToPowerTwo,
bool);
129 vtkBooleanMacro(ScaleToPowerTwo,
bool);
136 template <
typename T>
137 bool CalculateBoundingBox(
vtkTextProperty *tprop,
const T& str,
int bbox[4]);
143 template <
typename T>
152 template <
typename T>
171 bool GetGlyphIndex(
vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex);
186 GLYPH_REQUEST_DEFAULT = 0,
187 GLYPH_REQUEST_BITMAP = 1,
188 GLYPH_REQUEST_OUTLINE = 2
193 int request = GLYPH_REQUEST_DEFAULT);
194 bool GetSize(
unsigned long tprop_cache_id,
int font_size, FT_Size *
size);
195 bool GetFace(
unsigned long tprop_cache_id, FT_Face *face);
196 bool GetGlyphIndex(
unsigned long tprop_cache_id, FT_UInt32 c,
198 bool GetGlyph(
unsigned long tprop_cache_id,
202 int request = GLYPH_REQUEST_DEFAULT);
218 FT_Face &face,
bool &face_has_kerning);
223 FT_Bitmap* GetBitmap(FT_UInt32 c,
unsigned long prop_cache_id,
224 int prop_font_size, FT_UInt &gindex,
225 FT_BitmapGlyph &bitmap_glyph);
233 FTC_Manager *CacheManager;
234 FTC_ImageCache *ImageCache;
235 FTC_CMapCache *CMapCache;
239 FTC_Manager* GetCacheManager();
240 FTC_ImageCache* GetImageCache();
241 FTC_CMapCache* GetCMapCache();
244 unsigned int MaximumNumberOfFaces;
245 unsigned int MaximumNumberOfSizes;
246 unsigned long MaximumNumberOfBytes;
248 void InitializeCacheManager();
249 void ReleaseCacheManager();