Builder that converts text into glyph polygons.
More...
#include <spk_font_painter.hpp>
|
|
| Builder ()=default |
| | Builds an empty builder.
|
| | Builder (Font *p_font, const Font::Size &p_fontSize, size_t p_tabSize=4) |
| | Builds a builder for a font and size.
|
| Builder & | setTabSize (size_t p_tabSize) |
| | Sets the tab size used for layout.
|
| Builder & | clear () |
| | Clears any accumulated text and layout state.
|
| Builder & | addText (const std::wstring &p_text) |
| | Appends text to the layout buffer.
|
| Builder & | addNewline () |
| | Inserts a line break in the layout buffer.
|
| spk::Vector2UInt | computeTextSize (const std::wstring &p_text) const |
| | Computes the pixel size for a text string.
|
| FontMesh | construct (const spk::Vector2Int &p_anchor, spk::HorizontalAlignment p_horizontalAlignment=spk::HorizontalAlignment::Centered, spk::VerticalAlignment p_verticalAlignment=spk::VerticalAlignment::Centered) |
| | Builds a FontMesh with alignment around an anchor.
|
Builder that converts text into glyph polygons.
Builder that converts text into glyph polygons.
Definition spk_font_painter.hpp:64
FontMesh construct(const spk::Vector2Int &p_anchor, spk::HorizontalAlignment p_horizontalAlignment=spk::HorizontalAlignment::Centered, spk::VerticalAlignment p_verticalAlignment=spk::VerticalAlignment::Centered)
Builds a FontMesh with alignment around an anchor.
Definition spk_font_painter.cpp:236
Builder & addText(const std::wstring &p_text)
Appends text to the layout buffer.
Definition spk_font_painter.cpp:162
const Font * font() const
Returns the font used by this mesh.
Definition spk_font_painter.cpp:303
◆ Builder()
| spk::FontMesh::Builder::Builder |
( |
Font * | p_font, |
|
|
const Font::Size & | p_fontSize, |
|
|
size_t | p_tabSize = 4 ) |
Builds a builder for a font and size.
- Parameters
-
| p_font | Font to use for glyphs. |
| p_fontSize | Requested font size. |
| p_tabSize | Number of spaces per tab. |
◆ addNewline()
Inserts a line break in the layout buffer.
- Returns
- Reference to this builder.
◆ addText()
Appends text to the layout buffer.
- Parameters
-
- Returns
- Reference to this builder.
◆ clear()
Clears any accumulated text and layout state.
- Returns
- Reference to this builder.
◆ computeTextSize()
| spk::Vector2UInt spk::FontMesh::Builder::computeTextSize |
( |
const std::wstring & | p_text | ) |
const |
Computes the pixel size for a text string.
- Parameters
-
- Returns
- Size in pixels.
◆ construct()
| FontMesh spk::FontMesh::Builder::construct |
( |
const spk::Vector2Int & | p_anchor, |
|
|
spk::HorizontalAlignment | p_horizontalAlignment = spk::HorizontalAlignment::Centered, |
|
|
spk::VerticalAlignment | p_verticalAlignment = spk::VerticalAlignment::Centered ) |
Builds a FontMesh with alignment around an anchor.
- Parameters
-
| p_anchor | Anchor position. |
| p_horizontalAlignment | Horizontal alignment. |
| p_verticalAlignment | Vertical alignment. |
- Returns
- Constructed FontMesh.
◆ setTabSize()
Sets the tab size used for layout.
- Parameters
-
| p_tabSize | Number of spaces per tab. |
- Returns
- Reference to this builder.
The documentation for this class was generated from the following files:
- includes/structure/graphics/painter/spk_font_painter.hpp
- srcs/structure/graphics/painter/spk_font_painter.cpp