3#ifndef ENGINE_TEXTRENDER_H
4#define ENGINE_TEXTRENDER_H
226 virtual void UploadEntityLayerText(
const CImageInfo &TextImage,
int TexSubWidth,
int TexSubHeight,
const char *pText,
int Length,
float x,
float y,
int FontSize) = 0;
227 virtual int AdjustFontSize(
const char *pText,
int TextLength,
int MaxSize,
int MaxWidth)
const = 0;
229 virtual int CalculateTextWidth(
const char *pText,
int TextLength,
int FontWidth,
int FontSize)
const = 0;
232 virtual void TextColor(
float r,
float g,
float b,
float a) = 0;
238 virtual void Text(
float x,
float y,
float Size,
const char *pText,
float LineWidth = -1.0f) = 0;
239 virtual float TextWidth(
float Size,
const char *pText,
int StrLength = -1,
float LineWidth = -1.0f,
int Flags = 0,
const STextSizeProperties &TextSizeProps = {}) = 0;
Definition textrender.h:116
ETextCursorCursorMode m_CursorMode
Definition textrender.h:150
int m_GlyphCount
Definition textrender.h:120
float m_MaxCharacterHeight
Definition textrender.h:129
vec2 m_CursorRenderedPosition
Definition textrender.h:154
int m_CharCount
Definition textrender.h:121
STextBoundingBox BoundingBox() const
Definition text.cpp:931
float m_LineSpacing
Definition textrender.h:134
vec2 m_ReleaseMouse
Definition textrender.h:143
float Height() const
Definition text.cpp:926
float m_StartX
Definition textrender.h:124
int m_SelectionStart
Definition textrender.h:147
int m_MaxLines
Definition textrender.h:122
int m_Flags
Definition textrender.h:118
float m_LongestLineWidth
Definition textrender.h:130
float m_AlignedLineSpacing
Definition textrender.h:135
float m_LineWidth
Definition textrender.h:126
vec2 m_PressMouse
Definition textrender.h:141
bool m_Truncated
Definition textrender.h:159
int m_SelectionEnd
Definition textrender.h:148
std::vector< STextColorSplit > m_vColorSplits
Definition textrender.h:162
float m_FontSize
Definition textrender.h:132
int m_LineCount
Definition textrender.h:119
void SetPosition(vec2 Position)
Definition text.cpp:936
bool m_ForceCursorRendering
Definition textrender.h:151
float m_Y
Definition textrender.h:128
float m_AlignedFontSize
Definition textrender.h:133
ETextCursorSelectionMode m_CalculateSelectionMode
Definition textrender.h:137
float m_SelectionHeightFactor
Definition textrender.h:138
int m_CursorCharacter
Definition textrender.h:153
float m_X
Definition textrender.h:127
float m_StartY
Definition textrender.h:125
Definition textrender.h:251
void Shutdown() override=0
IInterface()
Definition kernel.h:19
Definition textrender.h:194
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:204
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:205
virtual void OnPreWindowResize()=0
virtual bool CreateOrAppendTextContainer(STextContainerIndex &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length=-1)=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:206
virtual void TextSelectionColor(ColorRGBA Color)=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
#define MACRO_INTERFACE(Name)
Definition kernel.h:25
Definition textrender.h:87
void MoveBy(vec2 Offset)
Definition textrender.h:96
vec2 Size() const
Definition textrender.h:95
float m_W
Definition textrender.h:90
float m_X
Definition textrender.h:88
float m_Y
Definition textrender.h:89
float Right() const
Definition textrender.h:93
float Bottom() const
Definition textrender.h:94
float m_H
Definition textrender.h:91
STextColorSplit(int CharIndex, int Length, const ColorRGBA &Color)
Definition textrender.h:111
ColorRGBA m_Color
Definition textrender.h:109
int m_CharIndex
Definition textrender.h:107
int m_Length
Definition textrender.h:108
Definition textrender.h:175
std::shared_ptr< STextContainerUsages > m_UseCount
Definition textrender.h:177
bool Valid() const
Definition textrender.h:181
STextContainerIndex()
Definition textrender.h:180
void Reset()
Definition textrender.h:182
int m_Index
Definition textrender.h:176
Definition textrender.h:170
int m_Dummy
Definition textrender.h:171
Definition textrender.h:186
float * m_pHeight
Definition textrender.h:187
int * m_pLineCount
Definition textrender.h:190
float * m_pMaxCharacterHeightInLine
Definition textrender.h:189
float * m_pAlignedFontSize
Definition textrender.h:188
ETextCursorSelectionMode
Definition textrender.h:67
@ TEXT_CURSOR_SELECTION_MODE_SET
Definition textrender.h:73
@ TEXT_CURSOR_SELECTION_MODE_CALCULATE
Definition textrender.h:71
@ TEXT_CURSOR_SELECTION_MODE_NONE
Definition textrender.h:69
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_NO_PIXEL_ALIGNMENT
Definition textrender.h:50
@ TEXT_RENDER_FLAG_ONE_TIME_USE
Definition textrender.h:57
@ 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:2343
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
@ DEFAULT_FONT
Definition textrender.h:62
@ ICON_FONT
Definition textrender.h:63
ETextCursorCursorMode
Definition textrender.h:77
@ TEXT_CURSOR_CURSOR_MODE_SET
Definition textrender.h:83
@ TEXT_CURSOR_CURSOR_MODE_NONE
Definition textrender.h:79
@ TEXT_CURSOR_CURSOR_MODE_CALCULATE
Definition textrender.h:81
vector2_base< float > vec2
Definition vmath.h:161