Each cell on the terminal can be represented with a Glyph. A Glyph is composed
of a char32_t
and a Brush
object.
There are a few ways to create a Glyph.
With the constructors:
constexpr Glyph(char32_t sym, Brush b);
template <typename... Traits>
constexpr Glyph(char32_t sym, Traits&&... traits);
With char32_t
in combination with the pipe operator:
auto const bold_x = U'X' | Trait::Bold;
Glyphs and char32_t
can be combined with Traits and Colors using the pipe
operator |
. These are modifying operations when applied to l-value Glyphs.
auto fancy_x = U'X' | Trait::Bold | Trait::Inverse;
fancy_x | Trait::Italic;
auto const red_x = U'X' | fg(Color::Red);
auto const bg_blue_x = U'X' | bg(Color::Blue);