35#ifndef vtkFreeTypeTools_h
36#define vtkFreeTypeTools_h
39#include "vtkRenderingFreeTypeModule.h"
52#include "vtk_freetype.h"
60class vtkTextPropertyLookup;
117 vtkSetMacro(DebugTextures,
bool);
118 vtkGetMacro(DebugTextures,
bool);
119 vtkBooleanMacro(DebugTextures,
bool);
157 vtkGetMacro(MaximumNumberOfFaces,
unsigned int);
159 vtkGetMacro(MaximumNumberOfSizes,
unsigned int);
161 vtkGetMacro(MaximumNumberOfBytes,
unsigned long);
175 "str, int dpi, int bbox[4])")
204 int textDims[2] =
nullptr);
230 int GetConstrainedFontSize(
235 int targetWidth,
int targetHeight);
242 static vtkTypeUInt16 HashString(const
char* str);
248 static vtkTypeUInt32 HashBuffer(const
void* buffer,
size_t n, vtkTypeUInt32 hash = 0);
272 vtkSetMacro(ScaleToPowerTwo,
bool);
273 vtkGetMacro(ScaleToPowerTwo,
bool);
274 vtkBooleanMacro(ScaleToPowerTwo,
bool);
283 vtkSetMacro(ForceCompiledFonts,
bool);
284 vtkGetMacro(ForceCompiledFonts,
bool);
285 vtkBooleanMacro(ForceCompiledFonts,
bool);
300 virtual FT_Error CreateFTCManager();
362 GLYPH_REQUEST_DEFAULT = 0,
363 GLYPH_REQUEST_BITMAP = 1,
364 GLYPH_REQUEST_OUTLINE = 2
367 vtkTextProperty* tprop, FT_UInt32 c, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
368 bool GetSize(
size_t tprop_cache_id,
int font_size, FT_Size*
size);
370 bool GetFace(
size_t tprop_cache_id, FT_Face* face);
372 bool GetGlyph(
size_t tprop_cache_id,
int font_size, FT_UInt gindex, FT_Glyph* glyph,
373 int request = GLYPH_REQUEST_DEFAULT);
375 FTC_Scaler scaler, FT_UInt gindex, FT_Glyph* glyph,
int request = GLYPH_REQUEST_DEFAULT);
395 FT_Bitmap*
GetBitmap(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
396 FT_BitmapGlyph& bitmap_glyph);
398 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_BitmapGlyph& bitmap_glyph);
405 FT_Outline*
GetOutline(FT_UInt32 c,
size_t prop_cache_id,
int prop_font_size, FT_UInt& gindex,
406 FT_OutlineGlyph& outline_glyph);
408 FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_OutlineGlyph& outline_glyph);
461 template <
typename StringType>
462 bool RenderStringInternal(
468 template <
typename StringType>
476 bool CalculateBoundingBox(
const vtkStdString& str, MetaData& metaData);
478 "Use bool CalculateBoundingBox(const vtkStdString& str, MetaData& metaData)")
480 template <typename T>
481 bool CalculateBoundingBox(const T& str, MetaData& metaData, const T& defaultHeightString);
489 template <typename StringType, typename DataType>
490 bool PopulateData(const StringType& str, DataType
data, MetaData& metaData);
495 template <typename IteratorType, typename DataType>
497 IteratorType begin, IteratorType end,
int lineIndex, DataType
data, MetaData& metaData);
503 template <typename CharType>
504 bool RenderCharacter(CharType character,
int& x,
int& y, FT_UInt& previousGlyphIndex,
506 template <typename CharType>
507 bool RenderCharacter(CharType character,
int& x,
int& y, FT_UInt& previousGlyphIndex,
508 vtkPath* path, MetaData& metaData);
511 void OutlineToPath(
int x,
int y, FT_Outline* outline,
vtkPath* path);
518 template <typename T>
519 int FitStringToBBox(const T& str, MetaData& metaData,
int targetWidth,
int targetHeight);
529 template <typename T>
530 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.
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