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

+ 28
- 11
Marlin/dogm_lcd_implementation.h View File

35
 #include "ultralcd_st7920_u8glib_rrd.h"
35
 #include "ultralcd_st7920_u8glib_rrd.h"
36
 #include "Configuration.h"
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
 // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
38
 // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
42
 // we don't have a big font for Cyrillic, Kana
39
 // we don't have a big font for Cyrillic, Kana
43
 #if defined( MAPPER_C2C3 ) || defined( MAPPER_NON )
40
 #if defined( MAPPER_C2C3 ) || defined( MAPPER_NON )
44
-  #define USE_BIG_EDIT_FONT
41
+//  #define USE_BIG_EDIT_FONT
45
 #endif
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
 #ifndef SIMULATE_ROMFONT
57
 #ifndef SIMULATE_ROMFONT
50
   #if defined( DISPLAY_CHARSET_ISO10646_1 )
58
   #if defined( DISPLAY_CHARSET_ISO10646_1 )
76
   #endif
84
   #endif
77
 #endif // SIMULATE_ROMFONT
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
 #define FONT_STATUSMENU 1
89
 #define FONT_STATUSMENU 1
82
 #define FONT_SPECIAL 2
90
 #define FONT_SPECIAL 2
310
 
318
 
311
   // X, Y, Z-Coordinates
319
   // X, Y, Z-Coordinates
312
   #define XYZ_BASELINE 38
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
   u8g.setColorIndex(0); // white on black
328
   u8g.setColorIndex(0); // white on black
316
   u8g.setPrintPos(2,XYZ_BASELINE);
329
   u8g.setPrintPos(2,XYZ_BASELINE);
317
   lcd_print('X');
330
   lcd_print('X');
337
   lcd_setFont(FONT_MENU);
350
   lcd_setFont(FONT_MENU);
338
   u8g.setPrintPos(3,49);
351
   u8g.setPrintPos(3,49);
339
   lcd_print(LCD_STR_FEEDRATE[0]);
352
   lcd_print(LCD_STR_FEEDRATE[0]);
340
-  u8g.setFont(FONT_STATUSMENU);
353
+  lcd_setFont(FONT_STATUSMENU);
341
   u8g.setPrintPos(12,49);
354
   u8g.setPrintPos(12,49);
342
   lcd_print(itostr3(feedmultiply));
355
   lcd_print(itostr3(feedmultiply));
343
   lcd_print('%');
356
   lcd_print('%');
344
 
357
 
345
   // Status line
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
   u8g.setPrintPos(0,63);
363
   u8g.setPrintPos(0,63);
364
+  #endif
348
   #ifndef FILAMENT_LCD_DISPLAY
365
   #ifndef FILAMENT_LCD_DISPLAY
349
     lcd_print(lcd_status_message);
366
     lcd_print(lcd_status_message);
350
   #else
367
   #else

Loading…
Cancel
Save