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.
master
AnHardt 10 years ago
parent ac9ca64c50
commit 6b1b71837c

@ -642,7 +642,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
// @section lcd // @section lcd
// Define your display language below. Replace (en) with your language code and uncomment. // Define your display language below. Replace (en) with your language code and uncomment.
// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, test // en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test
// See also language.h // See also language.h
#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en) #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en)

@ -0,0 +1,270 @@
/*
Fontname: ISO10646_CN
Copyright: A. Hardtung, public domain
Capital A Height: 7, '1' Height: 7
Calculated Max Values w=11 h=11 x= 2 y=10 dx=12 dy= 0 ascent=10 len=22
Font Bounding box w=12 h=11 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 =10 descent=-1
*/
#include <utility/u8g.h>
const u8g_fntpgm_uint8_t ISO10646_CN[4105] U8G_SECTION(".progmem.ISO10646_CN") = {
0,12,11,0,254,7,1,146,3,33,32,255,255,10,255,7,
255,0,0,0,6,0,10,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,152,168,200,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,0,
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,0,0,224,128,128,128,128,128,
224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
0,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,1,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,3,104,144,0,0,0,6,0,10,0,0,0,12,0,
10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0,
12,0,10,0,0,0,12,0,10,0,0,0,12,0,10,0,
0,0,12,0,10,0,0,0,12,0,10,0,0,0,12,0,
10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0,
12,0,10,0,0,0,12,0,10,0,0,0,12,0,10,0,
0,0,12,0,10,0,0,0,12,0,10,0,0,0,12,0,
10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0,
12,0,10,0,0,0,12,0,10,0,0,0,12,0,10,0,
0,0,12,0,10,0,0,0,12,0,10,0,0,0,12,0,
10,0,0,0,12,0,10,0,0,0,12,0,10,0,0,0,
12,0,10,0,0,0,12,0,10,11,11,22,12,0,255,255,
224,2,0,2,0,4,0,13,0,20,128,36,64,196,32,4,
0,4,0,4,0,11,11,22,12,0,255,249,0,138,0,171,
224,172,64,170,64,170,64,170,64,170,128,33,0,82,128,140,
96,11,11,22,12,0,255,36,0,36,0,63,128,68,0,132,
0,4,0,255,224,10,0,17,0,32,128,192,96,11,11,22,
12,0,255,36,0,36,0,63,192,68,0,4,0,255,224,9,
0,9,0,17,32,33,32,64,224,11,11,22,12,0,255,32,
0,61,224,81,32,145,32,17,32,255,32,17,32,41,32,37,
224,69,32,128,0,11,11,22,12,0,255,32,128,127,192,8,
64,255,224,17,0,32,128,95,64,128,32,63,128,0,0,127,
192,11,11,22,12,0,255,34,64,71,224,148,128,228,128,47,
224,68,128,244,128,7,224,52,128,196,128,7,224,11,11,22,
12,0,255,4,128,143,224,73,0,25,0,47,192,9,0,9,
0,47,192,73,0,137,0,15,224,11,11,22,12,0,255,16,
0,63,128,81,0,14,0,49,128,192,96,63,128,36,128,63,
128,36,128,63,128,11,11,22,12,0,255,34,128,250,64,7,
224,250,128,138,128,138,128,250,128,34,128,178,128,170,160,100,
224,11,11,22,12,0,255,34,32,71,64,146,128,239,224,34,
0,71,192,236,64,7,192,52,64,199,192,4,64,11,11,22,
12,0,255,8,0,15,192,8,0,8,0,255,224,8,0,14,
0,9,128,8,64,8,0,8,0,10,11,22,12,0,255,255,
128,0,128,0,128,128,128,128,128,255,128,128,0,128,0,128,
64,128,64,127,192,11,11,22,12,0,255,71,192,65,0,239,
224,65,0,69,0,105,96,201,32,77,96,73,32,79,224,200,
32,11,11,22,12,0,255,8,0,4,0,4,0,10,0,10,
0,10,0,17,0,17,0,32,128,64,64,128,32,11,11,22,
12,0,255,34,64,34,0,247,224,34,0,35,224,53,32,229,
32,37,64,40,128,41,64,114,32,11,10,20,12,0,0,68,
64,68,64,68,64,127,192,4,0,4,0,132,32,132,32,132,
32,255,224,11,11,22,12,0,255,4,0,0,0,127,192,4,
0,4,0,4,0,127,192,4,0,4,0,4,0,255,224,11,
11,22,12,0,255,255,224,17,0,1,192,254,0,72,128,37,
0,4,0,255,224,21,0,36,128,196,96,11,11,22,12,0,
255,17,0,127,192,68,64,127,192,68,64,127,192,4,0,255,
224,4,0,4,0,4,0,9,11,22,12,0,255,16,0,255,
128,128,128,128,128,255,128,128,128,128,128,255,128,128,128,128,
128,255,128,11,11,22,12,0,255,113,0,1,0,3,224,249,
32,33,32,65,32,81,32,137,32,250,32,2,32,4,192,11,
11,22,12,0,255,127,192,17,0,17,0,17,0,17,0,255,
224,17,0,17,0,33,0,33,0,65,0,11,11,22,12,0,
255,33,0,34,0,244,64,87,224,80,32,87,192,148,64,84,
64,36,64,87,192,148,64,11,11,22,12,0,255,17,0,10,
0,127,192,4,0,4,0,255,224,4,0,10,0,17,0,32,
128,192,96,10,11,22,12,0,255,95,192,0,64,132,64,132,
64,191,64,132,64,140,64,148,64,164,64,140,64,129,192,11,
11,22,12,0,255,36,0,39,192,36,0,36,0,255,224,0,
0,20,64,36,128,71,0,12,0,112,0,11,11,22,12,0,
255,36,128,4,128,15,192,228,128,36,128,63,224,36,128,36,
128,40,128,80,0,143,224,11,11,22,12,0,255,8,0,8,
0,255,128,136,128,136,128,255,128,136,128,136,128,255,160,136,
32,7,224,11,11,22,12,0,255,39,128,36,128,244,128,36,
128,116,128,108,128,164,128,36,128,36,160,40,160,48,96,10,
11,22,12,0,255,255,192,128,64,128,64,158,64,146,64,146,
64,158,64,128,64,128,64,255,192,128,64,11,11,22,12,0,
255,127,192,68,0,95,192,80,64,95,192,80,64,95,192,66,
0,74,128,82,64,166,32,11,11,22,12,0,255,4,0,7,
224,4,0,127,192,64,64,64,64,64,64,127,192,0,0,82,
64,137,32,11,11,22,12,0,255,71,128,36,128,4,128,4,
128,232,96,32,0,47,192,36,64,34,128,49,0,38,192,11,
11,22,12,0,255,127,192,74,64,127,192,4,0,255,224,4,
0,63,128,32,128,36,128,36,128,255,224,11,11,22,12,0,
255,34,0,79,224,72,32,79,224,200,0,79,224,74,160,90,
160,111,224,74,160,72,96,11,11,22,12,0,255,243,192,36,
64,42,128,241,0,34,128,101,224,114,32,165,64,32,128,35,
0,44,0,11,11,22,12,0,255,4,0,255,224,128,32,0,
0,255,224,4,0,36,0,39,192,36,0,84,0,143,224,11,
11,22,12,0,255,115,224,16,128,81,0,35,224,250,32,42,
160,34,160,34,160,32,128,33,64,98,32,11,11,22,12,0,
255,34,0,247,128,34,128,54,128,226,160,37,160,36,96,104,
32,0,0,82,64,137,32,11,11,22,12,0,255,115,192,66,
0,66,0,123,224,74,64,74,64,122,64,74,64,66,64,68,
64,136,64,11,11,22,12,0,255,8,0,255,224,8,0,31,
192,48,64,95,192,144,64,31,192,16,64,16,64,16,192,11,
11,22,12,0,255,2,0,127,224,66,0,66,0,95,192,66,
0,71,0,74,128,82,64,98,32,130,0,11,11,22,12,0,
255,243,192,150,64,145,128,166,96,161,0,151,192,145,0,149,
0,231,224,129,0,129,0,11,11,22,12,0,255,15,128,136,
128,79,128,8,128,143,128,64,0,31,192,53,64,85,64,149,
64,63,224,11,11,22,12,0,255,39,224,32,128,248,128,32,
128,32,128,56,128,224,128,32,128,32,128,32,128,97,128,11,
11,22,12,0,255,31,224,145,0,87,192,20,64,23,192,148,
64,87,192,17,0,85,64,153,32,35,0,11,11,22,12,0,
255,32,128,39,224,242,64,33,128,34,64,52,32,226,64,34,
64,34,64,34,64,100,64,11,11,22,12,0,255,65,0,65,
0,79,224,233,32,73,32,73,32,111,224,201,32,73,32,73,
32,207,224,11,11,22,12,0,255,33,0,241,0,79,224,169,
32,249,32,47,224,57,32,233,32,41,32,47,224,40,32,11,
11,22,12,0,255,143,224,73,32,9,32,203,160,73,32,79,
224,72,32,75,160,74,160,107,160,80,224,11,11,22,12,0,
255,127,192,4,0,68,64,36,64,36,128,4,0,255,224,4,
0,4,0,4,0,4,0,11,11,22,12,0,255,130,0,66,
0,31,224,194,0,95,192,82,64,95,192,71,0,74,128,82,
64,191,224,11,11,22,12,0,255,4,0,127,224,72,128,127,
224,72,128,79,128,64,0,95,192,72,64,71,128,152,96,11,
11,22,12,0,255,1,0,239,224,161,0,164,64,175,224,164,
64,175,224,169,32,233,32,2,128,12,96,11,11,22,12,0,
255,20,192,246,160,188,96,167,128,168,128,191,224,169,32,239,
224,9,32,15,224,9,32,11,11,22,12,0,255,127,128,64,
128,66,128,98,128,84,128,72,128,72,128,84,160,98,160,64,
96,128,32,11,11,22,12,0,255,4,0,127,224,64,32,127,
224,64,0,125,224,84,32,76,160,84,96,100,160,141,96,11,
11,22,12,0,255,130,0,95,224,4,0,8,64,159,224,64,
32,10,128,10,128,74,160,146,160,34,96,11,11,22,12,0,
255,65,0,79,224,232,32,66,128,68,64,104,32,199,192,65,
0,65,0,65,0,207,224,11,11,22,12,0,255,80,32,125,
32,145,32,255,32,17,32,125,32,85,32,85,32,84,32,92,
32,16,224,11,11,22,12,0,255,63,128,32,128,63,128,32,
128,255,224,72,0,123,192,73,64,121,64,72,128,251,96,11,
11,22,12,0,255,4,0,4,0,4,0,36,128,36,64,68,
64,68,32,132,32,4,0,4,0,28,0,11,11,22,12,0,
255,4,0,4,0,4,0,255,224,4,0,10,0,10,0,17,
0,17,0,32,128,192,96,9,10,20,10,0,0,136,128,73,
0,8,0,255,128,0,128,0,128,127,128,0,128,0,128,255,
128,11,11,22,12,0,255,33,0,18,0,255,224,0,0,120,
128,74,128,122,128,74,128,122,128,72,128,89,128,11,11,22,
12,0,255,39,192,0,0,0,0,239,224,33,0,34,0,36,
64,47,224,32,32,80,0,143,224,11,11,22,12,0,255,32,
128,39,0,249,0,33,192,119,0,33,0,249,224,39,0,113,
32,169,32,32,224,11,11,22,12,0,255,16,64,16,64,253,
224,16,64,56,192,53,64,82,64,148,64,16,64,16,64,16,
192,11,11,22,12,0,255,0,64,248,64,11,224,8,64,136,
64,82,64,81,64,33,64,80,64,72,64,137,192,10,11,22,
12,0,255,132,0,132,64,132,128,245,0,134,0,132,0,132,
0,148,0,164,64,196,64,131,192,11,11,22,12,0,255,17,
32,125,0,17,0,255,224,41,0,253,64,73,64,124,128,8,
160,253,96,10,32,11,11,22,12,0,255,23,192,36,64,36,
64,103,192,161,0,47,224,33,0,35,128,37,64,41,32,33,
0,11,11,22,12,0,255,8,0,255,224,16,0,39,192,32,
128,97,0,175,224,33,0,33,0,33,0,35,0,11,11,22,
12,0,255,36,0,47,224,180,0,164,128,164,160,170,192,42,
128,40,128,41,64,50,64,36,32,11,11,22,12,0,255,127,
224,128,0,63,192,32,64,63,192,16,0,31,192,16,64,40,
128,71,0,56,224,11,11,22,12,0,255,127,224,64,0,64,
0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,128,
0,11,11,22,12,0,255,255,224,4,0,127,192,68,64,127,
192,68,64,127,192,68,0,36,0,24,0,231,224,11,11,22,
12,0,255,17,224,253,0,69,0,41,224,253,64,17,64,125,
64,17,64,85,64,146,64,52,64,11,11,22,12,0,255,33,
0,95,224,64,0,207,192,64,0,79,192,64,0,79,192,72,
64,79,192,72,64,11,11,22,12,0,255,4,0,127,192,64,
64,127,192,64,64,127,192,64,64,127,192,4,64,82,32,191,
160,11,11,22,12,0,255,127,192,68,64,127,192,68,64,127,
192,4,0,27,0,224,224,17,0,17,0,97,0,11,11,22,
12,0,255,255,224,4,0,8,0,127,224,73,32,79,32,73,
32,79,32,73,32,73,32,127,224,11,11,22,12,0,255,253,
224,86,64,121,64,56,128,85,64,146,32,255,224,4,0,39,
192,36,0,255,224,11,11,22,12,0,255,251,128,82,0,123,
224,18,64,250,64,20,64,63,128,32,128,63,128,32,128,63,
128,11,11,22,12,0,255,31,224,32,0,39,192,100,64,167,
192,32,0,47,224,40,32,39,192,33,0,35,0,11,11,22,
12,0,255,243,224,130,32,130,32,250,32,130,32,130,32,138,
32,178,32,194,224,2,0,2,0,11,11,22,12,0,255,36,
128,70,160,149,192,228,128,39,224,68,128,245,192,6,160,52,
128,196,128,7,224,11,11,22,12,0,255,39,192,65,0,135,
224,224,32,34,128,69,128,242,128,15,224,48,128,193,64,2,
32,11,11,22,12,0,255,2,0,2,0,34,0,35,192,34,
0,34,0,34,0,34,0,34,0,34,0,255,224,9,11,22,
12,0,255,8,0,8,0,255,128,136,128,136,128,136,128,255,
128,136,128,136,128,136,128,255,128,11,11,22,12,0,255,33,
0,83,160,65,0,247,224,81,0,83,192,86,64,83,192,90,
64,83,192,66,64,11,11,22,12,0,255,127,192,4,0,4,
0,4,0,255,224,10,0,10,0,18,0,34,32,66,32,129,
224,11,11,22,12,0,255,17,0,33,0,47,224,97,0,163,
128,35,128,37,64,37,64,41,32,33,0,33,0,11,11,22,
12,0,255,247,224,148,32,244,32,151,224,148,128,244,128,151,
224,148,128,244,160,150,96,4,32,11,11,22,12,0,255,123,
224,148,128,4,0,127,192,4,0,255,224,1,0,255,224,33,
0,17,0,7,0,11,11,22,12,0,255,33,0,71,192,145,
0,47,224,96,128,175,224,32,128,36,128,34,128,32,128,35,
128,11,11,22,12,0,255,39,192,36,64,247,192,46,224,42,
160,62,224,225,0,47,224,35,128,37,64,105,32,11,11,22,
12,0,255,20,0,39,224,42,0,98,0,163,192,34,0,34,
0,35,224,34,0,34,0,34,0};

