Commit: 57fc3d43c1091cb2a41d98f9def6765a6c8eee6f
Parent: 24cbead998946bc0f165937fee56ab3a5cad73ad
Author: Randy Palamar
Date:   Sat,  4 Jan 2025 22:56:40 -0700
use DEC special graphics table directly rather than rxvt extension
Diffstat:
2 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/font.c b/font.c
@@ -1,24 +1,16 @@
 /* See LICENSE for copyright details */
-/* NOTE: graphic character rxvt extension */
-/*                                          | 0x41 - 0x7e
- *  "↑", "↓", "→", "←", "█", "▚", "☃",      | A - G
- *  0, 0, 0, 0, 0, 0, 0, 0,                 | H - O
- *  0, 0, 0, 0, 0, 0, 0, 0,                 | P - W
- *  0, 0, 0, 0, 0, 0, 0, " ",               | X - _
+/* NOTE: https://en.wikipedia.org/wiki/DEC_Special_Graphics */
+/*                                          | 0x60 - 0x7e
  *  "◆", "▒", "␉", "␌", "␍", "␊", "°", "±", | ` - g
  *  "", "␋", "┘", "┐", "┌", "└", "┼", "⎺", | h - o
  *  "⎻", "─", "⎼", "⎽", "├", "┤", "┴", "┬", | p - w
  *  "│", "≤", "≥", "π", "≠", "£", "·",      | x - ~
  */
-static u16 graphic_0[62] = {
-	0x2191, 0x2193, 0x2192, 0x2190, 0x2588, 0x259A, 0x2603, 0x0000,
-	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x25C6,
-	0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x00B0, 0x00B1, 0x2424,
-	0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA, 0x23BB,
-	0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C, 0x2502,
-	0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00B7,
+static u16 graphic_0[31] = {
+        0x25C6, 0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x00B0, 0x00B1,
+        0x2424, 0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA,
+        0x23BB, 0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C,
+        0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00B7,
 };
 
 #define STB_TRUETYPE_IMPLEMENTATION
diff --git a/terminal.c b/terminal.c
@@ -1212,9 +1212,8 @@ push_normal_cp(Term *t, TermView *tv, u32 cp)
 	if (t->mode.term & TM_AUTO_WRAP && t->cursor.state & CURSOR_WRAP_NEXT)
 		push_newline(t, 1);
 
-	if (t->cursor.charsets[t->cursor.charset_index] == CS_GRAPHIC0 &&
-	    BETWEEN(cp, 0x41, 0x7e) && graphic_0[cp - 0x41])
-		cp = graphic_0[cp - 0x41];
+	if (t->cursor.charsets[t->cursor.charset_index] == CS_GRAPHIC0 && BETWEEN(cp, 0x60, 0x7e))
+		cp = graphic_0[cp - 0x60];
 
 	u32 width = 1;
 	if (cp > 0x7F) {