28 #ifndef __vtkFreeTypeTools_h
29 #define __vtkFreeTypeTools_h
41 #include "vtk_freetype.h"
42 #include FT_FREETYPE_H
49 class vtkTextPropertyLookup;
76 FT_Library* GetLibrary();
104 bool IsBoundingBoxValid(
int bbox[4]);
134 int targetWidth,
int targetHeight);
137 int targetWidth,
int targetHeight);
142 static vtkTypeUInt16 HashString(
const char *str);
153 void MapTextPropertyToId(
vtkTextProperty *tprop,
unsigned long *tprop_cache_id);
154 void MapIdToTextProperty(
unsigned long tprop_cache_id,
vtkTextProperty *tprop);
184 virtual FT_Error CreateFTCManager();
193 ImageMetaData &metaData);
198 template <
typename StringType>
199 bool RenderStringInternal(
vtkTextProperty *tprop,
const StringType &str,
205 template <
typename StringType>
206 bool StringToPathInternal(
vtkTextProperty *tprop,
const StringType &str,
214 template <
typename T>
215 bool CalculateBoundingBox(
const T& str, MetaData &metaData);
226 template <
typename StringType,
typename DataType>
227 bool PopulateData(
const StringType& str, DataType
data, MetaData &metaData);
233 template <
typename IteratorType,
typename DataType>
234 bool RenderLine(IteratorType begin, IteratorType
end,
int lineIndex,
235 DataType
data, MetaData &metaData);
241 template <
typename CharType>
242 bool RenderCharacter(CharType character,
int &
x,
int &
y,
245 template <
typename CharType>
246 bool RenderCharacter(CharType character,
int &
x,
int &
y,
252 void JustifyPath(
vtkPath *
path, MetaData &metaData);
258 template <
typename T>
259 int FitStringToBBox(
const T &str, MetaData &metaData,
int targetWidth,
292 GLYPH_REQUEST_DEFAULT = 0,
293 GLYPH_REQUEST_BITMAP = 1,
294 GLYPH_REQUEST_OUTLINE = 2
299 int request = GLYPH_REQUEST_DEFAULT);
300 bool GetSize(
unsigned long tprop_cache_id,
int font_size, FT_Size *
size);
301 bool GetFace(
unsigned long tprop_cache_id, FT_Face *
face);
302 bool GetGlyphIndex(
unsigned long tprop_cache_id, FT_UInt32
c,
304 bool GetGlyph(
unsigned long tprop_cache_id,
308 int request = GLYPH_REQUEST_DEFAULT);
320 FT_Face &
face,
bool &face_has_kerning);
325 FT_Bitmap* GetBitmap(FT_UInt32
c,
unsigned long prop_cache_id,
326 int prop_font_size, FT_UInt &gindex,
327 FT_BitmapGlyph &bitmap_glyph);
332 FT_Outline* GetOutline(FT_UInt32
c,
unsigned long prop_cache_id,
333 int prop_font_size, FT_UInt &gindex,
334 FT_OutlineGlyph &outline_glyph);
344 void GetLineMetrics(T begin, T
end, MetaData &metaData,
int &
width,
367 FTC_Manager* GetCacheManager();
368 FTC_ImageCache* GetImageCache();
369 FTC_CMapCache* GetCMapCache();
378 void InitializeCacheManager();
379 void ReleaseCacheManager();
GLsizei GLsizei GLenum GLenum const GLvoid * data
Wrapper around std::string to keep symbols short.
abstract base class for most VTK objects
GLenum GLsizei GLenum GLenum const GLvoid * image
concrete dataset representing a path defined by Bezier curves.
#define vtkGetMacro(name, type)
#define VTK_UNSIGNED_LONG_MAX
#define vtkSetClampMacro(name, type, min, max)
#define VTKRENDERINGFREETYPE_EXPORT
GLint GLint GLint GLint GLint GLint y
#define vtkTypeMacro(thisClass, superclass)
GLint GLint GLint GLint GLint x
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
topologically and geometrically regular array of data
GLint GLint GLsizei width
#define VTK_UNSIGNED_INT_MAX
GLsizei const GLchar ** path
represent text properties.
#define vtkBooleanMacro(name, type)
GLenum GLuint GLint GLenum face
String class that stores Unicode text.
#define vtkSetMacro(name, type)