@ -64,6 +64,10 @@
#elif defined( DISPLAY_CHARSET_ISO10646_KANA ) #elif defined( DISPLAY_CHARSET_ISO10646_KANA )
#include "dogm_font_data_ISO10646_Kana.h" #include "dogm_font_data_ISO10646_Kana.h"
#define FONT_MENU_NAME ISO10646_Kana_5x7 #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 #else // fall-back
#include "dogm_font_data_ISO10646_1.h" #include "dogm_font_data_ISO10646_1.h"
#define FONT_MENU_NAME ISO10646_1_5x7 #define FONT_MENU_NAME ISO10646_1_5x7
@ -123,6 +127,13 @@
U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
#endif #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" #include "utf_mapper.h"
int lcd_contrast; int lcd_contrast;
@ -252,20 +263,21 @@ static void lcd_implementation_status_screen() {
#ifdef SDSUPPORT #ifdef SDSUPPORT
// SD Card Symbol // SD Card Symbol
u8g.drawBox(42,42,8,7); u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7);
u8g.drawBox(50,44,2,5); u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5);
u8g.drawFrame(42,49,10,4); u8g.drawFrame(42, 49 - TALL_FONT_CORRECTION, 10, 4);
u8g.drawPixel(50,43); u8g.drawPixel(50, 43 - TALL_FONT_CORRECTION);
// Progress bar frame // Progress bar frame
u8g.drawFrame(54,49,73,4); u8g.drawFrame(54, 49, 73, 4 - TALL_FONT_CORRECTION);
// SD Card Progress bar and clock // SD Card Progress bar and clock
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
if (IS_SD_PRINTING) { if (IS_SD_PRINTING) {
// Progress bar solid part // 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); u8g.setPrintPos(80,48);
@ -306,9 +318,9 @@ static void lcd_implementation_status_screen() {
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
#ifdef USE_SMALL_INFOFONT #ifdef USE_SMALL_INFOFONT
u8g.drawBox(0,30,128,10); u8g.drawBox(0,30,LCD_PIXEL_WIDTH,10);
#else #else
u8g.drawBox(0,30,128,9); u8g.drawBox(0,30,LCD_PIXEL_WIDTH,9);
#endif #endif
u8g.setColorIndex(0); // white on black u8g.setColorIndex(0); // white on black
u8g.setPrintPos(2,XYZ_BASELINE); 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) { static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
if (isSelected) { if (isSelected) {
u8g.setColorIndex(1); // black on white 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 u8g.setColorIndex(0); // following text must be white on black
} }
else { else {
@ -386,13 +398,15 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co
pstr++; pstr++;
} }
while (n--) lcd_print(' '); while (n--) lcd_print(' ');
u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
lcd_print(post_char); lcd_print(post_char);
lcd_print(' '); lcd_print(' ');
} }
static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) { static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
char c; 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); 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(':'); lcd_print(':');
while (n--) 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); } if (pgm) { lcd_printPGM(data); } else { lcd_print((char *)data); }
} }

