18class Text :
public Node {
20 Text(std::string
text) : text_(
text) {}
22 void ComputeRequirement()
override {
27 void Render(Screen& screen)
override {
35 screen.PixelAt(x, y).character = cell;
44class VText :
public Node {
46 VText(std::string
text)
49 void ComputeRequirement()
override {
54 void Render(Screen& screen)
override {
62 screen.PixelAt(x, y).character = it;
88 return std::make_shared<Text>(
text);
137 return std::make_shared<VText>(
text);
A rectangular grid of Pixel.
std::shared_ptr< Node > Element
std::vector< std::string > Utf8ToGlyphs(const std::string &input)
int string_width(const std::string &)
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
Element text(std::wstring text)
Display a piece of unicode text.
Element vtext(std::wstring text)
Display a piece unicode text vertically.