VTK
vtkMathTextFreeTypeTextRenderer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMathTextFreeTypeTextRenderer.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 =========================================================================*/
15 
30 #ifndef vtkMathTextFreeTypeTextRenderer_h
31 #define vtkMathTextFreeTypeTextRenderer_h
32 
33 #include "vtkRenderingFreeTypeModule.h" // For export macro
34 #include "vtkTextRenderer.h"
35 
36 class vtkFreeTypeTools;
38 
40  public vtkTextRenderer
41 {
42 public:
44  void PrintSelf(ostream &os, vtkIndent indent);
45 
46  static vtkMathTextFreeTypeTextRenderer *New();
47 
49 
50  virtual bool FreeTypeIsSupported();
51  virtual bool MathTextIsSupported();
53 
54 protected:
56  ~vtkMathTextFreeTypeTextRenderer();
57 
59 
60  bool GetBoundingBoxInternal(vtkTextProperty *tprop, const vtkStdString &str,
61  int bbox[4], int dpi, int backend);
62  bool GetBoundingBoxInternal(vtkTextProperty *tprop,
63  const vtkUnicodeString &str,
64  int bbox[4], int dpi, int backend);
65  bool GetMetricsInternal(vtkTextProperty *tprop, const vtkStdString &str,
66  Metrics &metrics, int dpi, int backend);
67  bool GetMetricsInternal(vtkTextProperty *tprop, const vtkUnicodeString &str,
68  Metrics &metrics, int dpi, int backend);
69  bool RenderStringInternal(vtkTextProperty *tprop, const vtkStdString &str,
70  vtkImageData *data, int textDims[2], int dpi,
71  int backend);
72  bool RenderStringInternal(vtkTextProperty *tprop, const vtkUnicodeString &str,
73  vtkImageData *data, int textDims[2], int dpi,
74  int backend);
75  int GetConstrainedFontSizeInternal(const vtkStdString &str,
76  vtkTextProperty *tprop,
77  int targetWidth, int targetHeight, int dpi,
78  int backend);
79  int GetConstrainedFontSizeInternal(const vtkUnicodeString &str,
80  vtkTextProperty *tprop,
81  int targetWidth, int targetHeight, int dpi,
82  int backend);
83  bool StringToPathInternal(vtkTextProperty *tprop, const vtkStdString &str,
84  vtkPath *path, int dpi, int backend);
85  bool StringToPathInternal(vtkTextProperty *tprop, const vtkUnicodeString &str,
86  vtkPath *path, int dpi, int backend);
87  void SetScaleToPowerOfTwoInternal(bool scale);
89 
90 private:
91  vtkMathTextFreeTypeTextRenderer(const vtkMathTextFreeTypeTextRenderer &); // Not implemented.
92  void operator=(const vtkMathTextFreeTypeTextRenderer &); // Not implemented.
93 
94  vtkFreeTypeTools *FreeTypeTools;
95  vtkMathTextUtilities *MathTextUtilities;
96 };
97 
98 #endif //vtkMathTextFreeTypeTextRenderer_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:34
#define VTKRENDERINGFREETYPE_EXPORT
Default implementation of vtkTextRenderer.
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
represent text properties.
Interface for generating images and path data from string data, using multiple backends.
Abstract interface to equation rendering.
FreeType library support.
String class that stores Unicode text.