![]() |
Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
|
#include <GUITextLayout.h>
Public Member Functions | |
CGUITextLayout (CGUIFont *font, bool wrap, float fHeight=0.0f, CGUIFont *borderFont=NULL) | |
bool | UpdateScrollinfo (CScrollInfo &scrollInfo) |
void | Render (float x, float y, float angle, UTILS::Color color, UTILS::Color shadowColor, uint32_t alignment, float maxWidth, bool solid=false) |
void | RenderScrolling (float x, float y, float angle, UTILS::Color color, UTILS::Color shadowColor, uint32_t alignment, float maxWidth, const CScrollInfo &scrollInfo) |
void | RenderOutline (float x, float y, UTILS::Color color, UTILS::Color outlineColor, uint32_t alignment, float maxWidth) |
void | GetTextExtent (float &width, float &height) const |
Returns the precalculated width and height of the text to be rendered (in constant time). More... | |
float | GetTextWidth () const |
Returns the precalculated width of the text to be rendered (in constant time). More... | |
float | GetTextWidth (const std::wstring &text) const |
float | GetTextHeight () const |
Returns the precalculated height of the text to be rendered (in constant time). More... | |
bool | Update (const std::string &text, float maxWidth=0, bool forceUpdate=false, bool forceLTRReadingOrder=false) |
bool | UpdateW (const std::wstring &text, float maxWidth=0, bool forceUpdate=false, bool forceLTRReadingOrder=false) |
void | UpdateStyled (const vecText &text, const std::vector< UTILS::Color > &colors, float maxWidth=0, bool forceLTRReadingOrder=false) |
Update text from a pre-styled vecText/std::vector<UTILS::Color> combination Allows styled text to be passed directly to the text layout. More... | |
unsigned int | GetTextLength () const |
void | GetFirstText (vecText &text) const |
void | Reset () |
void | SetWrap (bool bWrap=true) |
void | SetMaxHeight (float fHeight) |
Static Public Member Functions | |
static void | DrawText (CGUIFont *font, float x, float y, UTILS::Color color, UTILS::Color shadowColor, const std::string &text, uint32_t align) |
static void | Filter (std::string &text) |
Protected Types | |
typedef std::vector< CGUIString >::iterator | iLine |
Protected Member Functions | |
void | LineBreakText (const vecText &text, std::vector< CGUIString > &lines) |
void | WrapText (const vecText &text, float maxWidth) |
void | CalcTextExtent () |
void | UpdateCommon (const std::wstring &text, float maxWidth, bool forceLTRReadingOrder) |
std::string | GetText () const |
Returns the text, utf8 encoded. More... | |
void | SetMonoFont (CGUIFont *font) |
Set the monospaced font to use. More... | |
void | UseMonoFont (bool use) |
Set whether or not to use the monospace font. More... | |
Static Protected Member Functions | |
static void | BidiTransform (std::vector< CGUIString > &lines, bool forceLTRReadingOrder) |
static std::wstring | BidiFlip (const std::wstring &text, bool forceLTRReadingOrder) |
Protected Attributes | |
std::vector< UTILS::Color > | m_colors |
std::vector< CGUIString > | m_lines |
CGUIFont * | m_font |
CGUIFont * | m_borderFont |
CGUIFont * | m_monoFont = nullptr |
Mono-space font to use. More... | |
CGUIFont * | m_varFont |
Varible-space font to use. More... | |
bool | m_wrap |
float | m_maxHeight |
UTILS::Color | m_textColor |
std::string | m_lastUtf8Text |
std::wstring | m_lastText |
bool | m_lastUpdateW |
true if the last string we updated was the wstring version More... | |
float | m_textWidth |
float | m_textHeight |
|
protected |
CGUITextLayout::CGUITextLayout | ( | CGUIFont * | font, |
bool | wrap, | ||
float | fHeight = 0.0f , |
||
CGUIFont * | borderFont = NULL |
||
) |
|
staticprotected |
|
staticprotected |
|
protected |
|
static |
|
static |
|
protected |
Returns the text, utf8 encoded.
void CGUITextLayout::GetTextExtent | ( | float & | width, |
float & | height | ||
) | const |
Returns the precalculated width and height of the text to be rendered (in constant time).
width | [out] width of text |
height | [out] height of text |
|
inline |
Returns the precalculated height of the text to be rendered (in constant time).
unsigned int CGUITextLayout::GetTextLength | ( | ) | const |
|
inline |
Returns the precalculated width of the text to be rendered (in constant time).
float CGUITextLayout::GetTextWidth | ( | const std::wstring & | text | ) | const |
|
protected |
void CGUITextLayout::Render | ( | float | x, |
float | y, | ||
float | angle, | ||
UTILS::Color | color, | ||
UTILS::Color | shadowColor, | ||
uint32_t | alignment, | ||
float | maxWidth, | ||
bool | solid = false |
||
) |
void CGUITextLayout::RenderOutline | ( | float | x, |
float | y, | ||
UTILS::Color | color, | ||
UTILS::Color | outlineColor, | ||
uint32_t | alignment, | ||
float | maxWidth | ||
) |
void CGUITextLayout::RenderScrolling | ( | float | x, |
float | y, | ||
float | angle, | ||
UTILS::Color | color, | ||
UTILS::Color | shadowColor, | ||
uint32_t | alignment, | ||
float | maxWidth, | ||
const CScrollInfo & | scrollInfo | ||
) |
void CGUITextLayout::SetMaxHeight | ( | float | fHeight | ) |
void CGUITextLayout::SetWrap | ( | bool | bWrap = true | ) |
bool CGUITextLayout::Update | ( | const std::string & | text, |
float | maxWidth = 0 , |
||
bool | forceUpdate = false , |
||
bool | forceLTRReadingOrder = false |
||
) |
|
protected |
bool CGUITextLayout::UpdateScrollinfo | ( | CScrollInfo & | scrollInfo | ) |
void CGUITextLayout::UpdateStyled | ( | const vecText & | text, |
const std::vector< UTILS::Color > & | colors, | ||
float | maxWidth = 0 , |
||
bool | forceLTRReadingOrder = false |
||
) |
Update text from a pre-styled vecText/std::vector<UTILS::Color> combination Allows styled text to be passed directly to the text layout.
text | the styled text to set. |
colors | the colors used on the text. |
maxWidth | the maximum width for wrapping text, defaults to 0 (no max width). |
forceLTRReadingOrder | whether to force left to right reading order, defaults to false. |
bool CGUITextLayout::UpdateW | ( | const std::wstring & | text, |
float | maxWidth = 0 , |
||
bool | forceUpdate = false , |
||
bool | forceLTRReadingOrder = false |
||
) |
|
inlineprotected |
Set whether or not to use the monospace font.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
true if the last string we updated was the wstring version
|
protected |
|
protected |
|
protected |
|
protected |
Mono-space font to use.
|
protected |
|
protected |
|
protected |
|
protected |
Varible-space font to use.
|
protected |