26#ifndef vtkFreeTypeTools_h
27#define vtkFreeTypeTools_h
30#include "vtkRenderingFreeTypeModule.h"
43#include "vtk_freetype.h"
51class vtkTextPropertyLookup;
108 vtkSetMacro(DebugTextures,
bool);
109 vtkGetMacro(DebugTextures,
bool);
110 vtkBooleanMacro(DebugTextures,
bool);
148 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
150 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
152 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
166 "str, int dpi, int bbox[4])")
195 int textDims[2] =
nullptr);
221 int GetConstrainedFontSize(
226 int targetWidth,
int targetHeight);
233 static vtkTypeUInt16 HashString(const
char* str);
239 static vtkTypeUInt32 HashBuffer(const
void* buffer,
size_t n, vtkTypeUInt32 hash = 0);
263 vtkSetMacro(ScaleToPowerTwo,
bool);
264 vtkGetMacro(ScaleToPowerTwo,
bool);
265 vtkBooleanMacro(ScaleToPowerTwo,
bool);
274 vtkSetMacro(ForceCompiledFonts,
bool);
275 vtkGetMacro(ForceCompiledFonts,
bool);
276 vtkBooleanMacro(ForceCompiledFonts,
bool);
291 virtual FT_Error CreateFTCManager();
353 GLYPH_REQUEST_DEFAULT = 0,
354 GLYPH_REQUEST_BITMAP = 1,
355 GLYPH_REQUEST_OUTLINE = 2
358 vtkTextProperty* tprop, FT_UInt32 c, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
359 bool GetSize(
size_t tprop_cache_id,
int font_size, FT_Size* size);
360 bool GetSize(FTC_Scaler scaler, FT_Size* size);
361 bool GetFace(
size_t tprop_cache_id, FT_Face* face);
363 bool GetGlyph(
size_t tprop_cache_id,
int font_size, FT_UInt gindex, FT_Glyph* glyph,
364 int request = GLYPH_REQUEST_DEFAULT);
366 FTC_Scaler scaler, FT_UInt gindex, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
386 FT_Bitmap*
GetBitmap(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
387 FT_BitmapGlyph& bitmap_glyph);
389 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_BitmapGlyph& bitmap_glyph);
396 FT_Outline*
GetOutline(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
397 FT_OutlineGlyph& outline_glyph);
399 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_OutlineGlyph& outline_glyph);
452 template <
typename StringType>
453 bool RenderStringInternal(
459 template <
typename StringType>
467 bool CalculateBoundingBox(
const vtkStdString& str, MetaData& metaData);
469 "Use bool CalculateBoundingBox(const vtkStdString& str, MetaData& metaData)")
471 template <typename T>
472 bool CalculateBoundingBox(const T& str, MetaData& metaData, const T& defaultHeightString);
480 template <typename StringType, typename DataType>
481 bool PopulateData(const StringType& str, DataType data, MetaData& metaData);
486 template <typename IteratorType, typename DataType>
488 IteratorType begin, IteratorType end,
int lineIndex, DataType data, MetaData& metaData);
494 template <typename CharType>
495 bool RenderCharacter(CharType character,
int& x,
int& y, FT_UInt& previousGlyphIndex,
497 template <typename CharType>
498 bool RenderCharacter(CharType character,
int& x,
int& y, FT_UInt& previousGlyphIndex,
499 vtkPath* path, MetaData& metaData);
502 void OutlineToPath(
int x,
int y, FT_Outline* outline,
vtkPath* path);
509 template <typename T>
510 int FitStringToBBox(const T& str, MetaData& metaData,
int targetWidth,
int targetHeight);
520 template <typename T>
521 void GetLineMetrics(T begin, T end, 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.
Interface for generating images and path data from string data, using multiple backends.
String class that stores Unicode text.
#define VTK_DEPRECATED_IN_9_1_0(reason)
#define VTK_UNSIGNED_LONG_MAX
#define VTK_UNSIGNED_INT_MAX
vtkTypeUInt32 vtkUnicodeStringValueType