From c0382cd8cd4985ad11e12fff709e6091171cbbaa Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Fri, 6 Oct 2017 14:51:39 -0500
Subject: [PATCH 1/2] Add UTF-8 mapper for Slovak language

Based on #7862, #7846 by @rmoravcik
---
 .../src/lcd/dogm/dogm_font_data_ISO10646_SK.h | 151 +++++++++++++++
 Marlin/src/lcd/language/language_sk_utf8.h    |   8 +-
 Marlin/src/lcd/ultralcd_impl_DOGM.h           |   7 +
 Marlin/src/lcd/utf_mapper.h                   | 183 +++++++++++++-----
 buildroot/share/fonts/ISO10646_SK.fon         | Bin 0 -> 4224 bytes
 5 files changed, 298 insertions(+), 51 deletions(-)
 create mode 100644 Marlin/src/lcd/dogm/dogm_font_data_ISO10646_SK.h
 create mode 100644 buildroot/share/fonts/ISO10646_SK.fon

diff --git a/Marlin/src/lcd/dogm/dogm_font_data_ISO10646_SK.h b/Marlin/src/lcd/dogm/dogm_font_data_ISO10646_SK.h
new file mode 100644
index 000000000..7a460858d
--- /dev/null
+++ b/Marlin/src/lcd/dogm/dogm_font_data_ISO10646_SK.h
@@ -0,0 +1,151 @@
+/*
+  Fontname: ISO10646_SK
+  Copyright: A. Hardtung, modified by Roman Moravcik
+  Capital A Height: 7, '1' Height: 7
+  Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9
+  Font Bounding box     w= 6 h= 9 x= 0 y=-2
+  Calculated Min Values           x= 0 y=-1 dx= 0 dy= 0
+  Pure Font   ascent = 7 descent=-1
+  X Font      ascent = 7 descent=-1
+  Max Font    ascent = 8 descent=-1
+*/
+#include <U8glib.h>
+const u8g_fntpgm_uint8_t ISO10646_SK[2203] U8G_SECTION(".progmem.ISO10646_SK") = {
+  0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7,
+  255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
+  128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
+  0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
+  120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
+  64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
+  2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
+  64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
+  32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
+  5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
+  64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
+  192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
+  0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64,
+  192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
+  128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
+  5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
+  6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
+  112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
+  32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
+  112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5,
+  5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
+  192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
+  32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
+  0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
+  8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168,
+  168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,
+  7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,
+  0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240,
+  136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240,
+  128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,
+  5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,
+  6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,
+  128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,
+  16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,
+  136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,
+  7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,
+  0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,
+  136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,
+  128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,
+  7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,
+  0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,
+  32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,
+  136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,
+  5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,
+  6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
+  136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,
+  32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,
+  224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
+  1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,
+  80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,
+  64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,
+  0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,
+  128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,
+  120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,
+  0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,
+  136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,
+  136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,
+  8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,
+  6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,
+  192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,
+  168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,
+  6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,
+  136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,
+  5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,
+  0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64,
+  64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5,
+  5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,
+  136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,
+  6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,
+  0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,
+  64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,
+  3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,
+  6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0,
+  0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,80,
+  0,112,136,136,248,136,136,5,8,8,6,0,0,8,16,248,
+  128,128,240,128,248,3,8,8,6,1,0,32,64,224,64,64,
+  64,64,224,5,8,8,6,0,0,16,32,112,136,136,136,136,
+  112,5,8,8,6,0,0,32,80,112,136,136,136,136,112,5,
+  8,8,6,0,0,16,32,136,136,136,136,136,112,5,8,8,
+  6,0,0,16,32,136,136,80,32,32,32,5,8,8,6,0,
+  0,16,32,0,112,8,120,136,120,5,7,7,6,0,0,80,
+  0,112,8,120,136,120,5,8,8,6,0,0,16,32,0,112,
+  136,248,128,112,2,8,8,6,2,0,64,128,0,128,128,128,
+  128,128,5,8,8,6,0,0,16,32,0,112,136,136,136,112,
+  5,8,8,6,0,0,32,80,0,112,136,136,136,112,5,8,
+  8,6,0,0,16,32,0,136,136,136,152,104,5,9,9,6,
+  0,255,16,32,0,136,136,136,120,8,112,5,8,8,6,0,
+  0,80,32,112,136,128,128,136,112,5,8,8,6,0,0,80,
+  32,0,112,128,128,136,112,5,8,8,6,0,0,80,32,240,
+  136,136,136,136,240,6,8,8,6,0,0,4,20,24,112,144,
+  144,144,112,5,8,8,6,0,0,16,32,128,128,128,128,128,
+  248,3,8,8,6,1,0,32,64,0,192,64,64,64,224,5,
+  8,8,6,0,0,16,144,160,128,128,128,128,248,5,8,8,
+  6,1,0,8,200,80,64,64,64,64,224,5,8,8,6,0,
+  0,80,32,136,200,168,152,136,136,5,8,8,6,0,0,80,
+  32,0,176,200,136,136,136,5,8,8,6,0,0,16,32,240,
+  136,240,160,144,136,5,8,8,6,0,0,16,32,0,176,200,
+  128,128,128,5,8,8,6,0,0,80,32,120,128,128,112,8,
+  240,5,8,8,6,0,0,80,32,0,112,128,112,8,240,5,
+  8,8,6,0,0,80,32,248,32,32,32,32,32,6,8,8,
+  6,0,0,4,68,72,224,64,64,64,48,5,8,8,6,0,
+  0,80,32,248,8,48,64,128,248,5,8,8,6,0,0,80,
+  32,0,248,16,32,64,248,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
+  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
+  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
+  0,0,6,0,0,0,0,0,6,0,0};
diff --git a/Marlin/src/lcd/language/language_sk_utf8.h b/Marlin/src/lcd/language/language_sk_utf8.h
index afd815878..d7157ca41 100644
--- a/Marlin/src/lcd/language/language_sk_utf8.h
+++ b/Marlin/src/lcd/language/language_sk_utf8.h
@@ -34,12 +34,8 @@
 #ifndef LANGUAGE_SK_UTF_H
 #define LANGUAGE_SK_UTF_H
 
