3#include "structure/graphics/painter/spk_font_painter.hpp"
4#include "structure/graphics/spk_color.hpp"
5#include "structure/graphics/spk_extend_2d.hpp"
6#include "structure/graphics/spk_font.hpp"
7#include "structure/widget/spk_widget.hpp"
8#include "type/spk_text_aligmnent.hpp"
28 spk::Color _glyphColor{1.0f, 1.0f, 1.0f, 1.0f};
29 spk::Color _outlineColor{0.0f, 0.0f, 0.0f, 1.0f};
30 HorizontalAlignment _horizontalAlignment = HorizontalAlignment::Centered;
31 VerticalAlignment _verticalAlignment = VerticalAlignment::Centered;
40 void _subscribeToBitmapEdition();
79 void setAlignment(HorizontalAlignment p_horizontalAlignment, VerticalAlignment p_verticalAlignment);
84 void setText(
const std::wstring &p_text);
95 const float &
layer()
const;
121 const std::wstring &
text()
const;
spk::ContractProvider::Contract EditionContract
Contract type returned by edition subscriptions.
Definition spk_font.hpp:108
Loads font data and provides cached bitmap atlases per size.
Definition spk_font.hpp:33
Painter that renders FontMesh instances.
Definition spk_font_painter.hpp:248
void render()
Renders the text region.
Definition spk_text_region.cpp:187
void setAlignment(HorizontalAlignment p_horizontalAlignment, VerticalAlignment p_verticalAlignment)
Sets text alignment within the region.
Definition spk_text_region.cpp:111
const std::wstring & text() const
Returns the current text content.
Definition spk_text_region.cpp:144
const spk::Font::Size & fontSize() const
Returns the current font size.
Definition spk_text_region.cpp:129
const spk::Extend2D & geometry() const
Returns the current render geometry.
Definition spk_text_region.cpp:165
void setText(const std::wstring &p_text)
Sets the text content.
Definition spk_text_region.cpp:118
void setOutlineColor(const spk::Color &p_color)
Sets the glyph outline color.
Definition spk_text_region.cpp:98
const float & layer() const
Returns the current layer value.
Definition spk_text_region.cpp:182
void setGlyphColor(const spk::Color &p_color)
Sets the glyph fill color.
Definition spk_text_region.cpp:92
void setColors(const spk::Color &p_glyphColor, const spk::Color &p_outlineColor)
Sets glyph and outline colors together.
Definition spk_text_region.cpp:104
const spk::Vector2UInt computeTextSize() const
Computes the text size using current font settings.
Definition spk_text_region.cpp:170
void setLayer(const float &p_layer)
Sets the rendering layer.
Definition spk_text_region.cpp:177
const spk::Color & outlineColor() const
Returns the glyph outline color.
Definition spk_text_region.cpp:139
void setGeometry(const spk::Extend2D &p_geometry)
Sets the geometry used to render the text.
Definition spk_text_region.cpp:159
spk::Font * font() const
Returns the current font pointer.
Definition spk_text_region.cpp:124
const spk::Color & glyphColor() const
Returns the glyph fill color.
Definition spk_text_region.cpp:134
void setFontSize(const spk::Font::Size &p_size)
Sets the font size used for rendering.
Definition spk_text_region.cpp:85
VerticalAlignment verticalAlignment() const
Returns the vertical alignment setting.
Definition spk_text_region.cpp:154
HorizontalAlignment horizontalAlignment() const
Returns the horizontal alignment setting.
Definition spk_text_region.cpp:149
void setFont(spk::Font *p_font)
Sets the font used for rendering.
Definition spk_text_region.cpp:73
TextRegion()
Builds an empty text region.
Definition spk_text_region.cpp:7
RGBA color utility storing normalized floating components.
Definition spk_color.hpp:18
Axis-aligned rectangle defined by an anchor point and size.
Definition spk_extend_2d.hpp:24
Defines glyph and outline sizes for a font bitmap.
Definition spk_font.hpp:40
Mesh specialization for font glyphs.
Definition spk_font_painter.hpp:51