diff --git a/src/bin/termpty.h b/src/bin/termpty.h index 0fc0e6e7..e2e05e26 100644 --- a/src/bin/termpty.h +++ b/src/bin/termpty.h @@ -69,6 +69,7 @@ struct _Termatt unsigned short autowrapped : 1; unsigned short newline : 1; unsigned short tab : 1; + unsigned short fraktur : 1; #if defined(SUPPORT_80_132_COLUMNS) unsigned short is_80_132_mode_allowed : 1; #endif diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index c5b5d725..9e30809e 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -162,6 +162,9 @@ _handle_esc_csi_color_set(Termpty *ty, Eina_Unicode **ptr) case 9: // strikethrough ty->state.att.strike = 1; break; + case 20: // fraktur! + ty->state.att.fraktur = 1; + break; case 21: // no bold/bright ty->state.att.bold = 0; break; @@ -169,10 +172,11 @@ _handle_esc_csi_color_set(Termpty *ty, Eina_Unicode **ptr) ty->state.att.bold = 0; ty->state.att.faint = 0; break; - case 23: // no italic + case 23: // no italic, not fraktur #if defined(SUPPORT_ITALIC) ty->state.att.italic = 0; #endif + ty->state.att.fraktur = 0; break; case 24: // no underline ty->state.att.underline = 0; diff --git a/src/bin/termptygfx.c b/src/bin/termptygfx.c index 3a6a6070..00ffabfd 100644 --- a/src/bin/termptygfx.c +++ b/src/bin/termptygfx.c @@ -34,9 +34,9 @@ static const unsigned short vt100_to_unicode[62] = }; Eina_Unicode -_termpty_charset_trans(Eina_Unicode g, int chset) +_termpty_charset_trans(Eina_Unicode g, Termstate *state) { - switch (chset) + switch (state->charsetch) { case '0': /* DEC Special Character & Line Drawing Set */ if ((g >= 0x41) && (g <= 0x7e) && @@ -49,5 +49,16 @@ _termpty_charset_trans(Eina_Unicode g, int chset) default: break; } + if (state->att.fraktur) + { + if (g >= 'a' && g <= 'z') + { + g += 0x1d51e - 'a'; + } + else if (g >= 'A' && g <= 'Z') + { + g += 0x1d504 - 'A'; + } + } return g; } diff --git a/src/bin/termptygfx.h b/src/bin/termptygfx.h index 770cd9d0..a7bbaad6 100644 --- a/src/bin/termptygfx.h +++ b/src/bin/termptygfx.h @@ -1,6 +1,8 @@ #ifndef _TERMPTY_GFX_H__ #define _TERMPTY_GFX_H__ 1 -Eina_Unicode _termpty_charset_trans(Eina_Unicode g, int chset); +#include "termpty.h" + +Eina_Unicode _termpty_charset_trans(Eina_Unicode g, Termstate *state); #endif diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c index 34b9c9b6..ac84866a 100644 --- a/src/bin/termptyops.c +++ b/src/bin/termptyops.c @@ -196,8 +196,8 @@ _termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len) termpty_cell_copy(ty, &(cells[j - 1]), &(cells[j]), 1); } - g = _termpty_charset_trans(codepoints[i], ty->state.charsetch); - + g = _termpty_charset_trans(codepoints[i], &ty->state); + termpty_cell_codepoint_att_fill(ty, g, ty->state.att, &(cells[ty->state.cx]), 1); #if defined(SUPPORT_DBLWIDTH) @@ -360,6 +360,7 @@ _termpty_reset_att(Termatt *att) att->autowrapped = 0; att->newline = 0; att->tab = 0; + att->fraktur = 0; } void