Attributed string — a sequence of styled text spans.
More...
#include <attributed_string.hpp>
|
| | AttributedString ()=default |
| | AttributedString (std::string text) |
| void | append (std::string text) |
| | Append plain text with default styling.
|
| void | append (TextSpan span) |
| | Append a fully styled span.
|
| void | append (std::string text, Color color) |
| | Append text with specific color.
|
| void | append (std::string text, float font_size, Color color) |
| | Append text with specific font size and color.
|
| const std::vector< TextSpan > & | spans () const |
| | Get all spans.
|
| std::string | plain_text () const |
| | Get the full plain text (concatenated).
|
| size_t | length () const |
| | Total character count.
|
| bool | empty () const |
| | Whether empty.
|
| void | clear () |
| | Clear all spans.
|
| void | set_font (std::string family, float size) |
| | Set font for all spans.
|
| void | set_color (Color color) |
| | Set color for all spans.
|
Attributed string — a sequence of styled text spans.
◆ AttributedString() [1/2]
| pulp::canvas::AttributedString::AttributedString |
( |
| ) |
|
|
default |
◆ AttributedString() [2/2]
| pulp::canvas::AttributedString::AttributedString |
( |
std::string | text | ) |
|
|
inlineexplicit |
◆ append() [1/4]
| void pulp::canvas::AttributedString::append |
( |
std::string | text | ) |
|
|
inline |
Append plain text with default styling.
◆ append() [2/4]
| void pulp::canvas::AttributedString::append |
( |
std::string | text, |
|
|
Color | color ) |
|
inline |
Append text with specific color.
◆ append() [3/4]
| void pulp::canvas::AttributedString::append |
( |
std::string | text, |
|
|
float | font_size, |
|
|
Color | color ) |
|
inline |
Append text with specific font size and color.
◆ append() [4/4]
| void pulp::canvas::AttributedString::append |
( |
TextSpan | span | ) |
|
|
inline |
Append a fully styled span.
◆ clear()
| void pulp::canvas::AttributedString::clear |
( |
| ) |
|
|
inline |
◆ empty()
| bool pulp::canvas::AttributedString::empty |
( |
| ) |
const |
|
inline |
◆ length()
| size_t pulp::canvas::AttributedString::length |
( |
| ) |
const |
|
inline |
◆ plain_text()
| std::string pulp::canvas::AttributedString::plain_text |
( |
| ) |
const |
|
inline |
Get the full plain text (concatenated).
◆ set_color()
| void pulp::canvas::AttributedString::set_color |
( |
Color | color | ) |
|
|
inline |
◆ set_font()
| void pulp::canvas::AttributedString::set_font |
( |
std::string | family, |
|
|
float | size ) |
|
inline |
◆ spans()
| const std::vector< TextSpan > & pulp::canvas::AttributedString::spans |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: