VTK  9.0.1
vtkFreeTypeTools.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFreeTypeTools.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkFreeTypeTools_h
27 #define vtkFreeTypeTools_h
28 
29 #include "vtkObject.h"
30 #include "vtkRenderingFreeTypeModule.h" // For export macro
31 #include "vtkSmartPointer.h" // For smart pointer
32 #include "vtkTextRenderer.h" // For Metrics struct
33 #include "vtkUnicodeString.h" // For vtkUnicodeStringValueType
34 
35 #include <array> // for std::array
36 
37 class vtkImageData;
38 class vtkPath;
39 class vtkTextProperty;
40 class vtkStdString;
41 
42 // FreeType
43 #include "vtk_freetype.h" //since ft2build.h could be in the path
44 #include FT_FREETYPE_H
45 #include FT_GLYPH_H
46 #include FT_CACHE_H
47 
48 class FTFont;
49 
50 // PIMPL class for FTC_FaceID->vtkTextProperty lookup
51 class vtkTextPropertyLookup;
52 
53 //----------------------------------------------------------------------------
54 // Singleton cleanup
55 class VTKRENDERINGFREETYPE_EXPORT vtkFreeTypeToolsCleanup
56 {
57 public:
60 
61 private:
63  vtkFreeTypeToolsCleanup& operator=(const vtkFreeTypeToolsCleanup&) = delete;
64 };
65 
66 //----------------------------------------------------------------------------
67 // Singleton font cache
68 class VTKRENDERINGFREETYPE_EXPORT vtkFreeTypeTools : public vtkObject
69 {
70 public:
71  struct FaceMetrics
72  {
74  int Ascender;
75  int Descender;
77  std::array<int, 4> BoundingBox; // xmin, xmax, ymin, ymax
79  bool Scalable;
80  bool Bold;
81  bool Italic;
82  };
83  struct GlyphOutline
84  {
87  };
88 
89  vtkTypeMacro(vtkFreeTypeTools, vtkObject);
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
96 
101  static void SetInstance(vtkFreeTypeTools* instance);
102 
104 
108  vtkSetMacro(DebugTextures, bool);
109  vtkGetMacro(DebugTextures, bool);
110  vtkBooleanMacro(DebugTextures, bool);
112 
116  FT_Library* GetLibrary();
117 
124 
131 
138  std::array<int, 2> GetUnscaledKerning(vtkTextProperty* tprop, vtkUnicodeStringValueType leftChar,
139  vtkUnicodeStringValueType rightChar);
140 
142 
147  vtkSetClampMacro(MaximumNumberOfFaces, unsigned int, 1, VTK_UNSIGNED_INT_MAX);
148  vtkGetMacro(MaximumNumberOfFaces, unsigned int);
149  vtkSetClampMacro(MaximumNumberOfSizes, unsigned int, 1, VTK_UNSIGNED_INT_MAX);
150  vtkGetMacro(MaximumNumberOfSizes, unsigned int);
151  vtkSetClampMacro(MaximumNumberOfBytes, unsigned long, 1, VTK_UNSIGNED_LONG_MAX);
152  vtkGetMacro(MaximumNumberOfBytes, unsigned long);
154 
156 
164  bool GetBoundingBox(vtkTextProperty* tprop, const vtkStdString& str, int dpi, int bbox[4]);
165  bool GetBoundingBox(vtkTextProperty* tprop, const vtkUnicodeString& str, int dpi, int bbox[4]);
167 
169 
174  vtkTextProperty* tprop, const vtkStdString& str, int dpi, vtkTextRenderer::Metrics& metrics);
175  bool GetMetrics(vtkTextProperty* tprop, const vtkUnicodeString& str, int dpi,
176  vtkTextRenderer::Metrics& metrics);
178 
180 
190  bool RenderString(vtkTextProperty* tprop, const vtkStdString& str, int dpi, vtkImageData* data,
191  int textDims[2] = nullptr);
192  bool RenderString(vtkTextProperty* tprop, const vtkUnicodeString& str, int dpi,
193  vtkImageData* data, int textDims[2] = nullptr);
195 
197 
203  bool StringToPath(vtkTextProperty* tprop, const vtkStdString& str, int dpi, vtkPath* path);
204  bool StringToPath(vtkTextProperty* tprop, const vtkUnicodeString& str, int dpi, vtkPath* path);
206 
208 
214  const vtkStdString& str, vtkTextProperty* tprop, int dpi, int targetWidth, int targetHeight);
215  int GetConstrainedFontSize(const vtkUnicodeString& str, vtkTextProperty* tprop, int dpi,
216  int targetWidth, int targetHeight);
218 
223  static vtkTypeUInt16 HashString(const char* str);
224 
229  static vtkTypeUInt32 HashBuffer(const void* str, size_t n, vtkTypeUInt32 hash = 0);
230 
232 
242  void MapTextPropertyToId(vtkTextProperty* tprop, size_t* tprop_cache_id);
243  void MapIdToTextProperty(size_t tprop_cache_id, vtkTextProperty* tprop);
245 
247 
253  vtkSetMacro(ScaleToPowerTwo, bool);
254  vtkGetMacro(ScaleToPowerTwo, bool);
255  vtkBooleanMacro(ScaleToPowerTwo, bool);
257 
259 
264  vtkSetMacro(ForceCompiledFonts, bool);
265  vtkGetMacro(ForceCompiledFonts, bool);
266  vtkBooleanMacro(ForceCompiledFonts, bool);
268 
275  static bool LookupFace(vtkTextProperty* tprop, FT_Library lib, FT_Face* face);
276 
277 protected:
281  virtual FT_Error CreateFTCManager();
282 
284 
287  class MetaData;
288  class ImageMetaData;
289  bool PrepareMetaData(vtkTextProperty* tprop, int dpi, MetaData& metaData);
290  bool PrepareImageMetaData(vtkTextProperty* tprop, vtkImageData* image, ImageMetaData& metaData);
292 
297  void PrepareImageData(vtkImageData* data, int bbox[4]);
298 
302  void RenderBackground(vtkTextProperty* tprop, vtkImageData* image, ImageMetaData& metaData);
303 
311  bool GetSize(vtkTextProperty* tprop, FT_Size* size);
312 
319  bool GetFace(vtkTextProperty* tprop, FT_Face* face);
320 
326  bool GetGlyphIndex(vtkTextProperty* tprop, FT_UInt32 c, FT_UInt* gindex);
327 
329 
341  enum
342  {
343  GLYPH_REQUEST_DEFAULT = 0,
344  GLYPH_REQUEST_BITMAP = 1,
345  GLYPH_REQUEST_OUTLINE = 2
346  };
347  bool GetGlyph(
348  vtkTextProperty* tprop, FT_UInt32 c, FT_Glyph* glyph, int request = GLYPH_REQUEST_DEFAULT);
349  bool GetSize(size_t tprop_cache_id, int font_size, FT_Size* size);
350  bool GetSize(FTC_Scaler scaler, FT_Size* size);
351  bool GetFace(size_t tprop_cache_id, FT_Face* face);
352  bool GetGlyphIndex(size_t tprop_cache_id, FT_UInt32 c, FT_UInt* gindex);
353  bool GetGlyph(size_t tprop_cache_id, int font_size, FT_UInt gindex, FT_Glyph* glyph,
354  int request = GLYPH_REQUEST_DEFAULT);
355  bool GetGlyph(
356  FTC_Scaler scaler, FT_UInt gindex, FT_Glyph* glyph, int request = GLYPH_REQUEST_DEFAULT);
358 
363 
365  ~vtkFreeTypeTools() override;
366 
370  bool GetFace(vtkTextProperty* prop, size_t& prop_cache_id, FT_Face& face, bool& face_has_kerning);
371 
373 
376  FT_Bitmap* GetBitmap(FT_UInt32 c, size_t prop_cache_id, int prop_font_size, FT_UInt& gindex,
377  FT_BitmapGlyph& bitmap_glyph);
378  FT_Bitmap* GetBitmap(
379  FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_BitmapGlyph& bitmap_glyph);
381 
383 
386  FT_Outline* GetOutline(FT_UInt32 c, size_t prop_cache_id, int prop_font_size, FT_UInt& gindex,
387  FT_OutlineGlyph& outline_glyph);
388  FT_Outline* GetOutline(
389  FT_UInt32 c, FTC_Scaler scaler, FT_UInt& gindex, FT_OutlineGlyph& outline_glyph);
391 
396 
400  vtkTextPropertyLookup* TextPropertyLookup;
401 
405  FT_Library* Library;
406 
408 
411  FTC_Manager* CacheManager;
412  FTC_ImageCache* ImageCache;
413  FTC_CMapCache* CMapCache;
415 
417 
420  FTC_Manager* GetCacheManager();
421  FTC_ImageCache* GetImageCache();
422  FTC_CMapCache* GetCMapCache();
424 
425  unsigned int MaximumNumberOfFaces;
426  unsigned int MaximumNumberOfSizes;
427  unsigned long MaximumNumberOfBytes;
428 
431 
434 
435 private:
436  vtkFreeTypeTools(const vtkFreeTypeTools&) = delete;
437  void operator=(const vtkFreeTypeTools&) = delete;
438 
442  template <typename StringType>
443  bool RenderStringInternal(
444  vtkTextProperty* tprop, const StringType& str, int dpi, vtkImageData* data, int textDims[2]);
445 
449  template <typename StringType>
450  bool StringToPathInternal(vtkTextProperty* tprop, const StringType& str, int dpi, vtkPath* path);
451 
453 
457  bool CalculateBoundingBox(const vtkStdString& str, MetaData& metaData);
458  bool CalculateBoundingBox(const vtkUnicodeString& str, MetaData& metaData);
459  template <typename T>
460  bool CalculateBoundingBox(const T& str, MetaData& metaData, const T& defaultHeightString);
462 
468  template <typename StringType, typename DataType>
469  bool PopulateData(const StringType& str, DataType data, MetaData& metaData);
470 
474  template <typename IteratorType, typename DataType>
475  bool RenderLine(
476  IteratorType begin, IteratorType end, int lineIndex, DataType data, MetaData& metaData);
477 
479 
482  template <typename CharType>
483  bool RenderCharacter(CharType character, int& x, int& y, FT_UInt& previousGlyphIndex,
484  vtkImageData* image, MetaData& metaData);
485  template <typename CharType>
486  bool RenderCharacter(CharType character, int& x, int& y, FT_UInt& previousGlyphIndex,
487  vtkPath* path, MetaData& metaData);
489 
490  void OutlineToPath(int x, int y, FT_Outline* outline, vtkPath* path);
491 
497  template <typename T>
498  int FitStringToBBox(const T& str, MetaData& metaData, int targetWidth, int targetHeight);
499 
501 
508  template <typename T>
509  void GetLineMetrics(T begin, T end, MetaData& metaData, int& width, int bbox[4]);
511 };
512 
513 // This is here to implement the Schwarz counter idiom.
515 
516 #endif
vtkFreeTypeTools::MaximumNumberOfBytes
unsigned long MaximumNumberOfBytes
Definition: vtkFreeTypeTools.h:427
vtkFreeTypeTools::GetCMapCache
FTC_CMapCache * GetCMapCache()
vtkFreeTypeTools::CreateFTCManager
virtual FT_Error CreateFTCManager()
Create the FreeType Cache manager instance and set this->CacheManager.
vtkFreeTypeTools::GetBitmap
FT_Bitmap * GetBitmap(FT_UInt32 c, FTC_Scaler scaler, FT_UInt &gindex, FT_BitmapGlyph &bitmap_glyph)
vtkFreeTypeTools::GetFace
bool GetFace(size_t tprop_cache_id, FT_Face *face)
vtkFreeTypeTools::ForceCompiledFonts
bool ForceCompiledFonts
Definition: vtkFreeTypeTools.h:429
vtkFreeTypeTools::GetUnscaledGlyphOutline
GlyphOutline GetUnscaledGlyphOutline(vtkTextProperty *tprop, vtkUnicodeStringValueType charId)
Return a generic outline of a glyph with some additional metadata.
vtkFreeTypeTools::RenderString
bool RenderString(vtkTextProperty *tprop, const vtkUnicodeString &str, int dpi, vtkImageData *data, int textDims[2]=nullptr)
vtkFreeTypeTools::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkFreeTypeTools::RenderBackground
void RenderBackground(vtkTextProperty *tprop, vtkImageData *image, ImageMetaData &metaData)
Draw the background quad on the image.
vtkFreeTypeTools::GetBoundingBox
bool GetBoundingBox(vtkTextProperty *tprop, const vtkUnicodeString &str, int dpi, int bbox[4])
vtkFreeTypeTools::DebugTextures
bool DebugTextures
Definition: vtkFreeTypeTools.h:430
vtkFreeTypeTools::MaximumNumberOfSizes
unsigned int MaximumNumberOfSizes
Definition: vtkFreeTypeTools.h:426
vtkFreeTypeTools::FaceMetrics::FamilyName
std::string FamilyName
Definition: vtkFreeTypeTools.h:78
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkFreeTypeTools::HashString
static vtkTypeUInt16 HashString(const char *str)
Turn a string into a hash.
vtkX3D::image
@ image
Definition: vtkX3D.h:380
vtkUnicodeString.h
vtkFreeTypeTools::FaceMetrics::UnitsPerEM
int UnitsPerEM
Definition: vtkFreeTypeTools.h:73
VTK_UNSIGNED_LONG_MAX
#define VTK_UNSIGNED_LONG_MAX
Definition: vtkType.h:161
vtkPath
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:33
vtkFreeTypeTools::GlyphOutline::HorizAdvance
int HorizAdvance
Definition: vtkFreeTypeTools.h:85
vtkFreeTypeTools::InitializeCacheManager
void InitializeCacheManager()
vtkFreeTypeTools::GetBitmap
FT_Bitmap * GetBitmap(FT_UInt32 c, size_t prop_cache_id, int prop_font_size, FT_UInt &gindex, FT_BitmapGlyph &bitmap_glyph)
Now attempt to get the bitmap for the specified character.
vtkSmartPointer< vtkPath >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkFreeTypeTools::PrepareImageMetaData
bool PrepareImageMetaData(vtkTextProperty *tprop, vtkImageData *image, ImageMetaData &metaData)
vtkFreeTypeTools::Instance
static vtkFreeTypeTools * Instance
The singleton instance.
Definition: vtkFreeTypeTools.h:395
vtkFreeTypeTools::GetGlyphIndex
bool GetGlyphIndex(vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex)
Given a text property and a character, get the corresponding FreeType glyph index.
vtkTextRenderer.h
vtkFreeTypeTools::GetGlyphIndex
bool GetGlyphIndex(size_t tprop_cache_id, FT_UInt32 c, FT_UInt *gindex)
vtkFreeTypeTools::~vtkFreeTypeTools
~vtkFreeTypeTools() override
vtkFreeTypeTools::GetLibrary
FT_Library * GetLibrary()
Get the FreeType library singleton.
vtkFreeTypeTools::ScaleToPowerTwo
bool ScaleToPowerTwo
Should the image be scaled to the next highest power of 2?
Definition: vtkFreeTypeTools.h:362
vtkFreeTypeTools::MapIdToTextProperty
void MapIdToTextProperty(size_t tprop_cache_id, vtkTextProperty *tprop)
vtkFreeTypeTools::GetMetrics
bool GetMetrics(vtkTextProperty *tprop, const vtkStdString &str, int dpi, vtkTextRenderer::Metrics &metrics)
Given a text property and a string, get the metrics of the rendered string.
vtkFreeTypeTools::FaceMetrics::Italic
bool Italic
Definition: vtkFreeTypeTools.h:81
vtkFreeTypeTools::GetSize
bool GetSize(size_t tprop_cache_id, int font_size, FT_Size *size)
vtkFreeTypeTools::MapTextPropertyToId
void MapTextPropertyToId(vtkTextProperty *tprop, size_t *tprop_cache_id)
Given a text property 'tprop', get its unique ID in our cache framework.
vtkFreeTypeTools::GetCacheManager
FTC_Manager * GetCacheManager()
Get the FreeType cache manager, image cache and charmap cache.
vtkFreeTypeTools::ImageCache
FTC_ImageCache * ImageCache
Definition: vtkFreeTypeTools.h:412
vtkFreeTypeTools::StringToPath
bool StringToPath(vtkTextProperty *tprop, const vtkStdString &str, int dpi, vtkPath *path)
Given a text property and a string, this function populates the vtkPath path with the outline of the ...
vtkFreeTypeTools::GetBoundingBox
bool GetBoundingBox(vtkTextProperty *tprop, const vtkStdString &str, int dpi, int bbox[4])
Given a text property and a string, get the bounding box {xmin, xmax, ymin, ymax} of the rendered str...
vtkFreeTypeTools::GetOutline
FT_Outline * GetOutline(FT_UInt32 c, size_t prop_cache_id, int prop_font_size, FT_UInt &gindex, FT_OutlineGlyph &outline_glyph)
Attempt to get the outline for the specified character.
vtkFreeTypeTools::GetGlyph
bool GetGlyph(vtkTextProperty *tprop, FT_UInt32 c, FT_Glyph *glyph, int request=GLYPH_REQUEST_DEFAULT)
vtkFreeTypeTools::PrepareMetaData
bool PrepareMetaData(vtkTextProperty *tprop, int dpi, MetaData &metaData)
vtkFreeTypeTools::CacheManager
FTC_Manager * CacheManager
The cache manager, image cache and charmap cache.
Definition: vtkFreeTypeTools.h:411
vtkFreeTypeTools::FaceMetrics::Bold
bool Bold
Definition: vtkFreeTypeTools.h:80
vtkFreeTypeTools::TextPropertyLookup
vtkTextPropertyLookup * TextPropertyLookup
Lookup table that maps free type font cache face ids to vtkTextProperties.
Definition: vtkFreeTypeTools.h:400
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkFreeTypeTools::GlyphOutline
Definition: vtkFreeTypeTools.h:84
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:70
vtkFreeTypeToolsCleanup
Definition: vtkFreeTypeTools.h:56
vtkUnicodeStringValueType
vtkTypeUInt32 vtkUnicodeStringValueType
Definition: vtkUnicodeString.h:55
vtkSmartPointer.h
vtkFreeTypeTools::FaceMetrics
Definition: vtkFreeTypeTools.h:72
vtkFreeTypeTools::FaceMetrics::Ascender
int Ascender
Definition: vtkFreeTypeTools.h:74
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkFreeTypeTools::SetInstance
static void SetInstance(vtkFreeTypeTools *instance)
Supply a user defined instance.
vtkFreeTypeToolsCleanupInstance
static vtkFreeTypeToolsCleanup vtkFreeTypeToolsCleanupInstance
Definition: vtkFreeTypeTools.h:514
vtkFreeTypeTools::GetGlyph
bool GetGlyph(FTC_Scaler scaler, FT_UInt gindex, FT_Glyph *glyph, int request=GLYPH_REQUEST_DEFAULT)
vtkFreeTypeTools::GetFace
bool GetFace(vtkTextProperty *tprop, FT_Face *face)
Given a text property, get the corresponding FreeType face.
vtkObject.h
vtkFreeTypeTools::FaceMetrics::HorizAdvance
int HorizAdvance
Definition: vtkFreeTypeTools.h:76
vtkFreeTypeTools::GetConstrainedFontSize
int GetConstrainedFontSize(const vtkStdString &str, vtkTextProperty *tprop, int dpi, int targetWidth, int targetHeight)
This function returns the font size (in points) required to fit the string in the target rectangle.
vtkFreeTypeTools::GetSize
bool GetSize(FTC_Scaler scaler, FT_Size *size)
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:34
vtkFreeTypeTools::GetFaceMetrics
FaceMetrics GetFaceMetrics(vtkTextProperty *tprop)
Return some metrics about a font face.
vtkFreeTypeTools::PrepareImageData
void PrepareImageData(vtkImageData *data, int bbox[4])
This function initializes the extent of the ImageData to eventually receive the text stored in str.
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkFreeTypeTools::GetGlyph
bool GetGlyph(size_t tprop_cache_id, int font_size, FT_UInt gindex, FT_Glyph *glyph, int request=GLYPH_REQUEST_DEFAULT)
vtkFreeTypeTools::vtkFreeTypeTools
vtkFreeTypeTools()
vtkFreeTypeTools::FaceMetrics::BoundingBox
std::array< int, 4 > BoundingBox
Definition: vtkFreeTypeTools.h:77
vtkFreeTypeTools::GetMetrics
bool GetMetrics(vtkTextProperty *tprop, const vtkUnicodeString &str, int dpi, vtkTextRenderer::Metrics &metrics)
vtkFreeTypeTools::FaceMetrics::Descender
int Descender
Definition: vtkFreeTypeTools.h:75
vtkFreeTypeTools::LookupFace
static bool LookupFace(vtkTextProperty *tprop, FT_Library lib, FT_Face *face)
Lookup and set the FreeType font face face best matching the text property tprop using the compiled A...
vtkFreeTypeTools::HashBuffer
static vtkTypeUInt32 HashBuffer(const void *str, size_t n, vtkTypeUInt32 hash=0)
Hash a string of a given length.
vtkFreeTypeTools::MaximumNumberOfFaces
unsigned int MaximumNumberOfFaces
Definition: vtkFreeTypeTools.h:425
VTK_UNSIGNED_INT_MAX
#define VTK_UNSIGNED_INT_MAX
Definition: vtkType.h:157
vtkFreeTypeTools::GetOutline
FT_Outline * GetOutline(FT_UInt32 c, FTC_Scaler scaler, FT_UInt &gindex, FT_OutlineGlyph &outline_glyph)
vtkFreeTypeToolsCleanup::~vtkFreeTypeToolsCleanup
~vtkFreeTypeToolsCleanup()
vtkFreeTypeTools::Library
FT_Library * Library
FreeType library instance.
Definition: vtkFreeTypeTools.h:405
vtkFreeTypeTools::StringToPath
bool StringToPath(vtkTextProperty *tprop, const vtkUnicodeString &str, int dpi, vtkPath *path)
vtkFreeTypeTools::GlyphOutline::Path
vtkSmartPointer< vtkPath > Path
Definition: vtkFreeTypeTools.h:86
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:35
vtkFreeTypeTools::GetFace
bool GetFace(vtkTextProperty *prop, size_t &prop_cache_id, FT_Face &face, bool &face_has_kerning)
Attempt to get the typeface of the specified font.
vtkFreeTypeTools::GetUnscaledKerning
std::array< int, 2 > GetUnscaledKerning(vtkTextProperty *tprop, vtkUnicodeStringValueType leftChar, vtkUnicodeStringValueType rightChar)
Return a 2D vector detailing the unscaled kerning offset for a pair of characters.
vtkFreeTypeTools::GetConstrainedFontSize
int GetConstrainedFontSize(const vtkUnicodeString &str, vtkTextProperty *tprop, int dpi, int targetWidth, int targetHeight)
vtkFreeTypeTools::GetInstance
static vtkFreeTypeTools * GetInstance()
Return the singleton instance with no reference counting.
vtkFreeTypeToolsCleanup::vtkFreeTypeToolsCleanup
vtkFreeTypeToolsCleanup()
vtkTextRenderer::Metrics
Definition: vtkTextRenderer.h:77
vtkFreeTypeTools::ReleaseCacheManager
void ReleaseCacheManager()
vtkFreeTypeTools::GetSize
bool GetSize(vtkTextProperty *tprop, FT_Size *size)
Given a text property, get the corresponding FreeType size object (a structure storing both a face an...
vtkFreeTypeTools::RenderString
bool RenderString(vtkTextProperty *tprop, const vtkStdString &str, int dpi, vtkImageData *data, int textDims[2]=nullptr)
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
vtkFreeTypeTools::CMapCache
FTC_CMapCache * CMapCache
Definition: vtkFreeTypeTools.h:413
vtkFreeTypeTools::GetImageCache
FTC_ImageCache * GetImageCache()
vtkFreeTypeTools::FaceMetrics::Scalable
bool Scalable
Definition: vtkFreeTypeTools.h:79
vtkFreeTypeTools
FreeType library support.
Definition: vtkFreeTypeTools.h:69