aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2014-04-06 14:42:38 +0200
committerBoris Faure <billiob@gmail.com>2014-04-06 14:42:38 +0200
commit02856cbdec511e08cf579b08e906499d9583f018 (patch)
tree7f105036f60cca8c2c5bf36a7b7db4d76ea63bb8
parentfix wrong assignement (diff)
downloadterminology-02856cbdec511e08cf579b08e906499d9583f018.tar.gz
terminology supports fraktur!!
-rw-r--r--src/bin/termpty.h1
-rw-r--r--src/bin/termptyesc.c6
-rw-r--r--src/bin/termptygfx.c15
-rw-r--r--src/bin/termptygfx.h4
-rw-r--r--src/bin/termptyops.c5
5 files changed, 25 insertions, 6 deletions
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index 0fc0e6e..e2e05e2 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 c5b5d72..9e30809 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 3a6a607..00ffabf 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 770cd9d..a7bbaad 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 34b9c9b..ac84866 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