65#ifndef vtkFreeTypeTools_h
66#define vtkFreeTypeTools_h
69#include "vtkRenderingFreeTypeModule.h"
82#include "vtk_freetype.h"
90class vtkTextPropertyLookup;
147 vtkSetMacro(DebugTextures,
bool);
148 vtkGetMacro(DebugTextures,
bool);
149 vtkBooleanMacro(DebugTextures,
bool);
187 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
189 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
191 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
205 "str, int dpi, int bbox[4])")
234 int textDims[2] =
nullptr);
260 int GetConstrainedFontSize(
265 int targetWidth,
int targetHeight);
272 static vtkTypeUInt16 HashString(const
char* str);
278 static vtkTypeUInt32 HashBuffer(const
void* buffer,
size_t n, vtkTypeUInt32 hash = 0);
302 vtkSetMacro(ScaleToPowerTwo,
bool);
303 vtkGetMacro(ScaleToPowerTwo,
bool);
304 vtkBooleanMacro(ScaleToPowerTwo,
bool);
313 vtkSetMacro(ForceCompiledFonts,
bool);
314 vtkGetMacro(ForceCompiledFonts,
bool);
315 vtkBooleanMacro(ForceCompiledFonts,
bool);
330 virtual FT_Error CreateFTCManager();
392 GLYPH_REQUEST_DEFAULT = 0,
393 GLYPH_REQUEST_BITMAP = 1,
394 GLYPH_REQUEST_OUTLINE = 2
397 vtkTextProperty* tprop, FT_UInt32 c, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
398 bool GetSize(
size_t tprop_cache_id,
int font_size, FT_Size* size);
399 bool GetSize(FTC_Scaler scaler, FT_Size* size);
400 bool GetFace(
size_t tprop_cache_id, FT_Face* face);
402 bool GetGlyph(
size_t tprop_cache_id,
int font_size, FT_UInt gindex, FT_Glyph* glyph,
403 int request = GLYPH_REQUEST_DEFAULT);
405 FTC_Scaler scaler, FT_UInt gindex, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
425 FT_Bitmap*
GetBitmap(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
426 FT_BitmapGlyph& bitmap_glyph);
428 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_BitmapGlyph& bitmap_glyph);
435 FT_Outline*
GetOutline(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
436 FT_OutlineGlyph& outline_glyph);
438 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_OutlineGlyph& outline_glyph);
491 template <
typename StringType>
492 bool RenderStringInternal(
498 template <
typename StringType>
506 bool CalculateBoundingBox(
const vtkStdString& str, MetaData& metaData);
508 "Use bool CalculateBoundingBox(const vtkStdString& str, MetaData& metaData)")
510 template <typename T>
511 bool CalculateBoundingBox(const T& str, MetaData& metaData, const T& defaultHeightString);
519 template <typename StringType, typename DataType>
520 bool PopulateData(const StringType& str, DataType data, MetaData& metaData);
525 template <typename IteratorType, typename DataType>
527 IteratorType begin, IteratorType end,
int lineIndex, DataType data, MetaData& metaData);
533 template <typename CharType>
534 bool RenderCharacter(CharType character,
int& x,
int& y, FT_UInt& previousGlyphIndex,
536 template <typename CharType>
537 bool RenderCharacter(CharType character,
int& x,
int& y, FT_UInt& previousGlyphIndex,
538 vtkPath* path, MetaData& metaData);
541 void OutlineToPath(
int x,
int y, FT_Outline* outline,
vtkPath* path);
548 template <typename T>
549 int FitStringToBBox(const T& str, MetaData& metaData,
int targetWidth,
int targetHeight);
559 template <typename T>
560 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