xbmc
|
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 color, UTILS::COLOR::Color shadowColor, uint32_t alignment, float maxWidth, bool solid=false) |
void | RenderScrolling (float x, float y, float angle, UTILS::COLOR::Color color, UTILS::COLOR::Color shadowColor, uint32_t alignment, float maxWidth, const CScrollInfo &scrollInfo) |
void | RenderOutline (float x, float y, UTILS::COLOR::Color color, UTILS::COLOR::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::Color > &colors, float maxWidth=0, bool forceLTRReadingOrder=false) |
Update text from a pre-styled vecText/std::vector<UTILS::COLOR::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 color, UTILS::COLOR::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. | |
void | UseMonoFont (bool use) |
Set whether or not to use the monospace font. | |
Static Protected Member Functions | |
static void | BidiTransform (std::vector< CGUIString > &lines, bool forceLTRReadingOrder) |
static std::wstring | BidiFlip (const std::wstring &text, bool forceLTRReadingOrder, int *visualToLogicalMap=nullptr) |
Protected Attributes | |
std::vector< UTILS::COLOR::Color > | m_colors |
std::vector< CGUIString > | m_lines |
CGUIFont * | m_font |
CGUIFont * | m_borderFont |
CGUIFont * | m_monoFont = nullptr |
Mono-space font to use. | |
CGUIFont * | m_varFont |
Varible-space font to use. | |
bool | m_wrap |
float | m_maxHeight |
UTILS::COLOR::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 | |
float | m_textWidth |
float | m_textHeight |
|
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).
|
inline |
Returns the precalculated width of the text to be rendered (in constant time).
void CGUITextLayout::RenderOutline | ( | float | x, |
float | y, | ||
UTILS::COLOR::Color | color, | ||
UTILS::COLOR::Color | outlineColor, | ||
uint32_t | alignment, | ||
float | maxWidth | ||
) |
void CGUITextLayout::UpdateStyled | ( | const vecText & | text, |
const std::vector< UTILS::COLOR::Color > & | colors, | ||
float | maxWidth = 0 , |
||
bool | forceLTRReadingOrder = false |
||
) |
Update text from a pre-styled vecText/std::vector<UTILS::COLOR::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. |