Go to the documentation of this file.
28 #ifndef vtkFreeTypeUtilities_h
29 #define vtkFreeTypeUtilities_h
31 #define VTK_FTFC_CACHE_CAPACITY 150
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
147 GLYPH_REQUEST_DEFAULT = 0,
148 GLYPH_REQUEST_BITMAP = 1,
149 GLYPH_REQUEST_OUTLINE = 2
155 int request = GLYPH_REQUEST_DEFAULT);
196 int GetSize(
unsigned long tprop_cache_id,
int font_size, FT_Size *
size);
204 int request = GLYPH_REQUEST_DEFAULT);
240 int totalWidth,
int *
x,
int *
y);
249 #ifdef FTGL_USE_NAMESPACE
259 double override_color[3] = NULL);
279 #ifdef VTK_FREETYPE_CACHING_SUPPORTED
280 FTC_Manager *CacheManager;
281 FTC_ImageCache *ImageCache;
282 FTC_CMapCache *CMapCache;
286 FTC_Manager* GetCacheManager();
287 FTC_ImageCache* GetImageCache();
288 FTC_CMapCache* GetCMapCache();
292 unsigned int MaximumNumberOfFaces;
293 unsigned int MaximumNumberOfSizes;
294 unsigned long MaximumNumberOfBytes;
296 void InitializeCacheManager();
297 void ReleaseCacheManager();
301 void PrintEntry(
int i,
char *msg = 0);
302 void ReleaseEntry(
int i);
304 void InitializeCache();
GLsizei GLsizei GLenum GLenum const GLvoid * data
vtkTextProperty * TextProperty
int GetGlyphIndex(vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex)
int GetGlyphIndex(unsigned long tprop_cache_id, FT_UInt32 c, FT_UInt *gindex)
void GetWidthHeightDescender(const char *str, vtkTextProperty *tprop, int *width, int *height, float *descender)
FreeType library support.
static void SetInstance(vtkFreeTypeUtilities *instance)
void JustifyLine(const char *str, vtkTextProperty *tprop, int totalWidth, int *x, int *y)
#define VTK_UNSIGNED_LONG_MAX
~vtkFreeTypeUtilitiesCleanup()
void MapTextPropertyToId(vtkTextProperty *tprop, unsigned long *tprop_cache_id)
#define vtkTypeMacro(thisClass, superclass)
abstract base class for most VTK objects
void MapIdToTextProperty(unsigned long tprop_cache_id, vtkTextProperty *tprop)
GLint GLint GLint GLint GLint x
FT_Library * GetLibrary()
int GetBoundingBox(vtkTextProperty *tprop, const char *str, int bbox[4])
int IsBoundingBoxValid(int bbox[4])
int GetGlyph(unsigned long tprop_cache_id, int font_size, FT_UInt gindex, FT_Glyph *glyph, int request=GLYPH_REQUEST_DEFAULT)
#define vtkSetClampMacro(name, type, min, max)
int GetSize(vtkTextProperty *tprop, FT_Size *size)
static vtkFreeTypeUtilities * GetInstance()
void PrintSelf(ostream &os, vtkIndent indent)
virtual ~vtkFreeTypeUtilities()
topologically and geometrically regular array of data
An actor that displays text. Scaled or unscaled.
a simple class to control print indentation
#define VTK_FTFC_CACHE_CAPACITY
#define vtkGetMacro(name, type)
int RenderString(vtkTextProperty *tprop, const char *str, vtkImageData *data)
abstract specification for Viewports
represent text properties.
GLint GLint GLsizei width
int GetFace(unsigned long tprop_cache_id, FT_Face *face)
static vtkFreeTypeUtilities * New()
vtkFreeTypeUtilitiesCleanup()
GLint GLint GLint GLint GLint GLint y
int GetGlyph(vtkTextProperty *tprop, FT_UInt32 c, FT_Glyph *glyph, int request=GLYPH_REQUEST_DEFAULT)
#define VTK_UNSIGNED_INT_MAX
GLenum GLuint GLint GLenum face
int GetConstrainedFontSize(const char *str, vtkTextProperty *tprop, double orientation, int targetWidth, int targetHeight)
int GetFace(vtkTextProperty *tprop, FT_Face *face)
int PopulateImageData(vtkTextProperty *tprop, const char *str, int x, int y, vtkImageData *data, int use_shadow_color)
vtkFreeTypeUtilities::Entry * GetFont(vtkTextProperty *tprop, double override_color[3]=NULL)
void PrepareImageData(vtkImageData *data, vtkTextProperty *tprop, const char *str, int *x, int *y)
#define VTKRENDERINGFREETYPE_EXPORT
GLint GLint GLsizei GLsizei height
int GetSize(unsigned long tprop_cache_id, int font_size, FT_Size *size)