68 #ifndef vtkFreeTypeTools_h
69 #define vtkFreeTypeTools_h
72 #include "vtkRenderingFreeTypeModule.h"
84 #include "vtk_freetype.h"
85 #include FT_FREETYPE_H
92 class vtkTextPropertyLookup;
149 vtkSetMacro(DebugTextures,
bool);
150 vtkGetMacro(DebugTextures,
bool);
151 vtkBooleanMacro(DebugTextures,
bool);
180 vtkTextProperty* tprop, vtkTypeUInt32 leftChar, vtkTypeUInt32 rightChar);
189 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
191 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
193 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
229 int textDims[2] =
nullptr);
262 static vtkTypeUInt32
HashBuffer(
const void* buffer,
size_t n, vtkTypeUInt32 hash = 0);
286 vtkSetMacro(ScaleToPowerTwo,
bool);
287 vtkGetMacro(ScaleToPowerTwo,
bool);
288 vtkBooleanMacro(ScaleToPowerTwo,
bool);
297 vtkSetMacro(ForceCompiledFonts,
bool);
298 vtkGetMacro(ForceCompiledFonts,
bool);
299 vtkBooleanMacro(ForceCompiledFonts,
bool);
376 GLYPH_REQUEST_DEFAULT = 0,
377 GLYPH_REQUEST_BITMAP = 1,
378 GLYPH_REQUEST_OUTLINE = 2
381 vtkTextProperty* tprop, FT_UInt32 c, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
382 bool GetSize(
size_t tprop_cache_id,
int font_size, FT_Size*
size);
384 bool GetFace(
size_t tprop_cache_id, FT_Face* face);
386 bool GetGlyph(
size_t tprop_cache_id,
int font_size, FT_UInt gindex, FT_Glyph* glyph,
387 int request = GLYPH_REQUEST_DEFAULT);
389 FTC_Scaler scaler, FT_UInt gindex, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
409 FT_Bitmap*
GetBitmap(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
410 FT_BitmapGlyph& bitmap_glyph);
412 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_BitmapGlyph& bitmap_glyph);
419 FT_Outline*
GetOutline(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
420 FT_OutlineGlyph& outline_glyph);
422 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_OutlineGlyph& outline_glyph);
475 bool RenderStringInternal(
488 bool CalculateBoundingBox(
const vtkStdString& str, MetaData& metaData);
489 bool CalculateBoundingBox(
498 template <
typename DataType>
499 bool PopulateData(
const std::string& str, DataType
data, MetaData& metaData);
504 template <
typename DataType>
505 bool RenderLine(std::string::const_iterator begin, std::string::const_iterator end,
int lineIndex,
506 DataType
data, MetaData& metaData);
512 bool RenderCharacter(FT_UInt32 codepoint,
int& x,
int& y, FT_UInt& previousGlyphIndex,
514 bool RenderCharacter(FT_UInt32 codepoint,
int& x,
int& y, FT_UInt& previousGlyphIndex,
515 vtkPath* path, MetaData& metaData);
518 void OutlineToPath(
int x,
int y, FT_Outline* outline,
vtkPath* path);
526 const std::string& str, MetaData& metaData,
int targetWidth,
int targetHeight);
536 void GetLineMetrics(std::string::const_iterator begin, std::string::const_iterator end,
537 MetaData& metaData,
int& width,
int bbox[4]);
topologically and geometrically regular array of data
a simple class to control print indentation
abstract base class for most VTK objects
concrete dataset representing a path defined by Bezier curves.
Wrapper around std::string to keep symbols short.
represent text properties.
#define VTK_UNSIGNED_LONG_MAX
#define VTK_UNSIGNED_INT_MAX