support encircled escape code. Closes T6769

This commit is contained in:
Boris Faure 2018-03-13 09:15:32 +01:00
parent deaadfeb01
commit 9e0243d9f1
5 changed files with 47 additions and 2 deletions

View File

@ -64,11 +64,14 @@ struct _Termatt
unsigned short autowrapped : 1;
unsigned short newline : 1;
unsigned short fraktur : 1;
unsigned short framed : 1;
unsigned short encircled : 1;
unsigned short overlined : 1;
#if defined(SUPPORT_80_132_COLUMNS)
unsigned short is_80_132_mode_allowed : 1;
unsigned short bit_padding : 14;
unsigned short bit_padding : 11;
#else
unsigned short bit_padding : 15;
unsigned short bit_padding : 12;
#endif
};

View File

@ -847,6 +847,24 @@ _handle_esc_csi_color_set(Termpty *ty, Eina_Unicode **ptr)
ty->termstate.att.bg = COL_DEF;
ty->termstate.att.bgintense = 0;
break;
case 51:
WRN("TODO: support SGR 51 - framed attribute");
ty->termstate.att.framed = 1;
break;
case 52:
ty->termstate.att.encircled = 1;
break;
case 53:
WRN("TODO: support SGR 51 - overlined attribute");
ty->termstate.att.overlined = 1;
break;
case 54:
ty->termstate.att.framed = 0;
ty->termstate.att.encircled = 0;
break;
case 55:
ty->termstate.att.overlined = 0;
break;
case 90: // fg
case 91:
case 92:

View File

@ -60,5 +60,22 @@ _termpty_charset_trans(const Termpty *ty, Eina_Unicode g)
g += 0x1d504 - 'A';
}
}
else if (ty->termstate.att.encircled)
{
if (g >= 'a' && g <= 'z')
{
g += 0x24d0 - 'a';
}
else if (g >= 'A' && g <= 'Z')
{
g += 0x24b6 - 'A';
}
else if (g >= '1' && g <= '9')
{
g += 0x2460 - '0';
}
else if (g == '0')
g = 0x24ea;
}
return g;
}

View File

@ -418,6 +418,9 @@ termpty_reset_att(Termatt *att)
att->autowrapped = 0;
att->newline = 0;
att->fraktur = 0;
att->framed = 0;
att->encircled = 0;
att->overlined = 0;
}
void

View File

@ -18,3 +18,7 @@ echo -ne "\033[3;1mABCDEFGHIJKLMNOPQRSTUVWXYZ\n\033[0m"
echo -ne "\nfraktur\n"
echo -ne "\033[20mabcdefghijklmnopqrstuvwxyz\n\033[0m"
echo -ne "\033[20mABCDEFGHIJKLMNOPQRSTUVWXYZ\n\033[0m"
echo -ne "\nencircled\n"
echo -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"
echo -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"