summaryrefslogtreecommitdiff
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
parent3d137aa3e9ff65234908be8a99adfb72d0882d04 (diff)
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
69 unsigned short autowrapped : 1; 69 unsigned short autowrapped : 1;
70 unsigned short newline : 1; 70 unsigned short newline : 1;
71 unsigned short tab : 1; 71 unsigned short tab : 1;
72 unsigned short fraktur : 1;
72#if defined(SUPPORT_80_132_COLUMNS) 73#if defined(SUPPORT_80_132_COLUMNS)
73 unsigned short is_80_132_mode_allowed : 1; 74 unsigned short is_80_132_mode_allowed : 1;
74#endif 75#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)
162 case 9: // strikethrough 162 case 9: // strikethrough
163 ty->state.att.strike = 1; 163 ty->state.att.strike = 1;
164 break; 164 break;
165 case 20: // fraktur!
166 ty->state.att.fraktur = 1;
167 break;
165 case 21: // no bold/bright 168 case 21: // no bold/bright
166 ty->state.att.bold = 0; 169 ty->state.att.bold = 0;
167 break; 170 break;
@@ -169,10 +172,11 @@ _handle_esc_csi_color_set(Termpty *ty, Eina_Unicode **ptr)
169 ty->state.att.bold = 0; 172 ty->state.att.bold = 0;
170 ty->state.att.faint = 0; 173 ty->state.att.faint = 0;
171 break; 174 break;
172 case 23: // no italic 175 case 23: // no italic, not fraktur
173#if defined(SUPPORT_ITALIC) 176#if defined(SUPPORT_ITALIC)
174 ty->state.att.italic = 0; 177 ty->state.att.italic = 0;
175#endif 178#endif
179 ty->state.att.fraktur = 0;
176 break; 180 break;
177 case 24: // no underline 181 case 24: // no underline
178 ty->state.att.underline = 0; 182 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] =
34}; 34};
35 35
36Eina_Unicode 36Eina_Unicode
37_termpty_charset_trans(Eina_Unicode g, int chset) 37_termpty_charset_trans(Eina_Unicode g, Termstate *state)
38{ 38{
39 switch (chset) 39 switch (state->charsetch)
40 { 40 {
41 case '0': /* DEC Special Character & Line Drawing Set */ 41 case '0': /* DEC Special Character & Line Drawing Set */
42 if ((g >= 0x41) && (g <= 0x7e) && 42 if ((g >= 0x41) && (g <= 0x7e) &&
@@ -49,5 +49,16 @@ _termpty_charset_trans(Eina_Unicode g, int chset)
49 default: 49 default:
50 break; 50 break;
51 } 51 }
52 if (state->att.fraktur)
53 {
54 if (g >= 'a' && g <= 'z')
55 {
56 g += 0x1d51e - 'a';
57 }
58 else if (g >= 'A' && g <= 'Z')
59 {
60 g += 0x1d504 - 'A';
61 }
62 }
52 return g; 63 return g;
53} 64}
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 @@
1#ifndef _TERMPTY_GFX_H__ 1#ifndef _TERMPTY_GFX_H__
2#define _TERMPTY_GFX_H__ 1 2#define _TERMPTY_GFX_H__ 1
3 3
4Eina_Unicode _termpty_charset_trans(Eina_Unicode g, int chset); 4#include "termpty.h"
5
6Eina_Unicode _termpty_charset_trans(Eina_Unicode g, Termstate *state);
5 7
6#endif 8#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)
196 termpty_cell_copy(ty, &(cells[j - 1]), &(cells[j]), 1); 196 termpty_cell_copy(ty, &(cells[j - 1]), &(cells[j]), 1);
197 } 197 }
198 198
199 g = _termpty_charset_trans(codepoints[i], ty->state.charsetch); 199 g = _termpty_charset_trans(codepoints[i], &ty->state);
200 200
201 termpty_cell_codepoint_att_fill(ty, g, ty->state.att, 201 termpty_cell_codepoint_att_fill(ty, g, ty->state.att,
202 &(cells[ty->state.cx]), 1); 202 &(cells[ty->state.cx]), 1);
203#if defined(SUPPORT_DBLWIDTH) 203#if defined(SUPPORT_DBLWIDTH)
@@ -360,6 +360,7 @@ _termpty_reset_att(Termatt *att)
360 att->autowrapped = 0; 360 att->autowrapped = 0;
361 att->newline = 0; 361 att->newline = 0;
362 att->tab = 0; 362 att->tab = 0;
363 att->fraktur = 0;
363} 364}
364 365
365void 366void