GlyphProperty.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
9 
10 namespace ewol {
11  /*
12  | | | |
13  | | | |
14  | | | |
15  Y | | | |
16  ^ |------------| |------------|
17  |
18  m_advance.y:/-> |
19  | |
20  | |
21  m_sizeTex.x/-> | | |------------| |------------|
22  | | | | | | |
23  | | | | | | |
24  | | | | | | |
25  | | | | | | |
26  | | | | A | | G |
27  | | | | | | |
28  | | | | | | |
29  | | | | | | |
30  | | | | | | |
31  \-> | | |------------| |------------|
32  /--> | |
33  \--> \-> |
34  m_bearing.y |
35  |____*________________________*____________>> X
36 
37 
38  <------------------------> : m_advance.x
39 
40  <------------> : m_sizeTexture.x
41 
42  <---> : m_bearing.x
43 
44  */
48  class GlyphProperty {
49  public:
50  char32_t m_UVal;
51  public:
52  bool m_exist;
53  public:
54  int32_t m_glyphIndex;
60  private:
61  std::vector<ewol::Kerning> m_kerning;
62  public:
63  GlyphProperty() :
64  m_UVal(0),
65  m_exist(true),
66  m_glyphIndex(0),
67  m_sizeTexture(0,0),
68  m_bearing(0,0),
69  m_advance(0,0),
70  m_texturePosStart(0,0),
71  m_texturePosSize(0,0) {
72 
73  };
74  float kerningGet(const char32_t _charcode) {
75  for(size_t iii=0; iii<m_kerning.size(); iii++ ) {
76  if (m_kerning[iii].m_UVal == _charcode) {
77  return m_kerning[iii].m_value;
78  }
79  }
80  return 0;
81  };
82  void kerningAdd(const char32_t _charcode, float _value) {
83  m_kerning.push_back(ewol::Kerning(_charcode, _value));
84  };
85  void kerningClear() {
86  m_kerning.clear();
87  };
92  bool exist() const {
93  return m_exist;
94  };
98  void setNotExist() {
99  m_exist = false;
100  };
101  };
102 };
103 
ivec2 m_bearing
offset to display the data (can be negatif id the texture sise is bigger than the theoric places in t...
Definition: GlyphProperty.hpp:56
int32_t m_glyphIndex
Glyph index in the system.
Definition: GlyphProperty.hpp:54
vec2 m_texturePosStart
Texture normalized position (START)
Definition: GlyphProperty.hpp:58
Kerning properties of one specific Glyph with an other.
Definition: Kerning.hpp:40
Definition: Area.hpp:16
Definition: GlyphProperty.hpp:48
void setNotExist()
set the element doen not exist !!!
Definition: GlyphProperty.hpp:98
char32_t m_UVal
Unicode value.
Definition: GlyphProperty.hpp:50
ivec2 m_sizeTexture
size of the element to display
Definition: GlyphProperty.hpp:55
bool exist() const
get the status of the char, if it exist or not in the FONT
Definition: GlyphProperty.hpp:92
ivec2 m_advance
space use in the display for this specific char
Definition: GlyphProperty.hpp:57
vec2 m_texturePosSize
Texture normalized position (SIZE)
Definition: GlyphProperty.hpp:59