| 70 | } |
| 71 | const gap = " " |
| 72 | const draw = (line: string, fg: string, shadow: string, bg: string) => { |
| 73 | const parts: string[] = [] |
| 74 | for (const char of line) { |
| 75 | if (char === "_") { |
| 76 | parts.push(bg, " ", reset) |
| 77 | continue |
| 78 | } |
| 79 | if (char === "^") { |
| 80 | parts.push(fg, bg, "▀", reset) |
| 81 | continue |
| 82 | } |
| 83 | if (char === "~") { |
| 84 | parts.push(shadow, "▀", reset) |
| 85 | continue |
| 86 | } |
| 87 | if (char === " ") { |
| 88 | parts.push(" ") |
| 89 | continue |
| 90 | } |
| 91 | parts.push(fg, char, reset) |
| 92 | } |
| 93 | return parts.join("") |
| 94 | } |
| 95 | glyphs.left.forEach((row, index) => { |
| 96 | if (pad) result.push(pad) |
| 97 | result.push(draw(row, left.fg, left.shadow, left.bg)) |