36#include <utility/graphic/renderable.hpp>
39#include <utility/graphic/pose.hpp>
41#include <utility/graphic/mesh.hpp>
43#include <utility/graphic/text/font.hpp>
46#include <utility/graphic/size.hpp>
47#include <utility/math/vector.hpp>
49#include <utility/system_io/file.hpp>
50#include <utility/ressource_provider.hpp>
60#define DEFAULT_FONT_COLOR \
61 utility::graphic::Color<std::uint8_t>(255, 255, 255, 255)
63namespace utility::graphic
78 std::string _fontPath;
133 Text(std::shared_ptr<RessourceProvider> ressourceProvider,
135 const std::string &content, uint32_t fontSize,
136 const std::string &font);
161 std::shared_ptr<Mesh>
getMesh()
const;
236 return _content.empty();
245 return !_fontPath.empty();
265 return _content == other._content && _fontPath == other._fontPath
266 && _fontSize == other._fontSize &&
_color == other.
_color
277 return !(*
this == other);
The Renderable class represents an object that can be rendered in the graphics application.
PoseF _pose
World pose (position and orientation) of the text.
Color32Bit _color
Text RGBA color.
Storage for text content and rendering properties.
Text(Text &&other) noexcept=default
Move constructor.
std::shared_ptr< Font > _font
Shared pointer to the font used for rendering.
Text & clearContent(void)
Clear text content.
bool operator!=(const Text &other) const
Inequality comparison.
codePointString utf8ToCodepoints(const std::string &str) const
Converts a UTF-8 encoded string to a string of Unicode code points.
Text(const Text &other)=delete
Copy constructor.
bool empty(void) const noexcept
Check if text content is empty.
Text & operator=(const Text &other)=delete
Copy assignment operator.
const std::string & getFontFamily(void) const
Get the font family (path) used for rendering the text.
void updateMesh(void)
Updates the mesh for rendering the text based on the current content, font, and font size.
bool operator==(const Text &other) const
Equality comparison.
bool hasFontPath(void) const noexcept
Check if font path is set.
const std::string & getContent(void) const
Get the text content.
std::shared_ptr< Mesh > getMesh() const
Get the mesh for rendering the text.
Text & setFontSize(uint32_t fontSize)
Set the font size.
Text & operator=(Text &&other) noexcept=default
Move assignment operator.
uint32_t getFontSize(void) const
Get the font size.
Text & setContent(const std::string &content)
Set the text content.
graphic::SizeF getTextDimensions(void) const
Get the dimensions of the rendered text.
Mixin base class providing logging capabilities to derived classes.
Code point definitions for text rendering.
std::vector< uint32_t > codePointString
A type representing a string of Unicode code points.
RGBA color representation with blending and manipulation operations.
Platform-specific default logger alias.
Mixin class to provide logging capabilities to derived classes.