Intit. commit for Chinese
Edited the European part of 'ISO10646_CN.fon' to match the existing fonts. Added Chinese font to make_fonts.bat Created 'dogm_font_data_ISO10646_CN.h' Added Chinese to 'language.h' Added 'language_cn.h' with some minor edits. Added Chinese font in 'language_en.h' to not fall back to European font. Added cn to 'Configuration.h' Changed WIDTH to LCD_PIXEL_WIDTH and HEIGHT to LCD_PIXEL_HEIGHT to have more descriptive names. In 'dogm_lcd_implementation.h' Added Chinese Font Made 1 pixel more room for the larger Chinese font on the status line. Changed geometry of the 'select bar' by one pixel. Changed the way the position for values and postcars are set.
This commit is contained in:
@ -64,6 +64,10 @@
|
||||
#elif defined( DISPLAY_CHARSET_ISO10646_KANA )
|
||||
#include "dogm_font_data_ISO10646_Kana.h"
|
||||
#define FONT_MENU_NAME ISO10646_Kana_5x7
|
||||
#elif defined( DISPLAY_CHARSET_ISO10646_CN )
|
||||
#include "dogm_font_data_ISO10646_CN.h"
|
||||
#define FONT_MENU_NAME ISO10646_CN
|
||||
#define TALL_FONT_CORRECTION 1
|
||||
#else // fall-back
|
||||
#include "dogm_font_data_ISO10646_1.h"
|
||||
#define FONT_MENU_NAME ISO10646_1_5x7
|
||||
@ -123,6 +127,13 @@
|
||||
U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
|
||||
#endif
|
||||
|
||||
#ifndef LCD_PIXEL_WIDTH
|
||||
#define LCD_PIXEL_WIDTH 128
|
||||
#endif
|
||||
#ifndef LCD_PIXEL_HEIGHT
|
||||
#define LCD_PIXEL_HEIGHT 64
|
||||
#endif
|
||||
|
||||
#include "utf_mapper.h"
|
||||
|
||||
int lcd_contrast;
|
||||
@ -252,20 +263,21 @@ static void lcd_implementation_status_screen() {
|
||||
|
||||
#ifdef SDSUPPORT
|
||||
// SD Card Symbol
|
||||
u8g.drawBox(42,42,8,7);
|
||||
u8g.drawBox(50,44,2,5);
|
||||
u8g.drawFrame(42,49,10,4);
|
||||
u8g.drawPixel(50,43);
|
||||
u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7);
|
||||
u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5);
|
||||
u8g.drawFrame(42, 49 - TALL_FONT_CORRECTION, 10, 4);
|
||||
u8g.drawPixel(50, 43 - TALL_FONT_CORRECTION);
|
||||
|
||||
|
||||
// Progress bar frame
|
||||
u8g.drawFrame(54,49,73,4);
|
||||
u8g.drawFrame(54, 49, 73, 4 - TALL_FONT_CORRECTION);
|
||||
|
||||
// SD Card Progress bar and clock
|
||||
lcd_setFont(FONT_STATUSMENU);
|
||||
|
||||
if (IS_SD_PRINTING) {
|
||||
// Progress bar solid part
|
||||
u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2);
|
||||
u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - TALL_FONT_CORRECTION);
|
||||
}
|
||||
|
||||
u8g.setPrintPos(80,48);
|
||||
@ -306,9 +318,9 @@ static void lcd_implementation_status_screen() {
|
||||
lcd_setFont(FONT_STATUSMENU);
|
||||
|
||||
#ifdef USE_SMALL_INFOFONT
|
||||
u8g.drawBox(0,30,128,10);
|
||||
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,10);
|
||||
#else
|
||||
u8g.drawBox(0,30,128,9);
|
||||
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,9);
|
||||
#endif
|
||||
u8g.setColorIndex(0); // white on black
|
||||
u8g.setPrintPos(2,XYZ_BASELINE);
|
||||
@ -366,7 +378,7 @@ static void lcd_implementation_status_screen() {
|
||||
static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
|
||||
if (isSelected) {
|
||||
u8g.setColorIndex(1); // black on white
|
||||
u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
|
||||
u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3 - TALL_FONT_CORRECTION, LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
|
||||
u8g.setColorIndex(0); // following text must be white on black
|
||||
}
|
||||
else {
|
||||
@ -386,13 +398,15 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co
|
||||
pstr++;
|
||||
}
|
||||
while (n--) lcd_print(' ');
|
||||
u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
|
||||
lcd_print(post_char);
|
||||
lcd_print(' ');
|
||||
}
|
||||
|
||||
static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
|
||||
char c;
|
||||
uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
||||
uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
|
||||
uint8_t n = LCD_WIDTH - 2 - vallen;
|
||||
|
||||
lcd_implementation_mark_as_selected(row, isSelected);
|
||||
|
||||
@ -402,6 +416,7 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c
|
||||
}
|
||||
lcd_print(':');
|
||||
while (n--) lcd_print(' ');
|
||||
u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH * vallen, (row + 1) * DOG_CHAR_HEIGHT);
|
||||
if (pgm) { lcd_printPGM(data); } else { lcd_print((char *)data); }
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user