MyGUI
3.2.1
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
mygui
MyGUIEngine
include
MyGUI_TextViewData.h
Go to the documentation of this file.
1
/*
2
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
3
* Distributed under the MIT License
4
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5
*/
6
7
#ifndef __MYGUI_TEXT_VIEW_DATA_H__
8
#define __MYGUI_TEXT_VIEW_DATA_H__
9
10
#include "
MyGUI_Prerequest.h
"
11
12
namespace
MyGUI
13
{
14
15
class
CharInfo
16
{
17
public
:
18
CharInfo
() :
19
mIsColour(false)
20
{
21
mMetrics
.mWidth = 0.0f;
22
mMetrics
.mHeight = 0.0f;
23
mMetrics
.mAdvance = 0.0f;
24
mMetrics
.mBearingX = 0.0f;
25
mMetrics
.mBearingY = 0.0f;
26
}
27
28
CharInfo
(
29
const
FloatRect
& _rect,
30
float
_width,
31
float
_height,
32
float
_advance,
33
float
_bearingX,
34
float
_bearingY) :
35
mIsColour(false),
36
mUVRect(_rect)
37
{
38
mMetrics
.mWidth = _width;
39
mMetrics
.mHeight = _height;
40
mMetrics
.mAdvance = _advance;
41
mMetrics
.mBearingX = _bearingX;
42
mMetrics
.mBearingY = _bearingY;
43
}
44
45
CharInfo
(
uint32
_colour) :
46
mIsColour(true),
47
mColour
(_colour)
48
{ }
49
50
bool
isColour
()
const
51
{
52
return
mIsColour;
53
}
54
55
float
getWidth
()
const
56
{
57
return
mMetrics
.mWidth;
58
}
59
60
float
getHeight
()
const
61
{
62
return
mMetrics
.mHeight;
63
}
64
65
float
getAdvance
()
const
66
{
67
return
mMetrics
.mAdvance;
68
}
69
70
float
getBearingX
()
const
71
{
72
return
mMetrics
.mBearingX;
73
}
74
75
float
getBearingY
()
const
76
{
77
return
mMetrics
.mBearingY;
78
}
79
80
const
FloatRect
&
getUVRect
()
const
81
{
82
return
mUVRect;
83
}
84
85
uint32
getColour
()
const
86
{
87
return
mColour
;
88
}
89
90
private
:
91
92
bool
mIsColour;
93
FloatRect
mUVRect;
94
95
struct
Metrics
96
{
97
float
mWidth;
98
float
mHeight;
99
float
mAdvance;
100
float
mBearingX;
101
float
mBearingY;
102
};
103
104
union
105
{
106
Metrics
mMetrics
;
107
uint32
mColour
;
108
};
109
110
};
111
112
typedef
std::vector<CharInfo>
VectorCharInfo
;
113
114
struct
LineInfo
115
{
116
LineInfo
() :
117
width
(0),
118
offset
(0),
119
count
(0)
120
{
121
}
122
123
void
clear
()
124
{
125
width
= 0;
126
count
= 0;
127
simbols
.clear();
128
offset
= 0;
129
}
130
131
int
width
;
132
int
offset
;
133
size_t
count
;
134
VectorCharInfo
simbols
;
135
};
136
137
typedef
std::vector<LineInfo>
VectorLineInfo
;
138
139
}
// namespace MyGUI
140
141
#endif // __MYGUI_TEXT_VIEW_DATA_H__
Generated on Wed Aug 20 2014 00:03:33 for MyGUI by
1.8.3.1