29#include <TGUI/Font.hpp>
30#include <TGUI/Color.hpp>
31#include <TGUI/Vector2.hpp>
32#include <TGUI/TextStyle.hpp>
33#include <TGUI/RenderStates.hpp>
39 class BackendTextBase;
111 static String wordWrap(
float maxWidth,
const String& text,
Font font,
unsigned int textSize,
bool bold,
bool dropLeadingSpace =
true);
142 Text& operator=(
Text&&) noexcept = default;
194 void setCharacterSize(
unsigned int size);
203 unsigned int getCharacterSize() const;
230 void setOpacity(
float opacity);
239 float getOpacity() const;
303 void setOutlineThickness(
float thickness);
311 float getOutlineThickness() const;
326 Vector2f findCharacterPos(std::
size_t index) const;
334 float getExtraHorizontalPadding() const;
342 float getExtraHorizontalOffset() const;
348 float getLineHeight() const;
354 float getLineWidth() const;
372 Color m_outlineColor;
374 unsigned int m_characterSize = 32;
375 float m_outlineThickness = 0;
Base class for text implementations that depend on the backend.
Definition BackendText.hpp:39
Wrapper for colors.
Definition Color.hpp:63
Wrapper class to store strings.
Definition String.hpp:79
Wrapper for text styles.
Definition TextStyle.hpp:58
static unsigned int findBestTextSize(Font font, float height, int fit=0)
Finds the best character size for the text.
static float getExtraHorizontalPadding(Font font, unsigned int characterSize, TextStyles textStyle={})
Returns a small distance that text should be placed from the side of a widget as padding.
static float calculateExtraVerticalSpace(Font font, unsigned int characterSize, TextStyles style={})
Text()
Default constructor.
static float getExtraVerticalPadding(unsigned int characterSize)
Returns the distance that text should be placed from the bottom of the widget as padding.
static float getLineWidth(const String &text, Font font, unsigned int characterSize, TextStyles textStyle={})
Returns the width of a single line of text.
static float getLineHeight(Font font, unsigned int characterSize, TextStyles textStyle={})
Returns the height of a single line of text.
static float getExtraHorizontalOffset(Font font, unsigned int characterSize, TextStyles textStyle={})
Returns an extra distance that text should be placed from the side of a widget as padding.
static String wordWrap(float maxWidth, const String &text, Font font, unsigned int textSize, bool bold, bool dropLeadingSpace=true)
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
TextStyle
Enumeration of the text drawing styles.
Definition TextStyle.hpp:40