DDraceNetwork Docs
textrender.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef ENGINE_TEXTRENDER_H
4#define ENGINE_TEXTRENDER_H
5#include "kernel.h"
6
7#include <base/color.h>
8
9#include <engine/graphics.h>
10
11#include <cstdint>
12#include <memory>
13
14enum
15{
20};
21
23{
27 TEXTALIGN_TOP = 0, // this is also 0, so the default alignment is top-left
30
40
43};
44
46{
56 // text is only rendered once and then discarded (a hint for buffer creation)
58};
59
60enum class EFontPreset
61{
64};
65
66namespace FontIcons {
67// Each font icon is named according to its official name in Font Awesome
68MAYBE_UNUSED static const char *FONT_ICON_PLUS = "+";
69MAYBE_UNUSED static const char *FONT_ICON_MINUS = "-";
70MAYBE_UNUSED static const char *FONT_ICON_LOCK = "\xEF\x80\xA3";
71MAYBE_UNUSED static const char *FONT_ICON_MAGNIFYING_GLASS = "\xEF\x80\x82";
72MAYBE_UNUSED static const char *FONT_ICON_HEART = "\xEF\x80\x84";
73MAYBE_UNUSED static const char *FONT_ICON_STAR = "\xEF\x80\x85";
74MAYBE_UNUSED static const char *FONT_ICON_XMARK = "\xEF\x80\x8D";
75MAYBE_UNUSED static const char *FONT_ICON_CIRCLE = "\xEF\x84\x91";
76MAYBE_UNUSED static const char *FONT_ICON_ARROW_ROTATE_LEFT = "\xEF\x83\xA2";
77MAYBE_UNUSED static const char *FONT_ICON_ARROW_ROTATE_RIGHT = "\xEF\x80\x9E";
78MAYBE_UNUSED static const char *FONT_ICON_FLAG_CHECKERED = "\xEF\x84\x9E";
79MAYBE_UNUSED static const char *FONT_ICON_BAN = "\xEF\x81\x9E";
80MAYBE_UNUSED static const char *FONT_ICON_CIRCLE_CHEVRON_DOWN = "\xEF\x84\xBA";
81MAYBE_UNUSED static const char *FONT_ICON_SQUARE_MINUS = "\xEF\x85\x86";
82MAYBE_UNUSED static const char *FONT_ICON_SQUARE_PLUS = "\xEF\x83\xBE";
83MAYBE_UNUSED static const char *FONT_ICON_SORT_UP = "\xEF\x83\x9E";
84MAYBE_UNUSED static const char *FONT_ICON_SORT_DOWN = "\xEF\x83\x9D";
85
86MAYBE_UNUSED static const char *FONT_ICON_HOUSE = "\xEF\x80\x95";
87MAYBE_UNUSED static const char *FONT_ICON_NEWSPAPER = "\xEF\x87\xAA";
88MAYBE_UNUSED static const char *FONT_ICON_POWER_OFF = "\xEF\x80\x91";
89MAYBE_UNUSED static const char *FONT_ICON_GEAR = "\xEF\x80\x93";
90MAYBE_UNUSED static const char *FONT_ICON_PEN_TO_SQUARE = "\xEF\x81\x84";
91MAYBE_UNUSED static const char *FONT_ICON_CLAPPERBOARD = "\xEE\x84\xB1";
92MAYBE_UNUSED static const char *FONT_ICON_EARTH_AMERICAS = "\xEF\x95\xBD";
93MAYBE_UNUSED static const char *FONT_ICON_NETWORK_WIRED = "\xEF\x9B\xBF";
94MAYBE_UNUSED static const char *FONT_ICON_LIST_UL = "\xEF\x83\x8A";
95MAYBE_UNUSED static const char *FONT_ICON_INFO = "\xEF\x84\xA9";
96MAYBE_UNUSED static const char *FONT_ICON_TERMINAL = "\xEF\x84\xA0";
97
98MAYBE_UNUSED static const char *FONT_ICON_SLASH = "\xEF\x9C\x95";
99MAYBE_UNUSED static const char *FONT_ICON_PLAY = "\xEF\x81\x8B";
100MAYBE_UNUSED static const char *FONT_ICON_PAUSE = "\xEF\x81\x8C";
101MAYBE_UNUSED static const char *FONT_ICON_STOP = "\xEF\x81\x8D";
102MAYBE_UNUSED static const char *FONT_ICON_CHEVRON_LEFT = "\xEF\x81\x93";
103MAYBE_UNUSED static const char *FONT_ICON_CHEVRON_RIGHT = "\xEF\x81\x94";
104MAYBE_UNUSED static const char *FONT_ICON_CHEVRON_UP = "\xEF\x81\xB7";
105MAYBE_UNUSED static const char *FONT_ICON_CHEVRON_DOWN = "\xEF\x81\xB8";
106MAYBE_UNUSED static const char *FONT_ICON_BACKWARD = "\xEF\x81\x8A";
107MAYBE_UNUSED static const char *FONT_ICON_FORWARD = "\xEF\x81\x8E";
108MAYBE_UNUSED static const char *FONT_ICON_RIGHT_FROM_BRACKET = "\xEF\x8B\xB5";
109MAYBE_UNUSED static const char *FONT_ICON_RIGHT_TO_BRACKET = "\xEF\x8B\xB6";
110MAYBE_UNUSED static const char *FONT_ICON_ARROW_UP_RIGHT_FROM_SQUARE = "\xEF\x82\x8E";
111MAYBE_UNUSED static const char *FONT_ICON_BACKWARD_STEP = "\xEF\x81\x88";
112MAYBE_UNUSED static const char *FONT_ICON_FORWARD_STEP = "\xEF\x81\x91";
113MAYBE_UNUSED static const char *FONT_ICON_BACKWARD_FAST = "\xEF\x81\x89";
114MAYBE_UNUSED static const char *FONT_ICON_FORWARD_FAST = "\xEF\x81\x90";
115MAYBE_UNUSED static const char *FONT_ICON_KEYBOARD = "\xE2\x8C\xA8";
116MAYBE_UNUSED static const char *FONT_ICON_ELLIPSIS = "\xEF\x85\x81";
117
118MAYBE_UNUSED static const char *FONT_ICON_FOLDER = "\xEF\x81\xBB";
119MAYBE_UNUSED static const char *FONT_ICON_FOLDER_OPEN = "\xEF\x81\xBC";
120MAYBE_UNUSED static const char *FONT_ICON_FOLDER_TREE = "\xEF\xA0\x82";
121MAYBE_UNUSED static const char *FONT_ICON_FILM = "\xEF\x80\x88";
122MAYBE_UNUSED static const char *FONT_ICON_VIDEO = "\xEF\x80\xBD";
123MAYBE_UNUSED static const char *FONT_ICON_MAP = "\xEF\x89\xB9";
124MAYBE_UNUSED static const char *FONT_ICON_IMAGE = "\xEF\x80\xBE";
125MAYBE_UNUSED static const char *FONT_ICON_MUSIC = "\xEF\x80\x81";
126MAYBE_UNUSED static const char *FONT_ICON_FILE = "\xEF\x85\x9B";
127
128MAYBE_UNUSED static const char *FONT_ICON_PENCIL = "\xEF\x8C\x83";
129MAYBE_UNUSED static const char *FONT_ICON_TRASH = "\xEF\x87\xB8";
130
131MAYBE_UNUSED static const char *FONT_ICON_ARROWS_LEFT_RIGHT = "\xEF\x8C\xB7";
132MAYBE_UNUSED static const char *FONT_ICON_ARROWS_UP_DOWN = "\xEF\x81\xBD";
133MAYBE_UNUSED static const char *FONT_ICON_CIRCLE_PLAY = "\xEF\x85\x84";
134MAYBE_UNUSED static const char *FONT_ICON_BORDER_ALL = "\xEF\xA1\x8C";
135MAYBE_UNUSED static const char *FONT_ICON_EYE = "\xEF\x81\xAE";
136MAYBE_UNUSED static const char *FONT_ICON_EYE_SLASH = "\xEF\x81\xB0";
137MAYBE_UNUSED static const char *FONT_ICON_EYE_DROPPER = "\xEF\x87\xBB";
138
139MAYBE_UNUSED static const char *FONT_ICON_DICE_ONE = "\xEF\x94\xA5";
140MAYBE_UNUSED static const char *FONT_ICON_DICE_TWO = "\xEF\x94\xA8";
141MAYBE_UNUSED static const char *FONT_ICON_DICE_THREE = "\xEF\x94\xA7";
142MAYBE_UNUSED static const char *FONT_ICON_DICE_FOUR = "\xEF\x94\xA4";
143MAYBE_UNUSED static const char *FONT_ICON_DICE_FIVE = "\xEF\x94\xA3";
144MAYBE_UNUSED static const char *FONT_ICON_DICE_SIX = "\xEF\x94\xA6";
145
146MAYBE_UNUSED static const char *FONT_ICON_LAYER_GROUP = "\xEF\x97\xBD";
147MAYBE_UNUSED static const char *FONT_ICON_UNDO = "\xEF\x8B\xAA";
148MAYBE_UNUSED static const char *FONT_ICON_REDO = "\xEF\x8B\xB9";
149
150MAYBE_UNUSED static const char *FONT_ICON_ARROWS_ROTATE = "\xEF\x80\xA1";
151MAYBE_UNUSED static const char *FONT_ICON_QUESTION = "?";
152} // end namespace FontIcons
153
155{
156 // ignore any kind of selection
158 // calculates the selection based on the mouse press and release cursor position
160 // sets the selection based on the character start and end count(these values have to be decoded character offsets)
162};
163
165{
166 // ignore any kind of cursor
168 // calculates the cursor based on the mouse release cursor position
170 // sets the cursor based on the current character (this value has to be decoded character offset)
172};
173
175{
176 float m_X;
177 float m_Y;
178 float m_W;
179 float m_H;
180
181 float Right() const { return m_X + m_W; }
182 float Bottom() const { return m_Y + m_H; }
183 vec2 Size() const { return vec2(m_W, m_H); }
184 void MoveBy(vec2 Offset)
185 {
186 m_X += Offset.x;
187 m_Y += Offset.y;
188 }
189};
190
191// Allow to render multi colored text in one go without having to call TextEx() multiple times.
192// Needed to allow multi colored multi line texts
194{
195 int m_CharIndex; // Which index within the text should the split occur
196 int m_Length; // How long is the split
197 ColorRGBA m_Color; // The color the text should be starting from m_CharIndex
198
199 STextColorSplit(int CharIndex, int Length, const ColorRGBA &Color) :
200 m_CharIndex(CharIndex), m_Length(Length), m_Color(Color) {}
201};
202
204{
205public:
211
212 float m_StartX;
213 float m_StartY;
215 float m_X, m_Y;
218
223
226
227 // these coordinates are respected if selection mode is set to calculate @see ETextCursorSelectionMode
229 // these coordinates are respected if selection/cursor mode is set to calculate @see ETextCursorSelectionMode / @see ETextCursorCursorMode
231
232 // note m_SelectionStart can be bigger than m_SelectionEnd, depending on how the mouse cursor was dragged
233 // also note, that these are the character offsets decoded
236
239 // note this is the decoded character offset
242
243 // Color splits of the cursor to allow multicolored text
244 std::vector<STextColorSplit> m_vColorSplits;
245
246 float Height() const
247 {
249 }
250
252 {
254 }
255
256 void Reset()
257 {
258 m_Flags = 0;
259 m_LineCount = 0;
260 m_GlyphCount = 0;
261 m_CharCount = 0;
262 m_MaxLines = 0;
263 m_StartX = 0;
264 m_StartY = 0;
265 m_LineWidth = 0;
266 m_X = 0;
267 m_Y = 0;
270 m_FontSize = 0;
272 m_LineSpacing = 0;
275 m_PressMouse = vec2();
278 m_SelectionEnd = 0;
283 m_vColorSplits.clear();
284 }
285};
286
288{
289 int m_Dummy = 0;
290};
291
293{
295 std::shared_ptr<STextContainerUsages> m_UseCount =
296 std::make_shared<STextContainerUsages>(STextContainerUsages());
297
299 bool Valid() const { return m_Index >= 0; }
300 void Reset() { m_Index = -1; }
301};
302
304{
305 float *m_pHeight = nullptr;
306 float *m_pAlignedFontSize = nullptr;
308 int *m_pLineCount = nullptr;
309};
310
312{
313 MACRO_INTERFACE("textrender")
314public:
315 virtual void SetCursor(CTextCursor *pCursor, float x, float y, float FontSize, int Flags) const = 0;
316 virtual void MoveCursor(CTextCursor *pCursor, float x, float y) const = 0;
317 virtual void SetCursorPosition(CTextCursor *pCursor, float x, float y) const = 0;
318
319 virtual bool LoadFonts() = 0;
320 virtual void SetFontPreset(EFontPreset FontPreset) = 0;
321 virtual void SetFontLanguageVariant(const char *pLanguageFile) = 0;
322
323 virtual void SetRenderFlags(unsigned Flags) = 0;
324 virtual unsigned GetRenderFlags() const = 0;
325
326 ColorRGBA DefaultTextColor() const { return ColorRGBA(1, 1, 1, 1); }
327 ColorRGBA DefaultTextOutlineColor() const { return ColorRGBA(0, 0, 0, 0.3f); }
328 ColorRGBA DefaultTextSelectionColor() const { return ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f); }
329
330 //
331 virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
332 virtual bool CreateTextContainer(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
333 virtual void AppendTextContainer(STextContainerIndex TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
334 // either creates a new text container or appends to a existing one
335 virtual bool CreateOrAppendTextContainer(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
336 // just deletes and creates text container
337 virtual void RecreateTextContainer(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
338 virtual void RecreateTextContainerSoft(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
339 virtual void DeleteTextContainer(STextContainerIndex &TextContainerIndex) = 0;
340
341 virtual void UploadTextContainer(STextContainerIndex TextContainerIndex) = 0;
342
343 virtual void RenderTextContainer(STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor) = 0;
344 virtual void RenderTextContainer(STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor, float X, float Y) = 0;
345
347
348 virtual void UploadEntityLayerText(const CImageInfo &TextImage, int TexSubWidth, int TexSubHeight, const char *pText, int Length, float x, float y, int FontSize) = 0;
349 virtual int AdjustFontSize(const char *pText, int TextLength, int MaxSize, int MaxWidth) const = 0;
350 virtual float GetGlyphOffsetX(int FontSize, char TextCharacter) const = 0;
351 virtual int CalculateTextWidth(const char *pText, int TextLength, int FontWidth, int FontSize) const = 0;
352
353 // old foolish interface
354 virtual void TextColor(float r, float g, float b, float a) = 0;
355 virtual void TextColor(ColorRGBA Color) = 0;
356 virtual void TextOutlineColor(float r, float g, float b, float a) = 0;
357 virtual void TextOutlineColor(ColorRGBA Color) = 0;
358 virtual void TextSelectionColor(float r, float g, float b, float a) = 0;
359 virtual void TextSelectionColor(ColorRGBA Color) = 0;
360 virtual void Text(float x, float y, float Size, const char *pText, float LineWidth = -1.0f) = 0;
361 virtual float TextWidth(float Size, const char *pText, int StrLength = -1, float LineWidth = -1.0f, int Flags = 0, const STextSizeProperties &TextSizeProps = {}) = 0;
362 virtual STextBoundingBox TextBoundingBox(float Size, const char *pText, int StrLength = -1, float LineWidth = -1.0f, float LineSpacing = 0.0f, int Flags = 0) = 0;
363
364 virtual ColorRGBA GetTextColor() const = 0;
365 virtual ColorRGBA GetTextOutlineColor() const = 0;
366 virtual ColorRGBA GetTextSelectionColor() const = 0;
367
368 virtual void OnPreWindowResize() = 0;
369 virtual void OnWindowResize() = 0;
370};
371
373{
374 MACRO_INTERFACE("enginetextrender")
375public:
376 virtual void Init() = 0;
377 virtual void Shutdown() override = 0;
378};
379
381
382#endif
Definition: image.h:12
Definition: textrender.h:204
ETextCursorCursorMode m_CursorMode
Definition: textrender.h:237
int m_GlyphCount
Definition: textrender.h:208
float m_MaxCharacterHeight
Definition: textrender.h:216
vec2 m_CursorRenderedPosition
Definition: textrender.h:241
int m_CharCount
Definition: textrender.h:209
STextBoundingBox BoundingBox() const
Definition: textrender.h:251
float m_LineSpacing
Definition: textrender.h:221
vec2 m_ReleaseMouse
Definition: textrender.h:230
float Height() const
Definition: textrender.h:246
float m_StartX
Definition: textrender.h:212
int m_SelectionStart
Definition: textrender.h:234
int m_MaxLines
Definition: textrender.h:210
int m_Flags
Definition: textrender.h:206
float m_LongestLineWidth
Definition: textrender.h:217
float m_AlignedLineSpacing
Definition: textrender.h:222
float m_LineWidth
Definition: textrender.h:214
vec2 m_PressMouse
Definition: textrender.h:228
int m_SelectionEnd
Definition: textrender.h:235
std::vector< STextColorSplit > m_vColorSplits
Definition: textrender.h:244
float m_FontSize
Definition: textrender.h:219
void Reset()
Definition: textrender.h:256
int m_LineCount
Definition: textrender.h:207
bool m_ForceCursorRendering
Definition: textrender.h:238
float m_Y
Definition: textrender.h:215
float m_AlignedFontSize
Definition: textrender.h:220
ETextCursorSelectionMode m_CalculateSelectionMode
Definition: textrender.h:224
float m_SelectionHeightFactor
Definition: textrender.h:225
int m_CursorCharacter
Definition: textrender.h:240
float m_X
Definition: textrender.h:215
float m_StartY
Definition: textrender.h:213
Definition: color.h:210
Definition: textrender.h:373
virtual void Init()=0
virtual void Shutdown() override=0
Definition: kernel.h:10
Definition: textrender.h:312
virtual void UploadEntityLayerText(const CImageInfo &TextImage, int TexSubWidth, int TexSubHeight, const char *pText, int Length, float x, float y, int FontSize)=0
ColorRGBA DefaultTextColor() const
Definition: textrender.h:326
virtual ColorRGBA GetTextSelectionColor() const =0
virtual void RecreateTextContainer(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
virtual ColorRGBA GetTextColor() const =0
virtual void RenderTextContainer(STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor)=0
virtual int CalculateTextWidth(const char *pText, int TextLength, int FontWidth, int FontSize) const =0
virtual void SetRenderFlags(unsigned Flags)=0
virtual unsigned GetRenderFlags() const =0
virtual bool CreateTextContainer(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
virtual float TextWidth(float Size, const char *pText, int StrLength=-1, float LineWidth=-1.0f, int Flags=0, const STextSizeProperties &TextSizeProps={})=0
virtual void TextColor(ColorRGBA Color)=0
virtual void RecreateTextContainerSoft(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
virtual int AdjustFontSize(const char *pText, int TextLength, int MaxSize, int MaxWidth) const =0
virtual STextBoundingBox GetBoundingBoxTextContainer(STextContainerIndex TextContainerIndex)=0
ColorRGBA DefaultTextOutlineColor() const
Definition: textrender.h:327
virtual void OnPreWindowResize()=0
virtual bool CreateOrAppendTextContainer(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
virtual void SetCursor(CTextCursor *pCursor, float x, float y, float FontSize, int Flags) const =0
virtual void TextOutlineColor(ColorRGBA Color)=0
virtual ColorRGBA GetTextOutlineColor() const =0
virtual void SetFontPreset(EFontPreset FontPreset)=0
virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length=-1)=0
virtual void UploadTextContainer(STextContainerIndex TextContainerIndex)=0
virtual STextBoundingBox TextBoundingBox(float Size, const char *pText, int StrLength=-1, float LineWidth=-1.0f, float LineSpacing=0.0f, int Flags=0)=0
virtual void DeleteTextContainer(STextContainerIndex &TextContainerIndex)=0
virtual void Text(float x, float y, float Size, const char *pText, float LineWidth=-1.0f)=0
virtual bool LoadFonts()=0
virtual void SetFontLanguageVariant(const char *pLanguageFile)=0
virtual void AppendTextContainer(STextContainerIndex TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=0
virtual void RenderTextContainer(STextContainerIndex TextContainerIndex, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor, float X, float Y)=0
virtual void OnWindowResize()=0
ColorRGBA DefaultTextSelectionColor() const
Definition: textrender.h:328
virtual void TextSelectionColor(ColorRGBA Color)=0
virtual void SetCursorPosition(CTextCursor *pCursor, float x, float y) const =0
virtual void TextSelectionColor(float r, float g, float b, float a)=0
virtual void TextOutlineColor(float r, float g, float b, float a)=0
virtual float GetGlyphOffsetX(int FontSize, char TextCharacter) const =0
virtual void TextColor(float r, float g, float b, float a)=0
virtual void MoveCursor(CTextCursor *pCursor, float x, float y) const =0
T x
Definition: vmath.h:19
T y
Definition: vmath.h:23
#define MACRO_INTERFACE(Name)
Definition: kernel.h:25
Definition: textrender.h:66
static MAYBE_UNUSED const char * FONT_ICON_CIRCLE_PLAY
Definition: textrender.h:133
static MAYBE_UNUSED const char * FONT_ICON_SQUARE_PLUS
Definition: textrender.h:82
static MAYBE_UNUSED const char * FONT_ICON_QUESTION
Definition: textrender.h:151
static MAYBE_UNUSED const char * FONT_ICON_PLAY
Definition: textrender.h:99
static MAYBE_UNUSED const char * FONT_ICON_MINUS
Definition: textrender.h:69
static MAYBE_UNUSED const char * FONT_ICON_LAYER_GROUP
Definition: textrender.h:146
static MAYBE_UNUSED const char * FONT_ICON_STOP
Definition: textrender.h:101
static MAYBE_UNUSED const char * FONT_ICON_CHEVRON_RIGHT
Definition: textrender.h:103
static MAYBE_UNUSED const char * FONT_ICON_FOLDER_OPEN
Definition: textrender.h:119
static MAYBE_UNUSED const char * FONT_ICON_BAN
Definition: textrender.h:79
static MAYBE_UNUSED const char * FONT_ICON_FORWARD_FAST
Definition: textrender.h:114
static MAYBE_UNUSED const char * FONT_ICON_FLAG_CHECKERED
Definition: textrender.h:78
static MAYBE_UNUSED const char * FONT_ICON_SLASH
Definition: textrender.h:98
static MAYBE_UNUSED const char * FONT_ICON_EYE_DROPPER
Definition: textrender.h:137
static MAYBE_UNUSED const char * FONT_ICON_MUSIC
Definition: textrender.h:125
static MAYBE_UNUSED const char * FONT_ICON_ARROW_ROTATE_LEFT
Definition: textrender.h:76
static MAYBE_UNUSED const char * FONT_ICON_PLUS
Definition: textrender.h:68
static MAYBE_UNUSED const char * FONT_ICON_KEYBOARD
Definition: textrender.h:115
static MAYBE_UNUSED const char * FONT_ICON_POWER_OFF
Definition: textrender.h:88
static MAYBE_UNUSED const char * FONT_ICON_VIDEO
Definition: textrender.h:122
static MAYBE_UNUSED const char * FONT_ICON_RIGHT_TO_BRACKET
Definition: textrender.h:109
static MAYBE_UNUSED const char * FONT_ICON_CHEVRON_UP
Definition: textrender.h:104
static MAYBE_UNUSED const char * FONT_ICON_EYE_SLASH
Definition: textrender.h:136
static MAYBE_UNUSED const char * FONT_ICON_BACKWARD_FAST
Definition: textrender.h:113
static MAYBE_UNUSED const char * FONT_ICON_EARTH_AMERICAS
Definition: textrender.h:92
static MAYBE_UNUSED const char * FONT_ICON_EYE
Definition: textrender.h:135
static MAYBE_UNUSED const char * FONT_ICON_FILM
Definition: textrender.h:121
static MAYBE_UNUSED const char * FONT_ICON_NETWORK_WIRED
Definition: textrender.h:93
static MAYBE_UNUSED const char * FONT_ICON_FORWARD_STEP
Definition: textrender.h:112
static MAYBE_UNUSED const char * FONT_ICON_NEWSPAPER
Definition: textrender.h:87
static MAYBE_UNUSED const char * FONT_ICON_BACKWARD_STEP
Definition: textrender.h:111
static MAYBE_UNUSED const char * FONT_ICON_MAGNIFYING_GLASS
Definition: textrender.h:71
static MAYBE_UNUSED const char * FONT_ICON_GEAR
Definition: textrender.h:89
static MAYBE_UNUSED const char * FONT_ICON_CLAPPERBOARD
Definition: textrender.h:91
static MAYBE_UNUSED const char * FONT_ICON_RIGHT_FROM_BRACKET
Definition: textrender.h:108
static MAYBE_UNUSED const char * FONT_ICON_DICE_THREE
Definition: textrender.h:141
static MAYBE_UNUSED const char * FONT_ICON_FOLDER_TREE
Definition: textrender.h:120
static MAYBE_UNUSED const char * FONT_ICON_DICE_FIVE
Definition: textrender.h:143
static MAYBE_UNUSED const char * FONT_ICON_CIRCLE
Definition: textrender.h:75
static MAYBE_UNUSED const char * FONT_ICON_CIRCLE_CHEVRON_DOWN
Definition: textrender.h:80
static MAYBE_UNUSED const char * FONT_ICON_CHEVRON_LEFT
Definition: textrender.h:102
static MAYBE_UNUSED const char * FONT_ICON_FORWARD
Definition: textrender.h:107
static MAYBE_UNUSED const char * FONT_ICON_UNDO
Definition: textrender.h:147
static MAYBE_UNUSED const char * FONT_ICON_DICE_ONE
Definition: textrender.h:139
static MAYBE_UNUSED const char * FONT_ICON_XMARK
Definition: textrender.h:74
static MAYBE_UNUSED const char * FONT_ICON_DICE_SIX
Definition: textrender.h:144
static MAYBE_UNUSED const char * FONT_ICON_BORDER_ALL
Definition: textrender.h:134
static MAYBE_UNUSED const char * FONT_ICON_DICE_FOUR
Definition: textrender.h:142
static MAYBE_UNUSED const char * FONT_ICON_SQUARE_MINUS
Definition: textrender.h:81
static MAYBE_UNUSED const char * FONT_ICON_ARROWS_UP_DOWN
Definition: textrender.h:132
static MAYBE_UNUSED const char * FONT_ICON_ELLIPSIS
Definition: textrender.h:116
static MAYBE_UNUSED const char * FONT_ICON_MAP
Definition: textrender.h:123
static MAYBE_UNUSED const char * FONT_ICON_PAUSE
Definition: textrender.h:100
static MAYBE_UNUSED const char * FONT_ICON_TERMINAL
Definition: textrender.h:96
static MAYBE_UNUSED const char * FONT_ICON_SORT_UP
Definition: textrender.h:83
static MAYBE_UNUSED const char * FONT_ICON_FOLDER
Definition: textrender.h:118
static MAYBE_UNUSED const char * FONT_ICON_PEN_TO_SQUARE
Definition: textrender.h:90
static MAYBE_UNUSED const char * FONT_ICON_IMAGE
Definition: textrender.h:124
static MAYBE_UNUSED const char * FONT_ICON_SORT_DOWN
Definition: textrender.h:84
static MAYBE_UNUSED const char * FONT_ICON_DICE_TWO
Definition: textrender.h:140
static MAYBE_UNUSED const char * FONT_ICON_BACKWARD
Definition: textrender.h:106
static MAYBE_UNUSED const char * FONT_ICON_ARROWS_LEFT_RIGHT
Definition: textrender.h:131
static MAYBE_UNUSED const char * FONT_ICON_CHEVRON_DOWN
Definition: textrender.h:105
static MAYBE_UNUSED const char * FONT_ICON_HOUSE
Definition: textrender.h:86
static MAYBE_UNUSED const char * FONT_ICON_PENCIL
Definition: textrender.h:128
static MAYBE_UNUSED const char * FONT_ICON_TRASH
Definition: textrender.h:129
static MAYBE_UNUSED const char * FONT_ICON_ARROW_ROTATE_RIGHT
Definition: textrender.h:77
static MAYBE_UNUSED const char * FONT_ICON_HEART
Definition: textrender.h:72
static MAYBE_UNUSED const char * FONT_ICON_LOCK
Definition: textrender.h:70
static MAYBE_UNUSED const char * FONT_ICON_LIST_UL
Definition: textrender.h:94
static MAYBE_UNUSED const char * FONT_ICON_ARROW_UP_RIGHT_FROM_SQUARE
Definition: textrender.h:110
static MAYBE_UNUSED const char * FONT_ICON_REDO
Definition: textrender.h:148
static MAYBE_UNUSED const char * FONT_ICON_ARROWS_ROTATE
Definition: textrender.h:150
static MAYBE_UNUSED const char * FONT_ICON_STAR
Definition: textrender.h:73
static MAYBE_UNUSED const char * FONT_ICON_FILE
Definition: textrender.h:126
static MAYBE_UNUSED const char * FONT_ICON_INFO
Definition: textrender.h:95
Definition: textrender.h:175
void MoveBy(vec2 Offset)
Definition: textrender.h:184
vec2 Size() const
Definition: textrender.h:183
float m_W
Definition: textrender.h:178
float m_X
Definition: textrender.h:176
float m_Y
Definition: textrender.h:177
float Right() const
Definition: textrender.h:181
float Bottom() const
Definition: textrender.h:182
float m_H
Definition: textrender.h:179
Definition: textrender.h:194
STextColorSplit(int CharIndex, int Length, const ColorRGBA &Color)
Definition: textrender.h:199
ColorRGBA m_Color
Definition: textrender.h:197
int m_CharIndex
Definition: textrender.h:195
int m_Length
Definition: textrender.h:196
Definition: textrender.h:293
std::shared_ptr< STextContainerUsages > m_UseCount
Definition: textrender.h:295
bool Valid() const
Definition: textrender.h:299
STextContainerIndex()
Definition: textrender.h:298
void Reset()
Definition: textrender.h:300
int m_Index
Definition: textrender.h:294
Definition: textrender.h:288
int m_Dummy
Definition: textrender.h:289
Definition: textrender.h:304
float * m_pHeight
Definition: textrender.h:305
int * m_pLineCount
Definition: textrender.h:308
float * m_pMaxCharacterHeightInLine
Definition: textrender.h:307
float * m_pAlignedFontSize
Definition: textrender.h:306
#define MAYBE_UNUSED
Definition: system.h:55
ETextCursorSelectionMode
Definition: textrender.h:155
@ TEXT_CURSOR_SELECTION_MODE_SET
Definition: textrender.h:161
@ TEXT_CURSOR_SELECTION_MODE_CALCULATE
Definition: textrender.h:159
@ TEXT_CURSOR_SELECTION_MODE_NONE
Definition: textrender.h:157
ETextRenderFlags
Definition: textrender.h:46
@ TEXT_RENDER_FLAG_KERNING
Definition: textrender.h:51
@ TEXT_RENDER_FLAG_NO_AUTOMATIC_QUAD_UPLOAD
Definition: textrender.h:55
@ TEXT_RENDER_FLAG_NO_FIRST_CHARACTER_X_BEARING
Definition: textrender.h:53
@ TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH
Definition: textrender.h:49
@ TEXT_RENDER_FLAG_NO_X_BEARING
Definition: textrender.h:47
@ TEXT_RENDER_FLAG_NO_OVERSIZE
Definition: textrender.h:52
@ TEXT_RENDER_FLAG_NO_LAST_CHARACTER_ADVANCE
Definition: textrender.h:54
@ TEXT_RENDER_FLAG_ONE_TIME_USE
Definition: textrender.h:57
@ TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT
Definition: textrender.h:50
@ TEXT_RENDER_FLAG_NO_Y_BEARING
Definition: textrender.h:48
@ TEXTFLAG_STOP_AT_END
Definition: textrender.h:18
@ TEXTFLAG_ELLIPSIS_AT_END
Definition: textrender.h:19
@ TEXTFLAG_DISALLOW_NEWLINE
Definition: textrender.h:17
@ TEXTFLAG_RENDER
Definition: textrender.h:16
IEngineTextRender * CreateEngineTextRender()
Definition: text.cpp:2359
ETextAlignment
Definition: textrender.h:23
@ TEXTALIGN_MASK_VERTICAL
Definition: textrender.h:42
@ TEXTALIGN_RIGHT
Definition: textrender.h:26
@ TEXTALIGN_MASK_HORIZONTAL
Definition: textrender.h:41
@ TEXTALIGN_MC
Definition: textrender.h:35
@ TEXTALIGN_ML
Definition: textrender.h:34
@ TEXTALIGN_BC
Definition: textrender.h:38
@ TEXTALIGN_TL
Definition: textrender.h:31
@ TEXTALIGN_BR
Definition: textrender.h:39
@ TEXTALIGN_MR
Definition: textrender.h:36
@ TEXTALIGN_TR
Definition: textrender.h:33
@ TEXTALIGN_TC
Definition: textrender.h:32
@ TEXTALIGN_LEFT
Definition: textrender.h:24
@ TEXTALIGN_TOP
Definition: textrender.h:27
@ TEXTALIGN_BL
Definition: textrender.h:37
@ TEXTALIGN_BOTTOM
Definition: textrender.h:29
@ TEXTALIGN_CENTER
Definition: textrender.h:25
@ TEXTALIGN_MIDDLE
Definition: textrender.h:28
EFontPreset
Definition: textrender.h:61
ETextCursorCursorMode
Definition: textrender.h:165
@ TEXT_CURSOR_CURSOR_MODE_SET
Definition: textrender.h:171
@ TEXT_CURSOR_CURSOR_MODE_NONE
Definition: textrender.h:167
@ TEXT_CURSOR_CURSOR_MODE_CALCULATE
Definition: textrender.h:169
vector2_base< float > vec2
Definition: vmath.h:158