Explorar el Código

Add UTF-8 mapper for Slovak language

Based on #7862, #7846 by @rmoravcik
Scott Lahteine hace 7 años
padre
commit
c0382cd8cd

+ 151
- 0
Marlin/src/lcd/dogm/dogm_font_data_ISO10646_SK.h Ver fichero

@@ -0,0 +1,151 @@
1
+/*
2
+  Fontname: ISO10646_SK
3
+  Copyright: A. Hardtung, modified by Roman Moravcik
4
+  Capital A Height: 7, '1' Height: 7
5
+  Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9
6
+  Font Bounding box     w= 6 h= 9 x= 0 y=-2
7
+  Calculated Min Values           x= 0 y=-1 dx= 0 dy= 0
8
+  Pure Font   ascent = 7 descent=-1
9
+  X Font      ascent = 7 descent=-1
10
+  Max Font    ascent = 8 descent=-1
11
+*/
12
+#include <U8glib.h>
13
+const u8g_fntpgm_uint8_t ISO10646_SK[2203] U8G_SECTION(".progmem.ISO10646_SK") = {
14
+  0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7,
15
+  255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
16
+  128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
17
+  0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
18
+  120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
19
+  64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
20
+  2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
21
+  64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
22
+  32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
23
+  5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
24
+  64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
25
+  192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
26
+  0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64,
27
+  192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
28
+  128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
29
+  5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
30
+  6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
31
+  112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
32
+  32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
33
+  112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5,
34
+  5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
35
+  192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
36
+  32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
37
+  0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
38
+  8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168,
39
+  168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,
40
+  7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,
41
+  0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240,
42
+  136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240,
43
+  128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,
44
+  5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,
45
+  6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,
46
+  128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,
47
+  16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,
48
+  136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,
49
+  7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,
50
+  0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,
51
+  136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,
52
+  128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,
53
+  7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,
54
+  0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,
55
+  32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,
56
+  136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,
57
+  5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,
58
+  6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
59
+  136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,
60
+  32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,
61
+  224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
62
+  1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,
63
+  80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,
64
+  64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,
65
+  0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,
66
+  128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,
67
+  120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,
68
+  0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,
69
+  136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,
70
+  136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,
71
+  8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,
72
+  6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,
73
+  192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,
74
+  168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,
75
+  6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,
76
+  136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,
77
+  5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,
78
+  0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64,
79
+  64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5,
80
+  5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,
81
+  136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,
82
+  6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,
83
+  0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,
84
+  64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,
85
+  3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,
86
+  6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0,
87
+  0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,80,
88
+  0,112,136,136,248,136,136,5,8,8,6,0,0,8,16,248,
89
+  128,128,240,128,248,3,8,8,6,1,0,32,64,224,64,64,
90
+  64,64,224,5,8,8,6,0,0,16,32,112,136,136,136,136,
91
+  112,5,8,8,6,0,0,32,80,112,136,136,136,136,112,5,
92
+  8,8,6,0,0,16,32,136,136,136,136,136,112,5,8,8,
93
+  6,0,0,16,32,136,136,80,32,32,32,5,8,8,6,0,
94
+  0,16,32,0,112,8,120,136,120,5,7,7,6,0,0,80,
95
+  0,112,8,120,136,120,5,8,8,6,0,0,16,32,0,112,
96
+  136,248,128,112,2,8,8,6,2,0,64,128,0,128,128,128,
97
+  128,128,5,8,8,6,0,0,16,32,0,112,136,136,136,112,
98
+  5,8,8,6,0,0,32,80,0,112,136,136,136,112,5,8,
99
+  8,6,0,0,16,32,0,136,136,136,152,104,5,9,9,6,
100
+  0,255,16,32,0,136,136,136,120,8,112,5,8,8,6,0,
101
+  0,80,32,112,136,128,128,136,112,5,8,8,6,0,0,80,
102
+  32,0,112,128,128,136,112,5,8,8,6,0,0,80,32,240,
103
+  136,136,136,136,240,6,8,8,6,0,0,4,20,24,112,144,
104
+  144,144,112,5,8,8,6,0,0,16,32,128,128,128,128,128,
105
+  248,3,8,8,6,1,0,32,64,0,192,64,64,64,224,5,
106
+  8,8,6,0,0,16,144,160,128,128,128,128,248,5,8,8,
107
+  6,1,0,8,200,80,64,64,64,64,224,5,8,8,6,0,
108
+  0,80,32,136,200,168,152,136,136,5,8,8,6,0,0,80,
109
+  32,0,176,200,136,136,136,5,8,8,6,0,0,16,32,240,
110
+  136,240,160,144,136,5,8,8,6,0,0,16,32,0,176,200,
111
+  128,128,128,5,8,8,6,0,0,80,32,120,128,128,112,8,
112
+  240,5,8,8,6,0,0,80,32,0,112,128,112,8,240,5,
113
+  8,8,6,0,0,80,32,248,32,32,32,32,32,6,8,8,
114
+  6,0,0,4,68,72,224,64,64,64,48,5,8,8,6,0,
115
+  0,80,32,248,8,48,64,128,248,5,8,8,6,0,0,80,
116
+  32,0,248,16,32,64,248,0,0,0,6,0,0,0,0,0,
117
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
118
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
119
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
120
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
121
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
122
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
123
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
124
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
125
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
126
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
127
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
128
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
129
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
130
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
131
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
132
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
133
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
134
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
135
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
136
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
137
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
138
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
139
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
140
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
141
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
142
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
143
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
144
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
145
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
146
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
147
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
148
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
149
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
150
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
151
+  0,0,6,0,0,0,0,0,6,0,0};

