25 #ifndef __vtkFreeTypeTools_h
26 #define __vtkFreeTypeTools_h
36 #include "vtk_freetype.h"
37 #include FT_FREETYPE_H
68 FT_Library* GetLibrary();
75 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
77 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
79 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
96 bool IsBoundingBoxValid(
int bbox[4]);
117 void MapTextPropertyToId(
vtkTextProperty *tprop,
unsigned long *tprop_cache_id);
118 void MapIdToTextProperty(
unsigned long tprop_cache_id,
vtkTextProperty *tprop);
126 vtkSetMacro(ScaleToPowerTwo,
bool);
127 vtkGetMacro(ScaleToPowerTwo,
bool);
128 vtkBooleanMacro(ScaleToPowerTwo,
bool);
135 template <
typename T>
136 bool CalculateBoundingBox(
vtkTextProperty *tprop,
const T& str,
int bbox[4]);
142 template <
typename T>
151 template <
typename T>
170 bool GetGlyphIndex(
vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex);
185 GLYPH_REQUEST_DEFAULT = 0,
186 GLYPH_REQUEST_BITMAP = 1,
187 GLYPH_REQUEST_OUTLINE = 2
192 int request = GLYPH_REQUEST_DEFAULT);
193 bool GetSize(
unsigned long tprop_cache_id,
int font_size, FT_Size *
size);
194 bool GetFace(
unsigned long tprop_cache_id, FT_Face *face);
195 bool GetGlyphIndex(
unsigned long tprop_cache_id, FT_UInt32 c,
197 bool GetGlyph(
unsigned long tprop_cache_id,
201 int request = GLYPH_REQUEST_DEFAULT);
217 FT_Face &face,
bool &face_has_kerning);
222 FT_Bitmap* GetBitmap(FT_UInt32 c,
unsigned long prop_cache_id,
223 int prop_font_size, FT_UInt &gindex,
224 FT_BitmapGlyph &bitmap_glyph);
232 FTC_Manager *CacheManager;
233 FTC_ImageCache *ImageCache;
234 FTC_CMapCache *CMapCache;
238 FTC_Manager* GetCacheManager();
239 FTC_ImageCache* GetImageCache();
240 FTC_CMapCache* GetCMapCache();
243 unsigned int MaximumNumberOfFaces;
244 unsigned int MaximumNumberOfSizes;
245 unsigned long MaximumNumberOfBytes;
247 void InitializeCacheManager();
248 void ReleaseCacheManager();
Wrapper around vtkstd::string to keep symbols short.
abstract base class for most VTK objects
#define VTK_UNSIGNED_LONG_MAX
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
topologically and geometrically regular array of data
#define VTK_UNSIGNED_INT_MAX
represent text properties.
String class that stores Unicode text.