Each cell on the terminal can be represented with a Glyph. A Glyph is composed
of a wchar_t
and a Brush
object.
There are a few ways to create a Glyph.
With the constructors:
constexpr Glyph(wchar_t sym, Brush b);
template <typename... Traits>
constexpr Glyph(wchar_t sym, Traits&&... traits);
With wchar_t
in combination with the pipe operator:
auto const bold_x = L'X' | Trait::Bold;
Glyphs and wchar_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 = L'X' | Trait::Bold | Trait::Inverse;
fancy_x | Trait::Italic;
auto const red_x = L'X' | fg(Color::Red);
auto const bg_blue_x = L'X' | bg(Color::Blue);