Browse Source

Make SMALL_INFOFONT configurable.

Tweak the documentation
AnHardt 9 years ago
parent
commit
4beffbca69
2 changed files with 35 additions and 18 deletions
  1. 7
    7
      Documentation/LCDLanguageFont.md
  2. 28
    11
      Marlin/dogm_lcd_implementation.h

+ 7
- 7
Documentation/LCDLanguageFont.md View File

@@ -1,13 +1,13 @@
1 1
 # LCD Language Font System
2 2
 
3 3
 We deal with a variety of different displays.
4
-And we try to display a lot of different languages on them.
4
+And we try to display a lot of different languages in different scripts on them.
5 5
 This system is ought to solve some of the related problems.
6 6
 
7 7
 ## The Displays
8 8
 We have two different technologies for the displays:
9 9
 
10
-* Character based displays
10
+* Character based displays:
11 11
   Have a fixed set of symbols (charset - font) in their ROM.
12 12
   All of them have a similar but not identical symbol set at the positions 0 to 127 similar to US-ASCII.
13 13
   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:
21 21
 
22 22
   At all of them you can define 8 different symbols by yourself. In Marlin they are used for the Feedrate-, Thermometer-, ... symbols
23 23
 
24
-* Full graphic displays
24
+* Full graphic displays:
25 25
   Where we have the full freedom to display whatever we want, when we can make a program for it.
26 26
   Currently we deal with 128x64 Pixel Displays and divide this area in about 5 Lines with about 22 columns.
27 27
   Therefore we need fonts with a bounding box of about 6x10.
28 28
   Until now we used a
29 29
   * 1.) Marlin-font similar to ISO10646-1 but with special Symbols at the end, what made 'ü' and 'ä' inaccessible, in the size 6x10.
30
-  * 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.
30
+  * 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)
31 31
   * 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.
32 32
 
33 33
 ## The Languages
@@ -55,7 +55,7 @@ We have two different technologies for the displays:
55 55
 ## The Problem
56 56
   All of this languages, except the English, normally use extended symbol sets, not contained in US-ASCII.
57 57
   Even the English translation uses some Symbols not in US-ASCII. ( '\002' for Thermometer, STR_h3 for '³')
58
-  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.)
58
+  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.)
59 59
   The Germans want to use "ÄäÖöÜüß" the Finnish at least "äö". Other European languages want to see their accents on their letters.
60 60
   For other scripts like Cyrillic, Japanese, Greek, Hebrew, ... you have to find totally different symbol sets.
61 61
 
@@ -126,7 +126,7 @@ We have two different technologies for the displays:
126 126
   * h.) If you want to integrate an entirely new variant of a Hitachi based display.
127 127
       Add it in 'Configuration.h'. Define mapper tables in 'utf_mapper.h'. Maybe you need a new mapper function. 
128 128
 
129
-  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. 
129
+  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. 
130 130
 
131 131
   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')
132 132
 
@@ -134,7 +134,7 @@ We have two different technologies for the displays:
134 134
 
135 135
 ## User Instructions
136 136
    Define your hardware and the wanted language in 'Configuration.h'.
137
-   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.
137
+   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.
138 138
    * DISPLAY_CHARSET_HD44780_JAPAN   locks like "バパヒビピフブプヘベペホボポマミ"
139 139
    * DISPLAY_CHARSET_HD44780_WESTERN locks like "ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß"
140 140
    * DISPLAY_CHARSET_HD44780_CYRILIC locks like "РСТУФХЦЧШЩЪЫЬЭЮЯ"

+ 28
- 11
Marlin/dogm_lcd_implementation.h View File

@@ -35,16 +35,24 @@
35 35
 #include "ultralcd_st7920_u8glib_rrd.h"
36 36
 #include "Configuration.h"
37 37
 
38
-#include "dogm_font_data_Marlin_symbols.h"   // The Marlin special symbols
39
-#define FONT_SPECIAL_NAME Marlin_symbols
40
-
41 38
 // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
42 39
 // we don't have a big font for Cyrillic, Kana
43 40
 #if defined( MAPPER_C2C3 ) || defined( MAPPER_NON )
44
-  #define USE_BIG_EDIT_FONT
41
+//  #define USE_BIG_EDIT_FONT
45 42
 #endif
46
-#define FONT_STATUSMENU u8g_font_6x9
47
-#define FONT_MENU u8g_font_6x10_marlin
43
+
44
+// If you have spare 2300Byte of progmem and want to use a 
45
+// smaller font on the Info-screen uncomment the next line.
46
+//#define USE_SMALL_INFOFONT
47
+#ifdef USE_SMALL_INFOFONT
48
+  #include "dogm_font_data_6x9_marlin.h"
49
+  #define FONT_STATUSMENU_NAME u8g_font_6x9
50
+#else
51
+  #define FONT_STATUSMENU_NAME FONT_MENU_NAME
52
+#endif
53
+
54
+#include "dogm_font_data_Marlin_symbols.h"   // The Marlin special symbols
55
+#define FONT_SPECIAL_NAME Marlin_symbols
48 56
 
49 57
 #ifndef SIMULATE_ROMFONT
50 58
   #if defined( DISPLAY_CHARSET_ISO10646_1 )
@@ -76,7 +84,7 @@
76 84
   #endif
77 85
 #endif // SIMULATE_ROMFONT
78 86
 
79
-#define FONT_STATUSMENU_NAME FONT_MENU_NAME
87
+//#define FONT_STATUSMENU_NAME FONT_MENU_NAME
80 88
 
81 89
 #define FONT_STATUSMENU 1
82 90
 #define FONT_SPECIAL 2
@@ -310,8 +318,13 @@ static void lcd_implementation_status_screen() {
310 318
 
311 319
   // X, Y, Z-Coordinates
312 320
   #define XYZ_BASELINE 38
313
-  u8g.setFont(FONT_STATUSMENU);
314
-  u8g.drawBox(0,30,128,9);
321
+  lcd_setFont(FONT_STATUSMENU);
322
+
323
+  #ifdef USE_SMALL_INFOFONT
324
+    u8g.drawBox(0,30,128,10);
325
+  #else
326
+    u8g.drawBox(0,30,128,9);
327
+  #endif
315 328
   u8g.setColorIndex(0); // white on black
316 329
   u8g.setPrintPos(2,XYZ_BASELINE);
317 330
   lcd_print('X');
@@ -337,14 +350,18 @@ static void lcd_implementation_status_screen() {
337 350
   lcd_setFont(FONT_MENU);
338 351
   u8g.setPrintPos(3,49);
339 352
   lcd_print(LCD_STR_FEEDRATE[0]);
340
-  u8g.setFont(FONT_STATUSMENU);
353
+  lcd_setFont(FONT_STATUSMENU);
341 354
   u8g.setPrintPos(12,49);
342 355
   lcd_print(itostr3(feedmultiply));
343 356
   lcd_print('%');
344 357
 
345 358
   // Status line
346
-  u8g.setFont(FONT_STATUSMENU);
359
+  lcd_setFont(FONT_STATUSMENU);
360
+  #ifdef USE_SMALL_INFOFONT
361
+  u8g.setPrintPos(0,62);
362
+  #else
347 363
   u8g.setPrintPos(0,63);
364
+  #endif
348 365
   #ifndef FILAMENT_LCD_DISPLAY
349 366
     lcd_print(lcd_status_message);
350 367
   #else

Loading…
Cancel
Save