+ 2
- 6
Marlin/src/lcd/language/language_sk_utf8.h Ver fichero

@@ -34,12 +34,8 @@
34 34
 #ifndef LANGUAGE_SK_UTF_H
35 35
 #define LANGUAGE_SK_UTF_H
36 36
 
37
-#define MAPPER_NON
38
-#define DISPLAY_CHARSET_ISO10646_1
39
-
40
-// TBD
41
-//#define MAPPER_C3C4C5_SK
42
-//#define DISPLAY_CHARSET_ISO10646_SK
37
+#define MAPPER_C3C4C5_SK
38
+#define DISPLAY_CHARSET_ISO10646_SK
43 39
 
44 40
 #define WELCOME_MSG                         MACHINE_NAME _UxGT(" pripravená.")
45 41
 #define MSG_BACK                            _UxGT("Naspať")

+ 7
- 0
Marlin/src/lcd/ultralcd_impl_DOGM.h Ver fichero

@@ -38,6 +38,10 @@
38 38
 
39 39
 #include "../inc/MarlinConfig.h"
40 40
 
41
+/**
42
+ * Implementation of the LCD display routines for a DOGM128 graphic display.
43
+ * These are common LCD 128x64 pixel graphic displays.
44
+ */
41 45
 #include "ultralcd.h"
42 46
 
43 47
 #if ENABLED(U8GLIB_ST7565_64128N)
@@ -104,6 +108,9 @@
104 108
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_CZ)
105 109
     #include "dogm/dogm_font_data_ISO10646_CZ.h"
106 110
     #define FONT_MENU_NAME ISO10646_CZ
111
+  #elif ENABLED(DISPLAY_CHARSET_ISO10646_SK)
112
+    #include "dogm/dogm_font_data_ISO10646_SK.h"
113
+    #define FONT_MENU_NAME ISO10646_SK
107 114
   #else // fall-back
108 115
     #include "dogm/dogm_font_data_ISO10646_1.h"
109 116
     #define FONT_MENU_NAME ISO10646_1_5x7

+ 138
- 45
Marlin/src/lcd/utf_mapper.h Ver fichero

@@ -26,9 +26,9 @@
26 26
 #include "../inc/MarlinConfig.h"
27 27
 
28 28
 #if ENABLED(DOGLCD)
29
-  #define HARDWARE_CHAR_OUT u8g.print
29
+  #define HARDWARE_CHAR_OUT(C) u8g.print((char)(C))
30 30
 #else
31
-  #define HARDWARE_CHAR_OUT lcd.write
31
+  #define HARDWARE_CHAR_OUT(C) lcd.write((char)(C))
32 32
 #endif
33 33
 
34 34
 #if DISABLED(SIMULATE_ROMFONT) && ENABLED(DOGLCD)
@@ -161,9 +161,9 @@
161 161
       else if (seen_c2) {
162 162
         d &= 0x3Fu;
163 163
         #ifndef MAPPER_ONE_TO_ONE
164
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
164
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
165 165
         #else
166
-          HARDWARE_CHAR_OUT((char)(0x80u + (utf_hi_char << 6) + d)) ;
166
+          HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d);
167 167
         #endif
168 168
       }
169 169
       else {
@@ -171,7 +171,7 @@
171 171
       }