Binary file not shown.

@ -5,3 +5,4 @@
.\bdf2u8g.exe -b 32 -e 255 ISO10646-1.bdf ISO10646_1_5x7 dogm_font_data_ISO10646_1.h .\bdf2u8g.exe -b 32 -e 255 ISO10646-1.bdf ISO10646_1_5x7 dogm_font_data_ISO10646_1.h
.\bdf2u8g.exe -b 32 -e 255 ISO10646_5_Cyrillic.bdf ISO10646_5_Cyrillic_5x7 dogm_font_data_ISO10646_5_Cyrillic.h .\bdf2u8g.exe -b 32 -e 255 ISO10646_5_Cyrillic.bdf ISO10646_5_Cyrillic_5x7 dogm_font_data_ISO10646_5_Cyrillic.h
.\bdf2u8g.exe -b 32 -e 255 ISO10646_Kana.bdf ISO10646_Kana_5x7 dogm_font_data_ISO10646_Kana.h .\bdf2u8g.exe -b 32 -e 255 ISO10646_Kana.bdf ISO10646_Kana_5x7 dogm_font_data_ISO10646_Kana.h
.\bdf2u8g.exe -b 32 -e 255 ISO10646_CN.bdf ISO10646_CN dogm_font_data_ISO10646_CN.h

