A barely working tool to find font characters and pick their color.

This commit is contained in:
Zed A. Shaw 2024-12-07 13:42:30 -05:00
parent 6b3ce5eb3d
commit 0edd948101
17 changed files with 406 additions and 72 deletions

View file

@ -10,7 +10,7 @@
using namespace fmt;
#line 121 "ansi_parser.rl"
#line 122 "ansi_parser.rl"
@ -25,23 +25,23 @@ static const char _ansi_parser_actions[] = {
static const char _ansi_parser_key_offsets[] = {
0, 0, 1, 2, 10, 11, 13, 16,
19, 20, 24, 25, 26, 27, 28, 30,
33, 35, 38, 40, 43, 44, 47, 48,
49, 50, 51, 52
20, 21, 25, 26, 27, 28, 29, 31,
34, 36, 39, 41, 44, 45, 48, 49,
50, 51, 52, 53
};
static const int _ansi_parser_trans_keys[] = {
27, 91, 49, 50, 51, 52, 55, 57,
48, 54, 109, 48, 109, 34, 48, 55,
50, 55, 109, 109, 49, 56, 57, 109,
109, 59, 50, 59, 48, 57, 59, 48,
57, 48, 57, 59, 48, 57, 48, 57,
109, 48, 57, 109, 56, 57, 109, 59,
50, 109, 109, 27, 27, 0
50, 52, 55, 109, 109, 49, 56, 57,
109, 109, 59, 50, 59, 48, 57, 59,
48, 57, 48, 57, 59, 48, 57, 48,
57, 109, 48, 57, 109, 56, 57, 109,
59, 50, 109, 109, 27, 27, 0
};
static const char _ansi_parser_single_lengths[] = {
0, 1, 1, 6, 1, 2, 3, 3,
0, 1, 1, 6, 1, 2, 3, 4,
1, 4, 1, 1, 1, 1, 0, 1,
0, 1, 0, 1, 1, 3, 1, 1,
1, 1, 1, 1
@ -56,35 +56,35 @@ static const char _ansi_parser_range_lengths[] = {
static const char _ansi_parser_index_offsets[] = {
0, 0, 2, 4, 12, 14, 17, 21,
25, 27, 32, 34, 36, 38, 40, 42,
45, 47, 50, 52, 55, 57, 61, 63,
65, 67, 69, 71
26, 28, 33, 35, 37, 39, 41, 43,
46, 48, 51, 53, 56, 58, 62, 64,
66, 68, 70, 72
};
static const char _ansi_parser_trans_targs[] = {
2, 1, 3, 0, 5, 7, 9, 21,
25, 6, 4, 0, 27, 0, 6, 27,
0, 4, 4, 4, 0, 4, 8, 27,
0, 27, 0, 10, 11, 20, 27, 0,
27, 0, 12, 0, 13, 0, 14, 0,
15, 0, 16, 15, 0, 17, 0, 18,
17, 0, 19, 0, 27, 19, 0, 27,
0, 22, 24, 27, 0, 23, 0, 13,
0, 27, 0, 27, 0, 2, 1, 2,
1, 0
0, 4, 4, 4, 0, 4, 4, 8,
27, 0, 27, 0, 10, 11, 20, 27,
0, 27, 0, 12, 0, 13, 0, 14,
0, 15, 0, 16, 15, 0, 17, 0,
18, 17, 0, 19, 0, 27, 19, 0,
27, 0, 22, 24, 27, 0, 23, 0,
13, 0, 27, 0, 27, 0, 2, 1,
2, 1, 0
};
static const char _ansi_parser_trans_actions[] = {
0, 7, 0, 0, 21, 21, 21, 21,
21, 21, 21, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 17,
0, 15, 0, 0, 0, 0, 0, 0,
19, 0, 0, 0, 3, 0, 0, 0,
1, 0, 25, 0, 0, 1, 0, 28,
0, 0, 1, 0, 34, 0, 0, 9,
0, 0, 0, 0, 0, 0, 0, 5,
0, 11, 0, 13, 0, 0, 7, 23,
31, 0
0, 0, 0, 0, 0, 0, 0, 0,
17, 0, 15, 0, 0, 0, 0, 0,
0, 19, 0, 0, 0, 3, 0, 0,
0, 1, 0, 25, 0, 0, 1, 0,
28, 0, 0, 1, 0, 34, 0, 0,
9, 0, 0, 0, 0, 0, 0, 0,
5, 0, 11, 0, 13, 0, 0, 7,
23, 31, 0
};
static const char _ansi_parser_eof_actions[] = {
@ -101,7 +101,7 @@ static const int ansi_parser_error = 0;
static const int ansi_parser_en_main = 26;
#line 124 "ansi_parser.rl"
#line 125 "ansi_parser.rl"
#include <ftxui/screen/terminal.hpp>
@ -128,7 +128,7 @@ bool ANSIParser::parse(std::wstring_view codes, ColorCB color_cb, WriteCB write_
cs = ansi_parser_start;
}
#line 145 "ansi_parser.rl"
#line 146 "ansi_parser.rl"
#line 121 "ansi_parser.cpp"
{
@ -349,7 +349,7 @@ _again:
_out: {}
}
#line 146 "ansi_parser.rl"
#line 147 "ansi_parser.rl"
bool good = pe - p == 0;