28 #ifndef vtkFreeTypeTools_h 29 #define vtkFreeTypeTools_h 42 #include "vtk_freetype.h" 43 #include FT_FREETYPE_H 50 class vtkTextPropertyLookup;
85 FT_Library* GetLibrary();
106 int dpi,
int bbox[4]);
108 int dpi,
int bbox[4]);
151 int dpi,
int targetWidth,
int targetHeight);
154 int targetWidth,
int targetHeight);
159 static vtkTypeUInt16 HashString(
const char *str);
170 void MapTextPropertyToId(
vtkTextProperty *tprop,
size_t *tprop_cache_id);
171 void MapIdToTextProperty(
size_t tprop_cache_id,
vtkTextProperty *tprop);
201 virtual FT_Error CreateFTCManager();
208 bool PrepareMetaData(
vtkTextProperty *tprop,
int dpi, MetaData &metaData);
210 ImageMetaData &metaData);
220 ImageMetaData &metaData);
252 GLYPH_REQUEST_DEFAULT = 0,
253 GLYPH_REQUEST_BITMAP = 1,
254 GLYPH_REQUEST_OUTLINE = 2
259 int request = GLYPH_REQUEST_DEFAULT);
260 bool GetSize(
size_t tprop_cache_id,
int font_size, FT_Size *
size);
261 bool GetSize(FTC_Scaler scaler, FT_Size *
size);
262 bool GetFace(
size_t tprop_cache_id, FT_Face *
face);
263 bool GetGlyphIndex(
size_t tprop_cache_id, FT_UInt32
c,
265 bool GetGlyph(
size_t tprop_cache_id,
269 int request = GLYPH_REQUEST_DEFAULT);
270 bool GetGlyph(FTC_Scaler scaler,
273 int request = GLYPH_REQUEST_DEFAULT);
285 FT_Face &
face,
bool &face_has_kerning);
290 FT_Bitmap* GetBitmap(FT_UInt32
c,
size_t prop_cache_id,
291 int prop_font_size, FT_UInt &gindex,
292 FT_BitmapGlyph &bitmap_glyph);
293 FT_Bitmap* GetBitmap(FT_UInt32
c, FTC_Scaler scaler, FT_UInt &gindex,
294 FT_BitmapGlyph &bitmap_glyph);
299 FT_Outline* GetOutline(FT_UInt32
c,
size_t prop_cache_id,
300 int prop_font_size, FT_UInt &gindex,
301 FT_OutlineGlyph &outline_glyph);
302 FT_Outline* GetOutline(FT_UInt32
c, FTC_Scaler scaler, FT_UInt &gindex,
303 FT_OutlineGlyph &outline_glyph);
325 FTC_Manager* GetCacheManager();
326 FTC_ImageCache* GetImageCache();
327 FTC_CMapCache* GetCMapCache();
337 void InitializeCacheManager();
338 void ReleaseCacheManager();
346 template <
typename StringType>
347 bool RenderStringInternal(
vtkTextProperty *tprop,
const StringType &str,
353 template <
typename StringType>
354 bool StringToPathInternal(
vtkTextProperty *tprop,
const StringType &str,
361 template <
typename T>
362 bool CalculateBoundingBox(
const T& str, MetaData &metaData);
369 template <
typename StringType,
typename DataType>
370 bool PopulateData(
const StringType& str, DataType
data, MetaData &metaData);
376 template <
typename IteratorType,
typename DataType>
377 bool RenderLine(IteratorType begin, IteratorType
end,
int lineIndex,
378 DataType
data, MetaData &metaData);
384 template <
typename CharType>
385 bool RenderCharacter(CharType character,
int &
x,
int &
y,
388 template <
typename CharType>
389 bool RenderCharacter(CharType character,
int &
x,
int &
y,
398 template <
typename T>
399 int FitStringToBBox(
const T &str, MetaData &metaData,
int targetWidth,
410 void GetLineMetrics(T begin, T
end, MetaData &metaData,
int &
width,
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)