ANSI code renderer starts working but I have to make it utf8/wchar_t friendly.

This commit is contained in:
Zed A. Shaw 2024-11-01 18:07:47 -04:00
parent 6ca4614fcb
commit ae484bf425
9 changed files with 136 additions and 139 deletions

View file

@ -33,7 +33,6 @@ std::string generate_colors() {
count++;
}
array.push_back(hbox(std::move(line)));
break; /// UNDO ME
}
println("MADE {} CHARS", count);
@ -53,7 +52,18 @@ std::string generate_colors() {
TEST_CASE("test out ragel parser", "[gui]") {
std::string colors = generate_colors();
sf::Color default_fg(0,0,0);
sf::Color default_bg(100,100,100);
println("--- PARSING");
REQUIRE(parse_ansi(colors));
bool good = parse_ansi(colors, default_fg, default_bg, [&](sf::Color bgcolor, sf::Color color, char ch) {
bool correct_char = ch == '#' || ch == ' ' || ch == '\n' || ch == '\r';
// println("FG: {},{},{},{}; BG: {},{},{},{}; ch: {}",
// color.r, color.g, color.b, color.a,
// bgcolor.r, bgcolor.g, bgcolor.b, bgcolor.a,
// int(ch));
REQUIRE(correct_char);
});
REQUIRE(good);
}