From 4beffbca691dd2159035f1dad40d0180be62d731 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Tue, 24 Mar 2015 23:40:04 +0100 Subject: [PATCH] Make SMALL_INFOFONT configurable. Tweak the documentation --- Documentation/LCDLanguageFont.md | 14 ++++++------ Marlin/dogm_lcd_implementation.h | 39 +++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/Documentation/LCDLanguageFont.md b/Documentation/LCDLanguageFont.md index 2d6b9cbf7..a1acfb63f 100644 --- a/Documentation/LCDLanguageFont.md +++ b/Documentation/LCDLanguageFont.md @@ -1,13 +1,13 @@ # LCD Language Font System We deal with a variety of different displays. -And we try to display a lot of different languages on them. +And we try to display a lot of different languages in different scripts on them. This system is ought to solve some of the related problems. ## The Displays We have two different technologies for the displays: -* Character based displays +* Character based displays: Have a fixed set of symbols (charset - font) in their ROM. All of them have a similar but not identical symbol set at the positions 0 to 127 similar to US-ASCII. On the other hand symbols at places higher than 127 have mayor differences. @@ -21,13 +21,13 @@ We have two different technologies for the displays: At all of them you can define 8 different symbols by yourself. In Marlin they are used for the Feedrate-, Thermometer-, ... symbols -* Full graphic displays +* Full graphic displays: Where we have the full freedom to display whatever we want, when we can make a program for it. Currently we deal with 128x64 Pixel Displays and divide this area in about 5 Lines with about 22 columns. Therefore we need fonts with a bounding box of about 6x10. Until now we used a * 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10. - * 2.) Because these letters are to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9. + * 2.) Because these letters where to big for some locations on the info-screen we use a full ISO10646-1 font in the size of 6x9.(3200 byte) * 3.) When we define USE_BIG_EDIT_FONT we use an additional ISO10646-1 font with 9x18, eating up another 3120 bytes of progmem - but readable without glasses. ## The Languages @@ -55,7 +55,7 @@ We have two different technologies for the displays: ## The Problem All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII. Even the English translation uses some Symbols not in US-ASCII. ( '\002' for Thermometer, STR_h3 for '³') - And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is thrue only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite of what the programmer wanted.) + And worse, in the code itself symbols are used, not taking in account, on what display they are written. [(This is true only for Displays with Japanese charset](https://github.com/MarlinFirmware/Marlin/blob/Development/Marlin/ultralcd_implementation_hitachi_HD44780.h#L218) on Western displays you'll see a '~' and on Cyrillic an 'arrow coming from top - pointing to left', what is quite the opposite of what the programmer wanted.) The Germans want to use "ÄäÖöÜüß" the Finnish at least "äö". Other European languages want to see their accents on their letters. For other scripts like Cyrillic, Japanese, Greek, Hebrew, ... you have to find totally different symbol sets. @@ -126,7 +126,7 @@ We have two different technologies for the displays: * h.) If you want to integrate an entirely new variant of a Hitachi based display. Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. - The length of the strings is limited. '17 chars' a was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. + The length of the strings is limited. '17 chars' was crude rule of thumb. Obviously 17 is to long for the 16x2 displays. A more exact rule would be max_strlen = Displaywidth - 2 - strlen(value to display behind). This is a bit complicated. So try and count is my rule of thumb. On the 16x2 displays the strings are cut at the end to fit on the display. So it's a good idea to make them differ early. ('Somverylongoptionname x' -> 'x Somverylongoptionname') @@ -134,7 +134,7 @@ We have two different technologies for the displays: ## User Instructions Define your hardware and the wanted language in 'Configuration.h'. - To find out what charset your hardware is define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. + To find out what charset your hardware is, define language 'test' and compile. In the menu you will see two lines from the upper half of the charset. * DISPLAY_CHARSET_HD44780_JAPAN locks like "バパヒビピフブプヘベペホボポマミ" * DISPLAY_CHARSET_HD44780_WESTERN locks like "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" * DISPLAY_CHARSET_HD44780_CYRILIC locks like "РСТУФХЦЧШЩЪЫЬЭЮЯ" diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 812c290f0..205b69589 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -35,16 +35,24 @@ #include "ultralcd_st7920_u8glib_rrd.h" #include "Configuration.h" -#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols -#define FONT_SPECIAL_NAME Marlin_symbols - // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana #if defined( MAPPER_C2C3 ) || defined( MAPPER_NON ) - #define USE_BIG_EDIT_FONT +// #define USE_BIG_EDIT_FONT #endif -#define FONT_STATUSMENU u8g_font_6x9 -#define FONT_MENU u8g_font_6x10_marlin + +// If you have spare 2300Byte of progmem and want to use a +// smaller font on the Info-screen uncomment the next line. +//#define USE_SMALL_INFOFONT +#ifdef USE_SMALL_INFOFONT + #include "dogm_font_data_6x9_marlin.h" + #define FONT_STATUSMENU_NAME u8g_font_6x9 +#else + #define FONT_STATUSMENU_NAME FONT_MENU_NAME +#endif + +#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols +#define FONT_SPECIAL_NAME Marlin_symbols #ifndef SIMULATE_ROMFONT #if defined( DISPLAY_CHARSET_ISO10646_1 ) @@ -76,7 +84,7 @@ #endif #endif // SIMULATE_ROMFONT -#define FONT_STATUSMENU_NAME FONT_MENU_NAME +//#define FONT_STATUSMENU_NAME FONT_MENU_NAME #define FONT_STATUSMENU 1 #define FONT_SPECIAL 2 @@ -310,8 +318,13 @@ static void lcd_implementation_status_screen() { // X, Y, Z-Coordinates #define XYZ_BASELINE 38 - u8g.setFont(FONT_STATUSMENU); - u8g.drawBox(0,30,128,9); + lcd_setFont(FONT_STATUSMENU); + + #ifdef USE_SMALL_INFOFONT + u8g.drawBox(0,30,128,10); + #else + u8g.drawBox(0,30,128,9); + #endif u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,XYZ_BASELINE); lcd_print('X'); @@ -337,14 +350,18 @@ static void lcd_implementation_status_screen() { lcd_setFont(FONT_MENU); u8g.setPrintPos(3,49); lcd_print(LCD_STR_FEEDRATE[0]); - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); u8g.setPrintPos(12,49); lcd_print(itostr3(feedmultiply)); lcd_print('%'); // Status line - u8g.setFont(FONT_STATUSMENU); + lcd_setFont(FONT_STATUSMENU); + #ifdef USE_SMALL_INFOFONT + u8g.setPrintPos(0,62); + #else u8g.setPrintPos(0,63); + #endif #ifndef FILAMENT_LCD_DISPLAY lcd_print(lcd_status_message); #else