172 172
     }
173 173
     else {
174
-      HARDWARE_CHAR_OUT((char) c );
174
+      HARDWARE_CHAR_OUT(c);
175 175
     }
176 176
     seen_c2 = false;
177 177
     return 1;
@@ -203,7 +203,7 @@
203 203
           case 0xB1u: d = 0xFDu; break;
204 204
           default: d = '?';
205 205
         }
206
-        HARDWARE_CHAR_OUT((char)d) ;
206
+        HARDWARE_CHAR_OUT(d);
207 207
       }
208 208
       else if (seen_c5) {
209 209
         switch(d) {
@@ -211,14 +211,14 @@
211 211
           case 0x9Fu: d = 0xFEu; break;
212 212
           default: d = '?';
213 213
         }
214
-        HARDWARE_CHAR_OUT((char)d) ;
214
+        HARDWARE_CHAR_OUT(d);
215 215
       }
216 216
       else if (seen_c2) {
217 217
         d &= 0x3Fu;
218 218
         #ifndef MAPPER_ONE_TO_ONE
219
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
219
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
220 220
         #else
221
-          HARDWARE_CHAR_OUT((char)(0x80u + (utf_hi_char << 6) + d)) ;
221
+          HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d);
222 222
         #endif
223 223
       }
224 224
       else {
@@ -226,7 +226,7 @@
226 226
       }
227 227
     }
228 228
     else {
229
-      HARDWARE_CHAR_OUT((char) c );
229
+      HARDWARE_CHAR_OUT(c);
230 230
     }
231 231
     seen_c2 = seen_c4 = seen_c5 = false;
232 232
     return 1;
@@ -247,9 +247,9 @@
247 247
       else if (seen_ce) {
248 248
         d &= 0x3F;
249 249
         #ifndef MAPPER_ONE_TO_ONE
250
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
250
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
251 251
         #else
252
-          HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ;
252
+          HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d);
253 253
         #endif
254 254
       }
255 255
       else {
@@ -257,7 +257,7 @@
257 257
       }
258 258
     }
259 259
     else {
260
-      HARDWARE_CHAR_OUT((char)c);
260
+      HARDWARE_CHAR_OUT(c);
261 261
     }
262 262
     seen_ce = false;
263 263
     return 1;
@@ -278,9 +278,9 @@
278 278
       else if (seen_ce) {
279 279
         d &= 0x3F;
280 280
         #ifndef MAPPER_ONE_TO_ONE
281
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
281
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
282 282
         #else
283
-          HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ;
283
+          HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d);
284 284
         #endif
285 285
       }
286 286
       else {
@@ -288,7 +288,7 @@
288 288
       }
289 289
     }
290 290
     else {
291
-      HARDWARE_CHAR_OUT((char) c );
291
+      HARDWARE_CHAR_OUT(c);
292 292
     }
293 293
     seen_ce = false;
294 294
     return 1;
@@ -311,13 +311,13 @@
311 311
       else if (seen_d5) {
312 312
         d &= 0x3F;
313 313
         if (!utf_hi_char && d == 1) {
314
-          HARDWARE_CHAR_OUT((char) 0xA2); // Ё
314
+          HARDWARE_CHAR_OUT(0xA2); // Ё
315 315
         }
316 316
         else if (utf_hi_char == 1 && d == 0x11) {
317
-          HARDWARE_CHAR_OUT((char)0xB5); // ё
317
+          HARDWARE_CHAR_OUT(0xB5); // ё
318 318
         }
319 319
         else {
320
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x10));
320
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x10));
321 321
         }
322 322
       }
323 323
       else {
@@ -325,7 +325,7 @@
325 325
       }
326 326
     }
327 327
     else {
328
-      HARDWARE_CHAR_OUT((char) c );
328
+      HARDWARE_CHAR_OUT(c);
329 329
     }
330 330
     seen_d5 = false;
331 331
     return 1;
@@ -346,9 +346,9 @@
346 346
       else if (seen_d5) {
347 347
         d &= 0x3Fu;
348 348
         #ifndef MAPPER_ONE_TO_ONE
349
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
349
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
350 350
         #else
351
-          HARDWARE_CHAR_OUT((char)(0xA0u + (utf_hi_char << 6) + d)) ;
351
+          HARDWARE_CHAR_OUT(0xA0u + (utf_hi_char << 6) + d);
352 352
         #endif
353 353
       }
354 354
       else {
@@ -356,7 +356,7 @@
356 356
       }
357 357
     }
