56#ifndef vtkFreeTypeTools_h
57#define vtkFreeTypeTools_h
60#include "vtkRenderingFreeTypeModule.h"
66VTK_ABI_NAMESPACE_BEGIN
74#include "vtk_freetype.h"
79VTK_ABI_NAMESPACE_BEGIN
83class vtkTextPropertyLookup;
140 vtkSetMacro(DebugTextures,
bool);
141 vtkGetMacro(DebugTextures,
bool);
142 vtkBooleanMacro(DebugTextures,
bool);
171 vtkTextProperty* tprop, vtkTypeUInt32 leftChar, vtkTypeUInt32 rightChar);
180 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
182 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
184 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
220 int textDims[2] =
nullptr);
253 static vtkTypeUInt32
HashBuffer(
const void* buffer,
size_t n, vtkTypeUInt32 hash = 0);
277 vtkSetMacro(ScaleToPowerTwo,
bool);
278 vtkGetMacro(ScaleToPowerTwo,
bool);
279 vtkBooleanMacro(ScaleToPowerTwo,
bool);
288 vtkSetMacro(ForceCompiledFonts,
bool);
289 vtkGetMacro(ForceCompiledFonts,
bool);
290 vtkBooleanMacro(ForceCompiledFonts,
bool);
367 GLYPH_REQUEST_DEFAULT = 0,
368 GLYPH_REQUEST_BITMAP = 1,
369 GLYPH_REQUEST_OUTLINE = 2
372 vtkTextProperty* tprop, FT_UInt32 c, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
373 bool GetSize(
size_t tprop_cache_id,
int font_size, FT_Size* size);
374 bool GetSize(FTC_Scaler scaler, FT_Size* size);
375 bool GetFace(
size_t tprop_cache_id, FT_Face* face);
377 bool GetGlyph(
size_t tprop_cache_id,
int font_size, FT_UInt gindex, FT_Glyph* glyph,
378 int request = GLYPH_REQUEST_DEFAULT);
380 FTC_Scaler scaler, FT_UInt gindex, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
400 FT_Bitmap*
GetBitmap(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
401 FT_BitmapGlyph& bitmap_glyph);
403 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_BitmapGlyph& bitmap_glyph);
410 FT_Outline*
GetOutline(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
411 FT_OutlineGlyph& outline_glyph);
413 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_OutlineGlyph& outline_glyph);
466 bool RenderStringInternal(
479 bool CalculateBoundingBox(
const vtkStdString& str, MetaData& metaData);
480 bool CalculateBoundingBox(
481 const std::string& str, MetaData& metaData,
const std::string& defaultHeightString);
489 template <
typename DataType>
490 bool PopulateData(
const std::string& str, DataType data, MetaData& metaData);
495 template <
typename DataType>
496 bool RenderLine(std::string::const_iterator begin, std::string::const_iterator end,
int lineIndex,
497 DataType data, MetaData& metaData);
503 bool RenderCharacter(FT_UInt32 codepoint,
int& x,
int& y, FT_UInt& previousGlyphIndex,
505 bool RenderCharacter(FT_UInt32 codepoint,
int& x,
int& y, FT_UInt& previousGlyphIndex,
506 vtkPath* path, MetaData& metaData);
509 void OutlineToPath(
int x,
int y, FT_Outline* outline,
vtkPath* path);
517 const std::string& str, MetaData& metaData,
int targetWidth,
int targetHeight);
527 void GetLineMetrics(std::string::const_iterator begin, std::string::const_iterator end,
528 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