summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-03-13 09:15:32 +0100
committerBoris Faure <billiob@gmail.com>2018-03-13 09:15:32 +0100
commit9e0243d9f16f13b3bc2449b551aefd0d8a4da81e (patch)
treed300b24c295403ce28e01ca64eb2252344c898af
parentdeaadfeb01124f600658e75618964ae06f291f46 (diff)
support encircled escape code. Closes T6769
-rw-r--r--src/bin/termpty.h7
-rw-r--r--src/bin/termptyesc.c18
-rw-r--r--src/bin/termptygfx.c17
-rw-r--r--src/bin/termptyops.c3
-rwxr-xr-xtools/fonts.sh4
5 files changed, 47 insertions, 2 deletions
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index 9ad1ad6..5cac261 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -64,11 +64,14 @@ struct _Termatt
64 unsigned short autowrapped : 1; 64 unsigned short autowrapped : 1;
65 unsigned short newline : 1; 65 unsigned short newline : 1;
66 unsigned short fraktur : 1; 66 unsigned short fraktur : 1;
67 unsigned short framed : 1;
68 unsigned short encircled : 1;
69 unsigned short overlined : 1;
67#if defined(SUPPORT_80_132_COLUMNS) 70#if defined(SUPPORT_80_132_COLUMNS)
68 unsigned short is_80_132_mode_allowed : 1; 71 unsigned short is_80_132_mode_allowed : 1;
69 unsigned short bit_padding : 14; 72 unsigned short bit_padding : 11;
70#else 73#else
71 unsigned short bit_padding : 15; 74 unsigned short bit_padding : 12;
72#endif 75#endif
73}; 76};
74 77
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index b34250b..3cc4e20 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -847,6 +847,24 @@ _handle_esc_csi_color_set(Termpty *ty, Eina_Unicode **ptr)
847 ty->termstate.att.bg = COL_DEF; 847 ty->termstate.att.bg = COL_DEF;
848 ty->termstate.att.bgintense = 0; 848 ty->termstate.att.bgintense = 0;
849 break; 849 break;
850 case 51:
851 WRN("TODO: support SGR 51 - framed attribute");
852 ty->termstate.att.framed = 1;
853 break;
854 case 52:
855 ty->termstate.att.encircled = 1;
856 break;
857 case 53:
858 WRN("TODO: support SGR 51 - overlined attribute");
859 ty->termstate.att.overlined = 1;
860 break;
861 case 54:
862 ty->termstate.att.framed = 0;
863 ty->termstate.att.encircled = 0;
864 break;
865 case 55:
866 ty->termstate.att.overlined = 0;
867 break;
850 case 90: // fg 868 case 90: // fg
851 case 91: 869 case 91:
852 case 92: 870 case 92:
diff --git a/src/bin/termptygfx.c b/src/bin/termptygfx.c
index 79dee37..afb7115 100644
--- a/src/bin/termptygfx.c
+++ b/src/bin/termptygfx.c
@@ -60,5 +60,22 @@ _termpty_charset_trans(const Termpty *ty, Eina_Unicode g)
60 g += 0x1d504 - 'A'; 60 g += 0x1d504 - 'A';
61 } 61 }
62 } 62 }
63 else if (ty->termstate.att.encircled)
64 {
65 if (g >= 'a' && g <= 'z')
66 {
67 g += 0x24d0 - 'a';
68 }
69 else if (g >= 'A' && g <= 'Z')
70 {
71 g += 0x24b6 - 'A';
72 }
73 else if (g >= '1' && g <= '9')
74 {
75 g += 0x2460 - '0';
76 }
77 else if (g == '0')
78 g = 0x24ea;
79 }
63 return g; 80 return g;
64} 81}
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 068ac47..5c1465a 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -418,6 +418,9 @@ termpty_reset_att(Termatt *att)
418 att->autowrapped = 0; 418 att->autowrapped = 0;
419 att->newline = 0; 419 att->newline = 0;
420 att->fraktur = 0; 420 att->fraktur = 0;
421 att->framed = 0;
422 att->encircled = 0;
423 att->overlined = 0;
421} 424}
422 425
423void 426void
diff --git a/tools/fonts.sh b/tools/fonts.sh
index 917bab8..ef4b340 100755
--- a/tools/fonts.sh
+++ b/tools/fonts.sh
@@ -18,3 +18,7 @@ echo -ne "\033[3;1mABCDEFGHIJKLMNOPQRSTUVWXYZ\n\033[0m"
18echo -ne "\nfraktur\n" 18echo -ne "\nfraktur\n"
19echo -ne "\033[20mabcdefghijklmnopqrstuvwxyz\n\033[0m" 19echo -ne "\033[20mabcdefghijklmnopqrstuvwxyz\n\033[0m"
20echo -ne "\033[20mABCDEFGHIJKLMNOPQRSTUVWXYZ\n\033[0m" 20echo -ne "\033[20mABCDEFGHIJKLMNOPQRSTUVWXYZ\n\033[0m"
21
22echo -ne "\nencircled\n"
23echo -ne "\033[52ma b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4\n\033[0m"
24echo -ne "\033[52mA B C D E F G H I J K L M N O P Q R S T U V W X Y Z 5 6 7 8 9\n\033[0m"