358 358
     else {
359
-      HARDWARE_CHAR_OUT((char) c );
359
+      HARDWARE_CHAR_OUT(c);
360 360
     }
361 361
     seen_d5 = false;
362 362
     return 1;
@@ -382,18 +382,17 @@
382 382
       else if (seen_e3 && seen_82_83) {
383 383
         d &= 0x3F;
384 384
         #ifndef MAPPER_ONE_TO_ONE
385
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
385
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
386 386
         #else
387
-          HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ;
387
+          HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d);
388 388
         #endif
389 389
       }
390
-      else {
391
-        HARDWARE_CHAR_OUT((char) '?' );
392
-      }
393
-    }
394
-    else {
395
-      HARDWARE_CHAR_OUT((char) c );
390
+      else
391
+        HARDWARE_CHAR_OUT('?');
396 392
     }
393
+    else
394
+      HARDWARE_CHAR_OUT(c);
395
+
397 396
     seen_e3 = false;
398 397
     seen_82_83 = false;
399 398
     return 1;
@@ -437,7 +436,7 @@
437 436
           case 0x98u ... 0x99u: d -= 20; break; //Ę i ę
438 437
           default: d = '?';
439 438
         }
440
-        HARDWARE_CHAR_OUT((char)d) ;
439
+        HARDWARE_CHAR_OUT(d);
441 440
       }
442 441
       else if (seen_c5) {
443 442
         switch(d) {
@@ -446,7 +445,7 @@
446 445
           case 0xB9u ... 0xBCu: d -= 0x2Bu; break; //Ź - ż
447 446
           default: d = '?';
448 447
         }
449
-        HARDWARE_CHAR_OUT((char)d) ;
448
+        HARDWARE_CHAR_OUT(d);
450 449
       }
451 450
       else if (seen_c3) {
452 451
         switch(d) {
@@ -454,13 +453,13 @@
454 453
           case 0xB3u: d = 0x8Bu; break; //ó
455 454
           d = '?';
456 455
         }
457
-        HARDWARE_CHAR_OUT((char)d) ;
456
+        HARDWARE_CHAR_OUT(d);
458 457
       }
459 458
 
460 459
     }
461
-    else {
462
-      HARDWARE_CHAR_OUT((char) c );
463
-    }
460
+    else
461
+      HARDWARE_CHAR_OUT(c);
462
+
464 463
     seen_c3 = seen_c4 = seen_c5 = false;
465 464
     return 1;
466 465
   }
@@ -515,7 +514,7 @@
515 514
           case 0x9Au ... 0x9Bu: d -= 10; break; // Ěě
516 515
           default: d = '?';
517 516
         }
518
-        HARDWARE_CHAR_OUT((char)d) ;
517
+        HARDWARE_CHAR_OUT(d);
519 518
       }
520 519
       else if (seen_c5) {
521 520
         switch(d) {
@@ -527,7 +526,7 @@
527 526
           case 0xBDu ... 0xBEu: d -= 0x21u; break;  // Žž
528 527
           default: d = '?';
529 528
         }
530
-        HARDWARE_CHAR_OUT((char)d) ;
529
+        HARDWARE_CHAR_OUT(d);
531 530
       }
532 531
       else if (seen_c3) {
533 532
         switch(d) {
@@ -545,21 +544,115 @@
545 544
           case 0xBDu: d = 0x8Bu; break;  // ý
546 545
           default: d = '?';
547 546
         }
548
-        HARDWARE_CHAR_OUT((char)d) ;
547
+        HARDWARE_CHAR_OUT(d);
549 548
       }
550 549
 
551 550
     }
552
-    else {
553
-      HARDWARE_CHAR_OUT((char) c );
554
-    }
551
+    else
552
+      HARDWARE_CHAR_OUT(c);
553
+
555 554
     seen_c3 = seen_c4 = seen_c5 = false;
556 555
     return 1;
557 556
   }
558 557
 
559 558
 #elif ENABLED(MAPPER_C3C4C5_SK)
560 559
 
