38#ifndef vtkFreeTypeTools_h
39#define vtkFreeTypeTools_h
42#include "vtkRenderingFreeTypeModule.h"
54#include "vtk_freetype.h"
62class vtkTextPropertyLookup;
119 vtkSetMacro(DebugTextures,
bool);
120 vtkGetMacro(DebugTextures,
bool);
121 vtkBooleanMacro(DebugTextures,
bool);
150 vtkTextProperty* tprop, vtkTypeUInt32 leftChar, vtkTypeUInt32 rightChar);
159 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
161 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
163 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
199 int textDims[2] =
nullptr);
232 static vtkTypeUInt32
HashBuffer(
const void* buffer,
size_t n, vtkTypeUInt32 hash = 0);
256 vtkSetMacro(ScaleToPowerTwo,
bool);
257 vtkGetMacro(ScaleToPowerTwo,
bool);
258 vtkBooleanMacro(ScaleToPowerTwo,
bool);
267 vtkSetMacro(ForceCompiledFonts,
bool);
268 vtkGetMacro(ForceCompiledFonts,
bool);
269 vtkBooleanMacro(ForceCompiledFonts,
bool);
346 GLYPH_REQUEST_DEFAULT = 0,
347 GLYPH_REQUEST_BITMAP = 1,
348 GLYPH_REQUEST_OUTLINE = 2
351 vtkTextProperty* tprop, FT_UInt32 c, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
352 bool GetSize(
size_t tprop_cache_id,
int font_size, FT_Size* size);
353 bool GetSize(FTC_Scaler scaler, FT_Size* size);
354 bool GetFace(
size_t tprop_cache_id, FT_Face* face);
356 bool GetGlyph(
size_t tprop_cache_id,
int font_size, FT_UInt gindex, FT_Glyph* glyph,
357 int request = GLYPH_REQUEST_DEFAULT);
359 FTC_Scaler scaler, FT_UInt gindex, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
379 FT_Bitmap*
GetBitmap(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
380 FT_BitmapGlyph& bitmap_glyph);
382 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_BitmapGlyph& bitmap_glyph);
389 FT_Outline*
GetOutline(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
390 FT_OutlineGlyph& outline_glyph);
392 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_OutlineGlyph& outline_glyph);
445 bool RenderStringInternal(
458 bool CalculateBoundingBox(
const vtkStdString& str, MetaData& metaData);
459 bool CalculateBoundingBox(
460 const std::string& str, MetaData& metaData,
const std::string& defaultHeightString);
468 template <
typename DataType>
469 bool PopulateData(
const std::string& str, DataType data, MetaData& metaData);
474 template <
typename DataType>
475 bool RenderLine(std::string::const_iterator begin, std::string::const_iterator end,
int lineIndex,
476 DataType data, MetaData& metaData);
482 bool RenderCharacter(FT_UInt32 codepoint,
int& x,
int& y, FT_UInt& previousGlyphIndex,
484 bool RenderCharacter(FT_UInt32 codepoint,
int& x,
int& y, FT_UInt& previousGlyphIndex,
485 vtkPath* path, MetaData& metaData);
488 void OutlineToPath(
int x,
int y, FT_Outline* outline,
vtkPath* path);
496 const std::string& str, MetaData& metaData,
int targetWidth,
int targetHeight);
506 void GetLineMetrics(std::string::const_iterator begin, std::string::const_iterator end,
507 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.
Hold a reference to a vtkObjectBase instance.
Wrapper around std::string to keep symbols short.
represent text properties.
#define VTK_UNSIGNED_LONG_MAX
#define VTK_UNSIGNED_INT_MAX