TextDF.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/Color.hpp>
9 
10 #include <ewol/debug.hpp>
15 #include <exml/exml.hpp>
16 #include <string>
17 
18 namespace ewol {
19  namespace compositing {
21  protected:
23  std::vector<float> m_glyphLevel;
24  protected:
25  int32_t m_GLglyphLevel;
26  public:
32  TextDF(const std::string& _fontName="", int32_t _fontSize=-1);
36  virtual ~TextDF();
37  public:
43  void updateSizeToRender(const vec2& _size);
44  public:
45  virtual void clear();
46  virtual void drawD(bool _disableDepthTest);
47  virtual void drawMT(const mat4& _transformationMatrix, bool _enableDepthTest);
48  protected:
49  float m_size;
50  public:
51  virtual float getHeight();
52  virtual float getSize() {
53  return m_size;
54  }
55  virtual void setSize(float _size) {
56  m_size = _size;
57  }
58  virtual ewol::GlyphProperty * getGlyphPointer(char32_t _charcode);
59 
60  public:
61  virtual void loadProgram(const std::string& _shaderName);
62  virtual void setFontSize(int32_t _fontSize);
63  virtual void setFontName(const std::string& _fontName);
64  virtual void setFont(std::string _fontName, int32_t _fontSize);
65  virtual void setFontMode(enum ewol::font::mode _mode);
66  virtual void printChar(const char32_t& _charcode);
67  virtual vec3 calculateSizeChar(const char32_t& _charcode);
68  };
69  }
70 }
71 
72 
virtual void setFont(std::string _fontName, int32_t _fontSize)
Specify the font property (this reset the internal element of the current text (system requirement) ...
Definition: TextBase.hpp:43
virtual ~TextDF()
generic destructor
Definition: TextDF.hpp:20
void updateSizeToRender(const vec2 &_size)
Calculate size to be at the best size for a render in this special size.
virtual void clear()
clear all the registered element in the current element
std::vector< float > m_glyphLevel
Level of display of the glyph (notmal : 0.50, bold : 0.40, super bold : 0.30 ...) ...
Definition: TextDF.hpp:23
virtual void loadProgram(const std::string &_shaderName)
load the openGL program and get all the ID needed
mode
Definition: TexturedFont.hpp:16
virtual void setFontName(const std::string &_fontName)
Specify the font name (this reset the internal element of the current text (system requirement) ...
Definition: Area.hpp:16
TextDF(const std::string &_fontName="", int32_t _fontSize=-1)
generic constructor
virtual vec3 calculateSizeChar(const char32_t &_charcode)
Definition: GlyphProperty.hpp:48
virtual void drawD(bool _disableDepthTest)
draw All the refistered text in the current element on openGL
virtual void setFontSize(int32_t _fontSize)
Specify the font size (this reset the internal element of the current text (system requirement) ...
ememory::SharedPtr< ewol::resource::DistanceFieldFont > m_fontDF
Font resources.
Definition: TextDF.hpp:22
int32_t m_GLglyphLevel
openGL Id on the glyph level display
Definition: TextDF.hpp:25
virtual void printChar(const char32_t &_charcode)
display the current char in the current element (note that the kerning is availlable if the position ...
virtual void setFontMode(enum ewol::font::mode _mode)
Specify the font mode for the next print.
virtual void drawMT(const mat4 &_transformationMatrix, bool _enableDepthTest)