-#define MAPPER_NON
-#define DISPLAY_CHARSET_ISO10646_1
-
-// TBD
-//#define MAPPER_C3C4C5_SK
-//#define DISPLAY_CHARSET_ISO10646_SK
+#define MAPPER_C3C4C5_SK
+#define DISPLAY_CHARSET_ISO10646_SK
 
 #define WELCOME_MSG                         MACHINE_NAME _UxGT(" pripravená.")
 #define MSG_BACK                            _UxGT("Naspať")
diff --git a/Marlin/src/lcd/ultralcd_impl_DOGM.h b/Marlin/src/lcd/ultralcd_impl_DOGM.h
index b9590531a..159e493e9 100644
--- a/Marlin/src/lcd/ultralcd_impl_DOGM.h
+++ b/Marlin/src/lcd/ultralcd_impl_DOGM.h
@@ -38,6 +38,10 @@
 
 #include "../inc/MarlinConfig.h"
 
+/**
+ * Implementation of the LCD display routines for a DOGM128 graphic display.
+ * These are common LCD 128x64 pixel graphic displays.
+ */
 #include "ultralcd.h"
 
 #if ENABLED(U8GLIB_ST7565_64128N)
@@ -104,6 +108,9 @@
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_CZ)
     #include "dogm/dogm_font_data_ISO10646_CZ.h"
     #define FONT_MENU_NAME ISO10646_CZ
+  #elif ENABLED(DISPLAY_CHARSET_ISO10646_SK)
+    #include "dogm/dogm_font_data_ISO10646_SK.h"
+    #define FONT_MENU_NAME ISO10646_SK
   #else // fall-back
     #include "dogm/dogm_font_data_ISO10646_1.h"
     #define FONT_MENU_NAME ISO10646_1_5x7
diff --git a/Marlin/src/lcd/utf_mapper.h b/Marlin/src/lcd/utf_mapper.h
index 910d7a0d0..71f550402 100644
--- a/Marlin/src/lcd/utf_mapper.h
+++ b/Marlin/src/lcd/utf_mapper.h
@@ -26,9 +26,9 @@
 #include "../inc/MarlinConfig.h"
 
 #if ENABLED(DOGLCD)
