VTK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
39 class VTKRENDERINGFREETYPE_EXPORT vtkMathTextFreeTypeTextRenderer :
40  public vtkTextRenderer
41 {
42 public:
43  vtkTypeMacro(vtkMathTextFreeTypeTextRenderer, vtkTextRenderer)
44  void PrintSelf(ostream &os, vtkIndent indent);
45 
46  static vtkMathTextFreeTypeTextRenderer *New();
47 
48 protected:
50  ~vtkMathTextFreeTypeTextRenderer();
51 
53 
54  bool GetBoundingBoxInternal(vtkTextProperty *tprop, const vtkStdString &str,
55  int bbox[4], int dpi, int backend);
56  bool GetBoundingBoxInternal(vtkTextProperty *tprop,
57  const vtkUnicodeString &str,
58  int bbox[4], int dpi, int backend);
59  bool RenderStringInternal(vtkTextProperty *tprop, const vtkStdString &str,
60  vtkImageData *data, int textDims[2], int dpi,
61  int backend);
62  bool RenderStringInternal(vtkTextProperty *tprop, const vtkUnicodeString &str,
63  vtkImageData *data, int textDims[2], int dpi,
64  int backend);
65  int GetConstrainedFontSizeInternal(const vtkStdString &str,
66  vtkTextProperty *tprop,
67  int targetWidth, int targetHeight, int dpi,
68  int backend);
69  int GetConstrainedFontSizeInternal(const vtkUnicodeString &str,
70  vtkTextProperty *tprop,
71  int targetWidth, int targetHeight, int dpi,
72  int backend);
73  bool StringToPathInternal(vtkTextProperty *tprop, const vtkStdString &str,
74  vtkPath *path, int backend);
75  bool StringToPathInternal(vtkTextProperty *tprop, const vtkUnicodeString &str,
76  vtkPath *path, int backend);
77  void SetScaleToPowerOfTwoInternal(bool scale);
79 
80 private:
81  vtkMathTextFreeTypeTextRenderer(const vtkMathTextFreeTypeTextRenderer &); // Not implemented.
82  void operator=(const vtkMathTextFreeTypeTextRenderer &); // Not implemented.
83 
84  vtkFreeTypeTools *FreeTypeTools;
85  vtkMathTextUtilities *MathTextUtilities;
86 };
87 
88 #endif //__vtkMathTextFreeTypeTextRenderer_h
Default implementation of vtkTextRenderer.
Abstract interface to equation rendering.
FreeType library support.