Overte C++ Documentation
TextRenderer3D.h
1 //
2 // TextRenderer3D.h
3 // interface/src/ui
4 //
5 // Created by Andrzej Kapolka on 4/26/13.
6 // Copyright 2013 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_TextRenderer3D_h
13 #define hifi_TextRenderer3D_h
14 
15 #include <memory>
16 #include <glm/glm.hpp>
17 
18 #include "text/Font.h"
19 #include "TextEffect.h"
20 #include "TextAlignment.h"
21 #include "FontFamilies.h"
22 
23 class TextRenderer3D {
24 public:
25  static TextRenderer3D* getInstance(const char* family);
26 
27  glm::vec2 computeExtent(const QString& str) const;
28  float getFontHeight() const;
29 
30  void draw(gpu::Batch& batch, const Font::DrawProps& props);
31  void draw(gpu::Batch& batch, const QString& font, const Font::DrawProps& props);
32 
33 private:
34  TextRenderer3D(const char* family);
35 
36  QString _family;
37 
38  std::shared_ptr<Font> _font;
39  Font::DrawInfo _drawInfo;
40 
41 };
42 
43 #endif // hifi_TextRenderer3D_h