-  #define HARDWARE_CHAR_OUT u8g.print
+  #define HARDWARE_CHAR_OUT(C) u8g.print((char)(C))
 #else
-  #define HARDWARE_CHAR_OUT lcd.write
+  #define HARDWARE_CHAR_OUT(C) lcd.write((char)(C))
 #endif
 
 #if DISABLED(SIMULATE_ROMFONT) && ENABLED(DOGLCD)
@@ -161,9 +161,9 @@
       else if (seen_c2) {
         d &= 0x3Fu;
         #ifndef MAPPER_ONE_TO_ONE
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
         #else
-          HARDWARE_CHAR_OUT((char)(0x80u + (utf_hi_char << 6) + d)) ;
+          HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d);
         #endif
       }
       else {
@@ -171,7 +171,7 @@
       }
     }
     else {
-      HARDWARE_CHAR_OUT((char) c );
+      HARDWARE_CHAR_OUT(c);
     }
     seen_c2 = false;
     return 1;
@@ -203,7 +203,7 @@
           case 0xB1u: d = 0xFDu; break;
           default: d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
       else if (seen_c5) {
         switch(d) {
@@ -211,14 +211,14 @@
           case 0x9Fu: d = 0xFEu; break;
           default: d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
       else if (seen_c2) {
         d &= 0x3Fu;
         #ifndef MAPPER_ONE_TO_ONE
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
         #else
-          HARDWARE_CHAR_OUT((char)(0x80u + (utf_hi_char << 6) + d)) ;
+          HARDWARE_CHAR_OUT(0x80u + (utf_hi_char << 6) + d);
         #endif
       }
       else {
@@ -226,7 +226,7 @@
       }
     }
     else {
-      HARDWARE_CHAR_OUT((char) c );
+      HARDWARE_CHAR_OUT(c);
     }
     seen_c2 = seen_c4 = seen_c5 = false;
     return 1;
@@ -247,9 +247,9 @@
       else if (seen_ce) {
         d &= 0x3F;
         #ifndef MAPPER_ONE_TO_ONE
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
         #else
-          HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ;
+          HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d);
         #endif
       }
       else {
@@ -257,7 +257,7 @@
       }
     }
     else {
-      HARDWARE_CHAR_OUT((char)c);
+      HARDWARE_CHAR_OUT(c);
     }
     seen_ce = false;
     return 1;
@@ -278,9 +278,9 @@
       else if (seen_ce) {
         d &= 0x3F;
         #ifndef MAPPER_ONE_TO_ONE
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
         #else
-          HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ;
+          HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d);
         #endif
       }
       else {
@@ -288,7 +288,7 @@
       }
     }
     else {
-      HARDWARE_CHAR_OUT((char) c );
+      HARDWARE_CHAR_OUT(c);
     }
     seen_ce = false;
     return 1;
@@ -311,13 +311,13 @@
       else if (seen_d5) {
         d &= 0x3F;
         if (!utf_hi_char && d == 1) {
-          HARDWARE_CHAR_OUT((char) 0xA2); // Ё
+          HARDWARE_CHAR_OUT(0xA2); // Ё
         }
         else if (utf_hi_char == 1 && d == 0x11) {
-          HARDWARE_CHAR_OUT((char)0xB5); // ё
+          HARDWARE_CHAR_OUT(0xB5); // ё
         }
         else {
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x10));
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x10));
         }
       }
       else {
@@ -325,7 +325,7 @@
       }
     }
     else {
-      HARDWARE_CHAR_OUT((char) c );
+      HARDWARE_CHAR_OUT(c);
     }
     seen_d5 = false;
     return 1;
@@ -346,9 +346,9 @@
       else if (seen_d5) {
         d &= 0x3Fu;
         #ifndef MAPPER_ONE_TO_ONE
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
         #else
-          HARDWARE_CHAR_OUT((char)(0xA0u + (utf_hi_char << 6) + d)) ;
+          HARDWARE_CHAR_OUT(0xA0u + (utf_hi_char << 6) + d);
         #endif
       }
       else {
@@ -356,7 +356,7 @@
       }
     }
     else {
-      HARDWARE_CHAR_OUT((char) c );
+      HARDWARE_CHAR_OUT(c);
     }
     seen_d5 = false;
     return 1;