@ -30,6 +30,7 @@
// eu Basque-Euskera // eu Basque-Euskera
// kana Japanese // kana Japanese
// kana_utf Japanese // kana_utf Japanese
// cn Chinese
#ifndef LANGUAGE_INCLUDE #ifndef LANGUAGE_INCLUDE
// pick your language from the list above // pick your language from the list above

@ -0,0 +1,159 @@
/**
* Chinese
*
* LCD Menu Messages
* Se also documentation/LCDLanguageFont.md
*
*/
#ifndef LANGUAGE_CN_H
#define LANGUAGE_CN_H
#define MAPPER_NON // For direct asci codes
#define DISPLAY_CHARSET_ISO10646_CN
#define WELCOME_MSG "\xa4\xa5\xa6\xa7"
#define MSG_SD_INSERTED "\xa8\xa9\xaa\xab"
#define MSG_SD_REMOVED "\xa8\xa9\xac\xad"
#define MSG_MAIN "\xae\xaf\xb0"
#define MSG_AUTOSTART "\xb1\xb2\xb3\xb4"
#define MSG_DISABLE_STEPPERS "\xb5\xb6\xb7\xb8\xb9\xba"
#define MSG_AUTO_HOME "\xbb\xbc\xbd"
#define MSG_SET_HOME_OFFSETS "\xbe\xbf\xbb\xbc\xbd\xc0\xc1"
#define MSG_SET_ORIGIN "\xbe\xbf\xbc\xbd"
#define MSG_PREHEAT_PLA "\xc3\xc4 PLA"
#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " \xc5\xc6"
#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " \xc4\xc7"
#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " \xbe\xbf"
#define MSG_PREHEAT_ABS "\xc3\xc4 ABS"
#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " \xc5\xc6"
#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " \xbe\xc6"
#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " \xbe\xbf"
#define MSG_H1 "1"
#define MSG_H2 "2"
#define MSG_H3 "3"
#define MSG_H4 "4"
#define MSG_COOLDOWN "\xc8\xc9"
#define MSG_SWITCH_PS_ON "\xb9\xcb\xca\xb3"
#define MSG_SWITCH_PS_OFF "\xb9\xcb\xb5\xb6"
#define MSG_EXTRUDE "\xcc\xad"
#define MSG_RETRACT "\xbb\xcd"
#define MSG_MOVE_AXIS "\xc1\xb2\xce"
#define MSG_LEVEL_BED "\xcf\xe0\xc4\xc7"
#define MSG_MOVE_X "\xc1\xb2 X"
#define MSG_MOVE_Y "\xc1\xb2 Y"
#define MSG_MOVE_Z "\xc1\xb2 Z"
#define MSG_MOVE_E "\xcc\xad\xba"
#define MSG_MOVE_01MM "\xc1\xb2 0.1mm"
#define MSG_MOVE_1MM "\xc1\xb2 1mm"
#define MSG_MOVE_10MM "\xc1\xb2 10mm"
#define MSG_SPEED "\xd1\xd2"
#define MSG_NOZZLE "\xd3\xd4"
#define MSG_N2 " 2"
#define MSG_N3 " 3"
#define MSG_N4 " 4"
#define MSG_BED "\xc4\xc7"
#define MSG_FAN_SPEED "\xd5\xd6\xd1\xd2"
#define MSG_FLOW "\xcc\xad\xd1\xd2"
#define MSG_F0 " 0"
#define MSG_F1 " 1"
#define MSG_F2 " 2"
#define MSG_F3 " 3"
#define MSG_CONTROL "\xd8\xd9"
#define MSG_MIN LCD_STR_THERMOMETER " \xda\xdb"
#define MSG_MAX LCD_STR_THERMOMETER " \xda\xdc"
#define MSG_FACTOR LCD_STR_THERMOMETER " \xdd\xde"
#define MSG_AUTOTEMP "\xb1\xb2\xd8\xc9"
#define MSG_ON "\xb3 " // intentional space to shift wide symbol to the left
#define MSG_OFF "\xb5 " // intentional space to shift wide symbol to the left
#define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_E2 " E2"
#define MSG_E3 " E3"
#define MSG_E4 " E4"
#define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk"
#define MSG_VE_JERK "Ve-jerk"
#define MSG_VMAX "Vmax "
#define MSG_X "x"
#define MSG_Y "y"
#define MSG_Z "z"
#define MSG_E "e"
#define MSG_VMIN "Vmin"
#define MSG_VTRAV_MIN "VTrav min"
#define MSG_AMAX "Amax "
#define MSG_A_RETRACT "A-retract"
#define MSG_A_TRAVEL "A-travel"
#define MSG_XSTEPS "Xsteps/mm"
#define MSG_YSTEPS "Ysteps/mm"
#define MSG_ZSTEPS "Zsteps/mm"
#define MSG_ESTEPS "Esteps/mm"
#define MSG_TEMPERATURE "\xc9\xd2"
#define MSG_MOTION "\xdf\xb2"
#define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1"
#define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2"
#define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3"
#define MSG_FILAMENT_SIZE_EXTRUDER_3 "Fil. Dia. 4"
#define MSG_CONTRAST "LCD contrast"
#define MSG_STORE_EPROM "Store memory"
#define MSG_LOAD_EPROM "Load memory"
#define MSG_RESTORE_FAILSAFE "Restore failsafe"
#define MSG_REFRESH "Refresh"
#define MSG_WATCH "\xec\xed\xee\xef"
#define MSG_PREPARE "\xa4\xa5"
#define MSG_TUNE "\xcf\xf0"
#define MSG_PAUSE_PRINT "\xf1\xf2\xca\xf3"
#define MSG_RESUME_PRINT "\xf4\xf5\xca\xf3"
#define MSG_STOP_PRINT "\xf2\xf6\xca\xf3"
#define MSG_CARD_MENU "\xaf\xb0"
#define MSG_NO_CARD "\xf9\xa8"
#define MSG_DWELL "Sleep..."
#define MSG_USERWAIT "Wait for user..."
#define MSG_RESUMING "Resuming print"
#define MSG_PRINT_ABORTED "Print aborted"
#define MSG_NO_MOVE "No move."
#define MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. "
#define MSG_CONTROL_RETRACT "Retract mm"
#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm"
#define MSG_CONTROL_RETRACTF "Retract V"
#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm"
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#define MSG_AUTORETRACT "AutoRetr."
#define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD card"
#define MSG_CNG_SDCARD "Change SD card"
#define MSG_ZPROBE_OUT "Z probe out. bed"
#define MSG_POSITION_UNKNOWN "Home X/Y before Z"
#define MSG_ZPROBE_ZOFFSET "Z Offset"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort"
#define MSG_HEATING_FAILED_LCD "Heating failed"
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
#define MSG_ERR_MAXTEMP "Err: MAXTEMP"
#define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_END_HOUR "hours"
#define MSG_END_MINUTE "minutes"
#ifdef DELTA_CALIBRATION_MENU
#define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X"
#define MSG_DELTA_CALIBRATE_Y "Calibrate Y"
#define MSG_DELTA_CALIBRATE_Z "Calibrate Z"
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA_CALIBRATION_MENU
#endif // LANGUAGE_CN_H