561
-  // TBD
562
-  #error "No mapping for Slovak at this time. Use MAPPER_NON."
560
+  /**
561
+   * Á C3 81 = 80
562
+   * Ä C3 84 = 81
563
+   * É C3 89 = 82
564
+   * Í C3 8D = 83
565
+   * Ó C3 93 = 84
566
+   * Ô C3 94 = 85
567
+   * Ú C3 9A = 86
568
+   * Ý C3 9D = 87
569
+   * á C3 A1 = 88
570
+   * ä C3 A4 = 89
571
+   * é C3 A9 = 8A
572
+   * í C3 AD = 8B
573
+   * ó C3 B3 = 8C
574
+   * ô C3 B4 = 8D
575
+   * ú C3 BA = 8E
576
+   * ý C3 BD = 8F
577
+   * Č C4 8C = 90
578
+   * č C4 8D = 91
579
+   * Ď C4 8E = 92
580
+   * ď C4 8F = 93
581
+   * Ĺ C4 B9 = 94
582
+   * ĺ C4 BA = 95
583
+   * Ľ C4 BD = 96
584
+   * ľ C4 BE = 97
585
+   * Ň C5 87 = 98
586
+   * ň C5 88 = 99
587
+   * Ŕ C5 94 = 9A
588
+   * ŕ C5 95 = 9B
589
+   * Š C5 A0 = 9C
590
+   * š C5 A1 = 9D
591
+   * Ť C5 A4 = 9E
592
+   * ť C5 A5 = 9F
593
+   * Ž C5 BD = A0
594
+   * ž C5 BE = A1
595
+   */
596
+
597
+  char charset_mapper(const char c) {
598
+    static bool seen_c3 = false,
599
+                seen_c4 = false,
600
+                seen_c5 = false;
601
+    uint8_t d = c;
602
+    if (d >= 0x80u) { // UTF-8 handling
603
+           if (d == 0xC4u) { seen_c4 = true; return 0; }
604
+      else if (d == 0xC5u) { seen_c5 = true; return 0; }
605
+      else if (d == 0xC3u) { seen_c3 = true; return 0; }
606
+      else if (seen_c4) {
607
+        switch(d) {
608
+          case 0x8Cu ... 0x8Fu: d += 0x04u; break;  // ČčĎď
609
+          case 0xB9u ... 0xBAu: d -= 0x25u; break;  // Ĺĺ
610
+          case 0xBDu ... 0xBEu: d -= 0x27u; break;  // Ľľ
611
+          default: d = '?';
612
+        }
613
+        HARDWARE_CHAR_OUT(d);
614
+      }
615
+      else if (seen_c5) {
616
+        switch(d) {
617
+          case 0x87u ... 0x88u: d += 0x11u; break;  // Ňň
618
+          case 0x94u ... 0x95u: d += 0x06u; break;  // Ŕŕ
619
+          case 0xA0u ... 0xA1u: d -= 0x04u; break;  // Šš
620
+          case 0xA4u ... 0xA5u: d -= 0x06u; break;  // Ťť
621
+          case 0xBDu ... 0xBEu: d -= 0x1Du; break;  // Žž
622
+          default: d = '?';
623
+        }
624
+        HARDWARE_CHAR_OUT(d);
625
+      }
626
+      else if (seen_c3) {
627
+        switch(d) {
628
+          case 0x81u: d = 0x80u; break;  // Á
629
+          case 0x84u: d = 0x81u; break;  // Ä
630
+          case 0x89u: d = 0x82u; break;  // É
631
+          case 0x8Du: d = 0x83u; break;  // Í
632
+          case 0x93u: d = 0x84u; break;  // Ó
633
+          case 0x94u: d = 0x85u; break;  // Ô
634
+          case 0x9Au: d = 0x86u; break;  // Ú
635
+          case 0x9Du: d = 0x87u; break;  // Ý
636
+          case 0xA1u: d = 0x88u; break;  // á
637
+          case 0xA4u: d = 0x89u; break;  // ä
638
+          case 0xA9u: d = 0x8Au; break;  // é
639
+          case 0xADu: d = 0x8Bu; break;  // í
640
+          case 0xB3u: d = 0x8Cu; break;  // ó
641
+          case 0xB4u: d = 0x8Du; break;  // ô
642
+          case 0xBAu: d = 0x8Eu; break;  // ú
643
+          case 0xBDu: d = 0x8Fu; break;  // ý
644
+          default: d = '?';
645
+        }
646
+        HARDWARE_CHAR_OUT(d);
647
+      }
648
+
649
+    }
650
+    else
651
+      HARDWARE_CHAR_OUT(c);
652
+
653
+    seen_c3 = seen_c4 = seen_c5 = false;
654
+    return 1;
655
+  }
563 656
 
564 657
 #else
565 658
 

BIN
buildroot/share/fonts/ISO10646_SK.fon Ver fichero


Loading…
Cancelar
Guardar