@@ -382,18 +382,17 @@
       else if (seen_e3 && seen_82_83) {
         d &= 0x3F;
         #ifndef MAPPER_ONE_TO_ONE
-          HARDWARE_CHAR_OUT((char)pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
+          HARDWARE_CHAR_OUT(pgm_read_byte_near(utf_recode + d + (utf_hi_char << 6) - 0x20));
         #else
-          HARDWARE_CHAR_OUT((char)(0x80 + (utf_hi_char << 6) + d)) ;
+          HARDWARE_CHAR_OUT(0x80 + (utf_hi_char << 6) + d);
         #endif
       }
-      else {
-        HARDWARE_CHAR_OUT((char) '?' );
-      }
-    }
-    else {
-      HARDWARE_CHAR_OUT((char) c );
+      else
+        HARDWARE_CHAR_OUT('?');
     }
+    else
+      HARDWARE_CHAR_OUT(c);
+
     seen_e3 = false;
     seen_82_83 = false;
     return 1;
@@ -437,7 +436,7 @@
           case 0x98u ... 0x99u: d -= 20; break; //Ę i ę
           default: d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
       else if (seen_c5) {
         switch(d) {
@@ -446,7 +445,7 @@
           case 0xB9u ... 0xBCu: d -= 0x2Bu; break; //Ź - ż
           default: d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
       else if (seen_c3) {
         switch(d) {
@@ -454,13 +453,13 @@
           case 0xB3u: d = 0x8Bu; break; //ó
           d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
 
     }
-    else {
-      HARDWARE_CHAR_OUT((char) c );
-    }
+    else
+      HARDWARE_CHAR_OUT(c);
+
     seen_c3 = seen_c4 = seen_c5 = false;
     return 1;
   }
@@ -515,7 +514,7 @@
           case 0x9Au ... 0x9Bu: d -= 10; break; // Ěě
           default: d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
       else if (seen_c5) {
         switch(d) {
@@ -527,7 +526,7 @@
           case 0xBDu ... 0xBEu: d -= 0x21u; break;  // Žž
           default: d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
       else if (seen_c3) {
         switch(d) {
@@ -545,21 +544,115 @@
           case 0xBDu: d = 0x8Bu; break;  // ý
           default: d = '?';
         }
-        HARDWARE_CHAR_OUT((char)d) ;
+        HARDWARE_CHAR_OUT(d);
       }
 
     }
-    else {
-      HARDWARE_CHAR_OUT((char) c );
-    }
+    else
+      HARDWARE_CHAR_OUT(c);
+
     seen_c3 = seen_c4 = seen_c5 = false;
     return 1;
   }
 
 #elif ENABLED(MAPPER_C3C4C5_SK)
 
-  // TBD
-  #error "No mapping for Slovak at this time. Use MAPPER_NON."
+  /**
+   * Á C3 81 = 80
+   * Ä C3 84 = 81
+   * É C3 89 = 82
+   * Í C3 8D = 83
+   * Ó C3 93 = 84
+   * Ô C3 94 = 85
+   * Ú C3 9A = 86
+   * Ý C3 9D = 87
+   * á C3 A1 = 88
+   * ä C3 A4 = 89
+   * é C3 A9 = 8A
+   * í C3 AD = 8B
+   * ó C3 B3 = 8C
+   * ô C3 B4 = 8D
+   * ú C3 BA = 8E
+   * ý C3 BD = 8F
+   * Č C4 8C = 90
+   * č C4 8D = 91
+   * Ď C4 8E = 92
+   * ď C4 8F = 93
+   * Ĺ C4 B9 = 94
+   * ĺ C4 BA = 95
+   * Ľ C4 BD = 96
+   * ľ C4 BE = 97
+   * Ň C5 87 = 98
+   * ň C5 88 = 99
+   * Ŕ C5 94 = 9A
+   * ŕ C5 95 = 9B
+   * Š C5 A0 = 9C
+   * š C5 A1 = 9D
+   * Ť C5 A4 = 9E
+   * ť C5 A5 = 9F
+   * Ž C5 BD = A0
+   * ž C5 BE = A1
+   */
+
+  char charset_mapper(const char c) {
+    static bool seen_c3 = false,
+                seen_c4 = false,
+                seen_c5 = false;
+    uint8_t d = c;
+    if (d >= 0x80u) { // UTF-8 handling
+           if (d == 0xC4u) { seen_c4 = true; return 0; }
+      else if (d == 0xC5u) { seen_c5 = true; return 0; }
+      else if (d == 0xC3u) { seen_c3 = true; return 0; }
+      else if (seen_c4) {
+        switch(d) {
+          case 0x8Cu ... 0x8Fu: d += 0x04u; break;  // ČčĎď
+          case 0xB9u ... 0xBAu: d -= 0x25u; break;  // Ĺĺ
+          case 0xBDu ... 0xBEu: d -= 0x27u; break;  // Ľľ
+          default: d = '?';
+        }
+        HARDWARE_CHAR_OUT(d);
+      }
+      else if (seen_c5) {
+        switch(d) {
+          case 0x87u ... 0x88u: d += 0x11u; break;  // Ňň
+          case 0x94u ... 0x95u: d += 0x06u; break;  // Ŕŕ
+          case 0xA0u ... 0xA1u: d -= 0x04u; break;  // Šš
+          case 0xA4u ... 0xA5u: d -= 0x06u; break;  // Ťť
+          case 0xBDu ... 0xBEu: d -= 0x1Du; break;  // Žž
+          default: d = '?';
+        }
+        HARDWARE_CHAR_OUT(d);
+      }
+      else if (seen_c3) {
+        switch(d) {
+          case 0x81u: d = 0x80u; break;  // Á
+          case 0x84u: d = 0x81u; break;  // Ä
+          case 0x89u: d = 0x82u; break;  // É
+          case 0x8Du: d = 0x83u; break;  // Í
+          case 0x93u: d = 0x84u; break;  // Ó
+          case 0x94u: d = 0x85u; break;  // Ô
+          case 0x9Au: d = 0x86u; break;  // Ú
+          case 0x9Du: d = 0x87u; break;  // Ý
+          case 0xA1u: d = 0x88u; break;  // á
+          case 0xA4u: d = 0x89u; break;  // ä
+          case 0xA9u: d = 0x8Au; break;  // é
+          case 0xADu: d = 0x8Bu; break;  // í
+          case 0xB3u: d = 0x8Cu; break;  // ó
+          case 0xB4u: d = 0x8Du; break;  // ô
+          case 0xBAu: d = 0x8Eu; break;  // ú
+          case 0xBDu: d = 0x8Fu; break;  // ý
+          default: d = '?';
+        }
+        HARDWARE_CHAR_OUT(d);
+      }
+
+    }
+    else
+      HARDWARE_CHAR_OUT(c);
+
+    seen_c3 = seen_c4 = seen_c5 = false;
+    return 1;
+  }
 
 #else
 
diff --git a/buildroot/share/fonts/ISO10646_SK.fon b/buildroot/share/fonts/ISO10646_SK.fon
new file mode 100644
index 0000000000000000000000000000000000000000..76bfcc9e1751f754759c1630e13a326ee626849c
GIT binary patch
literal 4224
zcmeIze`r%z6u|LYt?}u!yp1A7oV$uhky=ub;zZ<4RI2#nQHvWQl4`7po6TEVT_z$A
zrxJ!pkRe561Q7`$qYRNEB4x-ZGDSp&3=t6#*+eoK5=7?C`M#GyH}KEFz?=HX$^Cim
zeK&FamfuZ-F{V-ey?$-Xh`ej@@XdtM-1NcaCUbGhjX5I?>u${H$z%s?kk9SP_wKRz
zouBW`=64R*_1PWy+(52x(0-ilPv^cEXrDfHUOe@NRg;z-Ap>Kaul~K>0?EWPgXW05
z5}GKPPH^I$6C2IskZRLxrWk)(8x2le_rCefBxf~*QSZsCH*V-zxu$#inoS!!lAVh?
z7j`Th_*C2GYfJa4O|~PMZ2PcN{_Ijau9w}{(VmQ^8E1p$KJjdmF(0+tuHJllaBu&v
zHoGU6&h}+@rtS7GZFg=@Z@*oi%lGcvk!87YGejR8lag0`Tc*^|kT6q?Nyy8-Hnu{q
zJCov(<5C+x+kc(QBhBgE@j3kCQ^IJcgn5QFoRH9(X*dHdF2KdO9J{a^w_+a#xE~MW
zaU8-kcmXfrC|<`qcpsnOb9{w~$(oysGjSfa;}Tqf>u@usa5oO(K`i14JdNjY7%$^B
zyoq=5AwI<ysFy?T1UBPrY{f;m3|FI%TQH6NSinPg3{PSi&*MeBieq>i@8M&t;!A9t
zqPaC;3(mzh>_iXOVh?V^4Ce6w9>o%#!n61tj^GdY6aI`3@K^i;|3rtc(R(-x=VKC=
z;!50rpWt@<4EJG(U*k9UEmrV*yn;XCE&K%^;WMn^gm<|AI0G#%z{R*6yRaL#Vjl*$
z9}nYk9Kthr0WaYwUdKClAD`fJe1(Z=+<%;j^ROM4;0j!an=ysEaS#t;5l`T0Jcq-0
z8L#0@yo(R<DZW56o%@f?I2&7W5iY~k=;IblV?P$~5FW#mSjO{s5wGGH-o|_Q7_0aa
z8|C+3?mxERTx`Qm^l&Zq;5N))9uMGAEa55f4ZrqQi?Q;9>-+UzUEi<COF!B|IcTkF
z>*$zky`dI~Ql+w2DP=UWo~T9IJkPokiLQLoN?QpkRs&;gO%|z_q#MPxdWF0v`LEHD
zk)hTGMJ<6uHl+z_6cn8x40TY=wXWk-C32H~sph&`7gimI5z?s|jjhRiQlwSp)4wPx
zIF3dv8m+6#la;O??L%gimlpY~c}XN0Na{9<GL=d^Urkb#I$2czXbr=V)ucj-*3~4d
zID4Wn>NgT)C7t3~G+`;yx<n4rEu|zXmdc~$lCB~1O3}QEcPl!zM#Ztp5Rq(Aie{yW
zNJojZE_zy87tK-#!yr08c`Wg23}q~lZ)Ge|#V7KuAFo#Qqx|%AJ#q=;;d`F0YxMLS
z4Fb*H)jAod6@M4ao~shq1Wut?kT?v7$D*^6(ee2?PDZw-t-6z1sPiSe9_VsfrMoLQ
zQW=fab>#WPJ93R?pc@H84p3TCG?J;gRgoff#^}0Hj(S>AtDY7IXbQT96ZMPERPzhC
zf1angB$-8q4rS^Q=cgxF;rt}h1FW}_Gxylj(~w*0S&oGCc=}o))r>HiQuJQewUVe@
z82Qrb5fC{pS4`%UR-H%oK|gk6echVw&9xfTqv%=6t*$=>nJ{`DS{I$TL^_|<vAUd&
zwJaRXqW461F0B&j-h9a~dV;=;s7F<4)$c-Mb4ySvmB>X7l>01WQ?i8CmCA8lW4cwB
zl{(+n@3_ntKP}f*<NGXQhsR`$_Ty^H8m!AR^7Xezimbbmo0HVmnv>-2N<aBE;VIM)
Q_wD=J6L@<9|C<x|3rpT23;+NC

literal 0
HcmV?d00001


From 9fe7f53216e85c1282004378ac70864d49757d43 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Fri, 6 Oct 2017 15:13:43 -0500
Subject: [PATCH 2/2] Misc general spacing cleanup

---
 Marlin/Configuration.h                            | 2 +-
 Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp           | 2 +-
 Marlin/src/HAL/HAL_AVR/MarlinSerial.h             | 8 ++++----
 Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h          | 2 +-
 Marlin/src/HAL/persistent_store_api.h             | 2 +-
 frameworks/CMSIS/LPC1768/driver/lpc17xx_systick.c | 4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 25a257154..9c566cb3c 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -1238,7 +1238,7 @@
  * Enable one of the following items for a slower SPI transfer speed.
  * This may be required to resolve "volume init" errors or LCD issues.
  */
- 
+
 //#define SPI_SPEED SPI_HALF_SPEED
 //#define SPI_SPEED SPI_QUARTER_SPEED
 //#define SPI_SPEED SPI_EIGHTH_SPEED
diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
index bb0061270..dbd3f61d0 100644
--- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
+++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
@@ -496,7 +496,7 @@
     }
 
     void MarlinSerial::writeNoHandshake(const uint8_t c) {
-      while (!TEST(M_UCSRxA, M_UDREx)) ;
+      while (!TEST(M_UCSRxA, M_UDREx)) { /* nada */ }
       M_UDRx = c;
     }
 
diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h
index ef4f165e0..a909ad98d 100644
--- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h
+++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h
@@ -107,15 +107,15 @@
   #else
     typedef uint8_t ring_buffer_pos_t;
   #endif
-  
+
   #if ENABLED(SERIAL_STATS_DROPPED_RX)
     extern uint8_t rx_dropped_bytes;
   #endif
 
   #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
     extern ring_buffer_pos_t rx_max_enqueued;
-  #endif  
-  
+  #endif
+
   class MarlinSerial { //: public Stream
 
     public:
@@ -140,7 +140,7 @@
 
       #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
         FORCE_INLINE static ring_buffer_pos_t rxMaxEnqueued() { return rx_max_enqueued; }
-      #endif  
+      #endif
 
       static FORCE_INLINE void write(const char* str) { while (*str) write(*str++); }
       static FORCE_INLINE void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); }
diff --git a/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h b/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h
index da48649f5..3ab47f888 100644
--- a/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h
+++ b/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h
@@ -431,7 +431,7 @@ HAL_PWM_LPC1768_ISR {
     ISR_table = active_table;                    // MR0 means new values could have been loaded so set everything
     if (PWM_table_swap) LPC_PWM1->MCR = LPC1768_PWM_interrupt_mask; // enable new PWM individual channel interrupts
 
-    for (uint8_t i = 0; (i < NUM_PWMS) ; i++) {
+    for (uint8_t i = 0; i < NUM_PWMS; i++) {
       if(ISR_table[i].active_flag && !((ISR_table[i].logical_pin ==  11) ||
                                        (ISR_table[i].logical_pin ==  4) ||
                                        (ISR_table[i].logical_pin ==  6)))
diff --git a/Marlin/src/HAL/persistent_store_api.h b/Marlin/src/HAL/persistent_store_api.h
index 71bd01bc7..1d88d38f0 100644
--- a/Marlin/src/HAL/persistent_store_api.h
+++ b/Marlin/src/HAL/persistent_store_api.h
@@ -10,7 +10,7 @@ namespace PersistentStore {
 bool access_start();
 bool access_finish();
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc);
-void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) ;
+void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc);
 
 } // PersistentStore
 } // HAL
diff --git a/frameworks/CMSIS/LPC1768/driver/lpc17xx_systick.c b/frameworks/CMSIS/LPC1768/driver/lpc17xx_systick.c
index 528919754..bc10c1c6d 100644
--- a/frameworks/CMSIS/LPC1768/driver/lpc17xx_systick.c
+++ b/frameworks/CMSIS/LPC1768/driver/lpc17xx_systick.c
@@ -73,7 +73,7 @@ void SYSTICK_InternalInit(uint32_t time)
 	 * 1/SystemCoreClock * (2^24) * 1000 (ms)
 	 */
 	//check time value is available or not
-	maxtime = (1<<24)/(SystemCoreClock / 1000) ;
+	maxtime = (1<<24)/(SystemCoreClock / 1000);
 	if(time > maxtime)
 		//Error loop
 		while(1);
@@ -105,7 +105,7 @@ void SYSTICK_ExternalInit(uint32_t freq, uint32_t time)
 	 * 1/freq * (2^24) * 1000 (ms)
 	 */
 	//check time value is available or not
-	maxtime = (1<<24)/(freq / 1000) ;
+	maxtime = (1<<24)/(freq / 1000);
 	if (time>maxtime)
 		//Error Loop
 		while(1);