@ -13,7 +13,7 @@
#endif #endif
//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays //#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays
#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA) ) #if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA)|| defined(DISPLAY_CHARSET_ISO10646_CN) )
#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays. #define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
#endif #endif

@ -16,8 +16,8 @@
//#define PAGE_HEIGHT 16 //256 byte framebuffer //#define PAGE_HEIGHT 16 //256 byte framebuffer
#define PAGE_HEIGHT 32 //512 byte framebuffer #define PAGE_HEIGHT 32 //512 byte framebuffer
#define WIDTH 128 #define LCD_PIXEL_WIDTH 128
#define HEIGHT 64 #define LCD_PIXEL_HEIGHT 64
#include <U8glib.h> #include <U8glib.h>
@ -64,12 +64,12 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
ST7920_WRITE_BYTE(0x01); //clear CGRAM ram ST7920_WRITE_BYTE(0x01); //clear CGRAM ram
u8g_Delay(15); //delay for CGRAM clear u8g_Delay(15); //delay for CGRAM clear
ST7920_WRITE_BYTE(0x3E); //extended mode + GDRAM active ST7920_WRITE_BYTE(0x3E); //extended mode + GDRAM active
for(y=0;y<HEIGHT/2;y++) //clear GDRAM for(y=0;y<LCD_PIXEL_HEIGHT/2;y++) //clear GDRAM
{ {
ST7920_WRITE_BYTE(0x80|y); //set y ST7920_WRITE_BYTE(0x80|y); //set y
ST7920_WRITE_BYTE(0x80); //set x = 0 ST7920_WRITE_BYTE(0x80); //set x = 0
ST7920_SET_DAT(); ST7920_SET_DAT();
for(i=0;i<2*WIDTH/8;i++) //2x width clears both segments for(i=0;i<2*LCD_PIXEL_WIDTH/8;i++) //2x width clears both segments
ST7920_WRITE_BYTE(0); ST7920_WRITE_BYTE(0);
ST7920_SET_CMD(); ST7920_SET_CMD();
} }
@ -103,7 +103,7 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
} }
ST7920_SET_DAT(); ST7920_SET_DAT();
ST7920_WRITE_BYTES(ptr,WIDTH/8); //ptr is incremented inside of macro ST7920_WRITE_BYTES(ptr,LCD_PIXEL_WIDTH/8); //ptr is incremented inside of macro
y++; y++;
} }
ST7920_NCS(); ST7920_NCS();
@ -119,8 +119,8 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
#endif #endif
} }
uint8_t u8g_dev_st7920_128x64_rrd_buf[WIDTH*(PAGE_HEIGHT/8)] U8G_NOCOMMON; uint8_t u8g_dev_st7920_128x64_rrd_buf[LCD_PIXEL_WIDTH*(PAGE_HEIGHT/8)] U8G_NOCOMMON;
u8g_pb_t u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT,HEIGHT,0,0,0},WIDTH,u8g_dev_st7920_128x64_rrd_buf}; u8g_pb_t u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT,LCD_PIXEL_HEIGHT,0,0,0},LCD_PIXEL_WIDTH,u8g_dev_st7920_128x64_rrd_buf};
u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn,&u8g_dev_st7920_128x64_rrd_pb,&u8g_com_null_fn}; u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn,&u8g_dev_st7920_128x64_rrd_pb,&u8g_com_null_fn};
class U8GLIB_ST7920_128X64_RRD : public U8GLIB class U8GLIB_ST7920_128X64_RRD : public U8GLIB

Loading…
Cancel
Save