TexturedFont.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
10 
11 namespace ewol {
12  namespace font {
16  enum mode {
17  Regular=0,
18  Italic,
19  Bold,
20  BoldItalic,
21  };
22  }
23  std::ostream& operator <<(std::ostream& _os, enum ewol::font::mode _obj);
24 
25  namespace resource {
27  private:
28  std::string m_fileName[4];
29  int32_t m_size;
30  int32_t m_height[4];
31  // specific element to have the the know if the specify element is known...
32  // == > otherwise I can just generate italic ...
33  // == > Bold is a little more complicated (maybe with the bordersize)
35  enum ewol::font::mode m_modeWraping[4];
36  public:
37  std::vector<GlyphProperty> m_listElement[4];
38  private:
39  // for the texture generation :
40  ivec2 m_lastGlyphPos[4];
41  int32_t m_lastRawHeigh[4];
42  protected:
43  TexturedFont();
44  void init(const std::string& _fontName);
45  public:
46  DECLARE_RESOURCE_NAMED_FACTORY(TexturedFont);
47  virtual ~TexturedFont();
48  public:
54  int32_t getHeight(const enum ewol::font::mode _displayMode = ewol::font::Regular) {
55  return m_height[_displayMode];
56  };
61  int32_t getFontSize() {
62  return m_size;
63  };
70  int32_t getIndex(char32_t _charcode, const enum ewol::font::mode _displayMode);
77  ewol::GlyphProperty* getGlyphPointer(const char32_t& _charcode, const enum ewol::font::mode _displayMode);
84  enum ewol::font::mode getWrappingMode(const enum ewol::font::mode _source) {
85  return m_modeWraping[_source];
86  };
87  private:
93  bool addGlyph(const char32_t& _val);
94  };
95  }
96 }
97 
int32_t getFontSize()
get the font height (user friendly)
Definition: TexturedFont.hpp:61
int32_t getHeight(const enum ewol::font::mode _displayMode=ewol::font::Regular)
get the display height of this font
Definition: TexturedFont.hpp:54
mode
Definition: TexturedFont.hpp:16
void init(int _argc, const char **_argv)
Definition: Area.hpp:16
Definition: GlyphProperty.hpp:48
Definition: TexturedFont.hpp:26
Definition: Texture.hpp:15